You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EDIT: Getting closer to the root issue, which is pretty different than the original mentioned problem. Changing the original post.
Configure scripts created by autogen / autoconf seem to expose a toolchain bug with clang / libc++
The scripts send CXXFLAGS to the linker stage when checking if the c++ compiler works. The flag "-funwind-tables" causes the linker to fail with the following error
configure:16806: checking whether the C++ compiler works
configure:16822: arm-linux-androideabi-clang++ -o conftest --sysroot=~/Toolchains/arm/sysroot -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections **-funwind-tables** -fstack-protector -fno-strict-aliasing -frtti -fexceptions -march=armv7-a conftest.cpp >&5
/Volumes/Android/buildbot/out_dirs/aosp-ndk-r11-release/build/tmp/build-57861/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_handlers.cpp:112: error: undefined reference to '__atomic_exchange_4'
/Volumes/Android/buildbot/out_dirs/aosp-ndk-r11-release/build/tmp/build-57861/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_default_handlers.cpp:106: error: undefined reference to '__atomic_exchange_4'
/Volumes/Android/buildbot/out_dirs/aosp-ndk-r11-release/build/tmp/build-57861/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_default_handlers.cpp:117: error: undefined reference to '__atomic_exchange_4'
The error is suppressed if you add "-E" to your CXX/CPP command, but causes issues with the compiler being in 'compile only mode' when you're actually trying to link.
Even without that specific flag, I am not able to build any project that uses autoconf / libtool. The furthest I've gotten is the linker stage of the library, where I again run into atomic symbol problems.
/Volumes/Android/buildbot/out_dirs/aosp-ndk-r11-release/build/tmp/build-92934/build-libc++/ndk/sources/cxx-stl/llvm-libc++/libcxx/include/atomic:922: error: undefined reference to '__atomic_fetch_add_4'
/Volumes/Android/buildbot/out_dirs/aosp-ndk-r11-release/build/tmp/build-92934/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_handlers.cpp:112: error: undefined reference to '__atomic_exchange_4'
/Volumes/Android/buildbot/out_dirs/aosp-ndk-r11-release/build/tmp/build-92934/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_default_handlers.cpp:106: error: undefined reference to '__atomic_exchange_4'
I've reproduced this problem with zeromq 4.1.4 and protobuf 2.6.1. As far as I know, neither of these libraries are expecting libatomic at all.
The text was updated successfully, but these errors were encountered:
Needing to add -latomic to your ldflags for standalone toolchains is pretty common. It's annoying that it's necessary, and we're looking in to fixing clang to do this automatically, but for now you'll want to manually add it to your configure ldflags.
Go ahead and reopen the bug if that doesn't fix the issue.
EDIT: Getting closer to the root issue, which is pretty different than the original mentioned problem. Changing the original post.
Configure scripts created by autogen / autoconf seem to expose a toolchain bug with clang / libc++
The scripts send CXXFLAGS to the linker stage when checking if the c++ compiler works. The flag "-funwind-tables" causes the linker to fail with the following error
The error is suppressed if you add "-E" to your CXX/CPP command, but causes issues with the compiler being in 'compile only mode' when you're actually trying to link.
Even without that specific flag, I am not able to build any project that uses autoconf / libtool. The furthest I've gotten is the linker stage of the library, where I again run into atomic symbol problems.
I've reproduced this problem with zeromq 4.1.4 and protobuf 2.6.1. As far as I know, neither of these libraries are expecting libatomic at all.
The text was updated successfully, but these errors were encountered: