|
Hi all, We're noticing a regression moving to NDK r11. Linking of a project that refers to isnan() and isnanf() fails. The same code compiled and linked with NDK r10e works fine. Example of errors: jni/../../../android/obj/local/armeabi/libosgUtil.a(CullVisitor.o):/opt/OpenSceneGraph/Android/osg-git-android/src/osgUtil/CullVisitor.cpp:function osgUtil::CullVisitor::apply(osg::Geode&): error: undefined reference to 'isnanf' jni/../../../android/obj/local/armeabi/libosgUtil.a(CullVisitor.o):/opt/OpenSceneGraph/Android/osg-git-android/src/osgUtil/CullVisitor.cpp:function osgUtil::CullVisitor::apply(osg::Billboard&): error: undefined reference to 'isnanf' jni/../../../android/obj/local/armeabi/libosgUtil.a(IntersectVisitor.o):/opt/OpenSceneGraph/Android/osg-git-android/src/osgUtil/IntersectVisitor.cpp:function osg::LineSegment::valid() const: error: undefined reference to 'isnan' Our Android.mk includes: APP_STL := c++_shared APP_CPPFLAGS := -frtti -fexceptions NDK_TOOLCHAIN_VERSION := clang A couple of tests show that the linker is looking for the undecorated isnan and isnanf symbols, and that these should are found in libc.so, which should automatically be linked as a dependency of libc++_shared.so $NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-nm -g ../../android/obj/local/armeabi/libosgUtil.a | grep isnan U isnanf U isnan $NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-nm -gD $NDK/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so | grep isnan 0000a96c T __isnan 0000a980 T __isnanf 0000a994 T __isnanl 0000ccbc T isnan 0000ccd0 T isnanf 0000cce4 T isnanl $NDK/ndk-depends /opt/OpenSceneGraph/Android/osg-git-android/build/osg-root/obj/local/armeabi/libc++_shared.so libc++_shared.so libm.so libdl.so libc.so I'm a bit stumped as to why this won't link. I've tried explicitly adding -lc to my LOCAL_LDLIBS, but it makes no difference. Regards, Phil. You received this message because you are subscribed to the Google Groups "android-ndk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/android-ndk. For more options, visit https://groups.google.com/d/optout. asked Mar 23 2016 at 21:08 |