-
Notifications
You must be signed in to change notification settings - Fork 281
Closed
Milestone
Description
Android NDK r12b's is generating linker error when luajit is present, with clang toolchain & c++_static STL.
The error is like this:
[armeabi-v7a] Gdbserver : [arm-linux-androideabi] libs/armeabi-v7a/gdbserver
[armeabi-v7a] Gdbsetup : libs/armeabi-v7a/gdb.setup
[armeabi-v7a] Compile++ thumb: hello-jni <= hello-jni.cpp
[armeabi-v7a] SharedLibrary : libhello-jni.so
/path/to/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /path/to/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a(pr-support.o): multiple definition of '_Unwind_GetRegionStart'
/path/to/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: /path/to/android-ndk-r12b/sources/cxx-stl/llvm-libc++abi/../llvm-libc++/libs/armeabi-v7a/libunwind.a(Unwind-EHABI.o): previous definition here
/path/to/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /path/to/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a(pr-support.o): multiple definition of '_Unwind_GetLanguageSpecificData'
/path/to/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: /path/to/android-ndk-r12b/sources/cxx-stl/llvm-libc++abi/../llvm-libc++/libs/armeabi-v7a/libunwind.a(Unwind-EHABI.o): previous definition here
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi-v7a/libhello-jni.so] Error 1
I have created a demo project to reproduce the problem: https://github.com/cezheng/luajit-failure-ndk-r12b. Detailed info about the demo is written in the README of the repo.
Just clone the project and run ndk-build.
Compiling with gcc 4.9 & gnustl_static seems to be fine.