MantisBT - CMake
View Issue Details
0015514CMakeCMakepublic2015-04-15 14:142016-06-10 14:31
David Borel 
Kitware Robot 
highmajoralways
closedmoved 
Android API 19Windows 8.1x64
CMake 3.2.1 
 
0015514: SWIG_ADD_MODULE omits all symbols from .so on NDK
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.
Compile any SWIG C# wrapper for NDK.
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
No tags attached.
Issue History
2015-04-15 14:14David BorelNew Issue
2016-06-10 14:29Kitware RobotNote Added: 0042757
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042757)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.