dec1/Boost-for-Android

Linkage problems with only the armeabi-v7a architecture

Closed this issue · 1 comments

After downloading the prebuilt Boost 1.69.0 using NDK 19c, I've tried integrating it into our product using NDK 19c. The only architecture that fails to link against our Boost tests is armeabi-v7a.

Example:


[2/2] Linking �[33mbuild/.conf_check_7cf3e2ff755f756d861b132473258c5c/testbuild/testprog�[0m

['/<Sanitized>/androidNDK/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++', '--target=arm-linux-androideabi23', '-stdlib=libc++', '-static-libstdc++', 'test.cpp.1.o', '-o/<Sanitized>/build/.conf_check_7cf3e2ff755f756d861b132473258c5c/testbuild/testprog', '-Wl,-Bstatic', '-L/<Sanitized>/boost/lib/armeabi-v7a', '-lboost_chrono', '-lboost_filesystem', '-lboost_unit_test_framework', '-lboost_thread', '-lboost_system', '-lboost_date_time', '-lboost_program_options', '-lboost_regex', '-Wl,-Bdynamic', '-L/<Sanitized>/boost/lib/armeabi-v7a', '-landroid', '-llog', '-lGLESv2', '-lEGL']
err: test.cpp.1.o:test.cpp:function main: error: undefined reference to '__atomic_fetch_sub_4'
test.cpp.1.o:test.cpp:function main: error: undefined reference to '__atomic_fetch_sub_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>(): error: undefined reference to '__atomic_fetch_add_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>(): error: undefined reference to '__atomic_fetch_add_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>(): error: undefined reference to '__atomic_fetch_sub_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>(): error: undefined reference to '__atomic_fetch_sub_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_exception_>(): error: undefined reference to '__atomic_fetch_add_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_exception_>(): error: undefined reference to '__atomic_fetch_add_4'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
dec1 commented

try linking to the atomic library
eg '-lboost_atomic'