[compiler-rt] r365052 - [scudo][standalone] Link tests against libatomic
Kostya Kortchinsky via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 09:32:02 PDT 2019
Author: cryptoad
Date: Wed Jul 3 09:32:01 2019
New Revision: 365052
URL: http://llvm.org/viewvc/llvm-project?rev=365052&view=rev
Log:
[scudo][standalone] Link tests against libatomic
Summary:
Some clang versions (< 6.0) do not inline the atomic builtin functions
leaving unresolved references to `__atomic_load_8` and so on (seems to
be mostly 64-bit atomics on 32-bit platforms).
I tried without success to use some cmake magic to detect when that
would be the case, and decided to fall back to unconditionally
linking libatomic.
Reviewers: morehouse, eugenis, vitalybuka, hctim, tejohnson
Reviewed By: tejohnson
Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D64134
Modified:
compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt
Modified: compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt?rev=365052&r1=365051&r2=365052&view=diff
==============================================================================
--- compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt Wed Jul 3 09:32:01 2019
@@ -23,6 +23,8 @@ foreach(lib ${SANITIZER_TEST_CXX_LIBRARI
list(APPEND LINK_FLAGS -l${lib})
endforeach()
list(APPEND LINK_FLAGS -pthread)
+# Linking against libatomic is required with some compilers
+list(APPEND LINK_FLAGS -latomic)
set(SCUDO_TEST_HEADERS)
foreach (header ${SCUDO_HEADERS})
More information about the llvm-commits
mailing list