The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=15514 
====================================================================== 
Reported By:                David Borel
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15514
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2015-04-15 14:14 EDT
Last Modified:              2015-04-15 14:14 EDT
====================================================================== 
Summary:                    SWIG_ADD_MODULE omits all symbols from .so on NDK
Description: 
I'm trying to use SWIG to generate a C# wrapper for a C++ shared library. I've
configured CMake to build two dynamic libs: one SHARED lib for the native layer
and one SWIG module for the wrapper. Everything works fine on Windows and Mac.
On Android, the first shared library exports all the correct symbols. But the
SWIG module does not export anything. SWIG generates the correct _wrap.cxx file
and C# files. But all exports from the cxx file are missing from the module's
.so. I see all of the symbols in the _wrap.cxx.o file, so there appears to be a
problem with the linker settings used by CMake. I've pasted the linker command
line below.

Steps to Reproduce: 
Compile any SWIG C# wrapper for NDK.

Additional Information: 
C:\Users\dborel\Documents\Projects\ndk\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-gcc.exe
 -fPIC -fexceptions -frtti -Wno-psabi
--sysroot=C:/Users/dborel/Documents/Projects/ndk/platforms/android-8/arch-arm
-fpic -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes
-march=armv7-a -mfloat-abi=softfp -mfpu=neon -fdata-sections -ffunction-sections
-Wa,--noexecstack  -std=c++11 -marm -fno-omit-frame-pointer -fno-strict-aliasing
-O0 -g -DDEBUG -D_DEBUG  -Wl,--fix-cortex-a8 -Wl,--no-undefined
-Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now  -shared
-Wl,-soname, -o libs\armeabi-v7a\libOVRPluginNET.so
CMakeFiles/OVRPluginNET.dir/Generated/OVRPluginCSHARP_wrap.cxx.o 
-LC:\Users\dborel\Documents\Projects\ndk\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\user\libs\armeabi-v7a
 -LC:\Users\dborel\Documents\Projects\ndk\platforms\android-19\arch-arm\usr\lib 
-LC:\Users\dborel\Documents\Projects\UnitySDK\OVRPlugin\..\3rdParty\VRLib\Lib
libs\armeabi-v7a\libOVRPlugin.so -loculus -lz -ljpeg -lGLESv3 -lEGL -llog
-landroid 
"C:/Users/dborel/Documents/Projects/ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a"
"C:/Users/dborel/Documents/Projects/ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libsupc++.a"
-lm

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-04-15 14:14 David Borel    New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to