https://llvm.org/bugs/show_bug.cgi?id=31620
Bug ID: 31620 Summary: undefined reference to '__sync_val_compare_and_swap_16' Product: libc++ Version: unspecified Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedclangb...@nondot.org Reporter: dvyu...@google.com CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com Classification: Unclassified I am on r291667. Linux/x86_64. libcxx and libcxxabi are checked out into projects. The program is: #include <atomic> int main() { struct X { int a, b, c, d; }; std::atomic<X> x; X b, c; x.compare_exchange_strong(b, c); } $ clang++ test.cc -std=c++11 -stdlib=libc++ /tmp/test-7383d8.o: In function `main': /tmp/test.cc:(.text+0xd): undefined reference to `__sync_val_compare_and_swap_16' clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation) Adding -latomic does not help, libatomic does not provide such function. A new tsan test fails with a more elaborate error pointing to exact location, for some reason it's generated for load function: /tmp/lit_tmp_3Uws7l/atomic_test-af5f74.o: In function `load': /llvm4/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/atomic:893: undefined reference to `__sync_val_compare_and_swap_16' /tmp/lit_tmp_3Uws7l/atomic_test-af5f74.o:/llvm4/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/atomic:893: more undefined references to `__sync_val_compare_and_swap_16' follow clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation) What am I doing wrong? -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs