diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2019-07-03 16:32:01 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2019-07-03 16:32:01 +0000 |
commit | 3da9ad1dd557211f7c8accc1fdded0a1bd3524cc (patch) | |
tree | 037205109c832b00540056272e7dd70839124fd8 | |
parent | 38de5907b43ad21c12f270451b11af0fe15c3c21 (diff) | |
download | compiler-rt-3da9ad1dd557211f7c8accc1fdded0a1bd3524cc.tar.gz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365052 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/scudo/standalone/tests/CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/scudo/standalone/tests/CMakeLists.txt b/lib/scudo/standalone/tests/CMakeLists.txt index 8a3c4cde0..039ad483c 100644 --- a/lib/scudo/standalone/tests/CMakeLists.txt +++ b/lib/scudo/standalone/tests/CMakeLists.txt @@ -23,6 +23,8 @@ foreach(lib ${SANITIZER_TEST_CXX_LIBRARIES}) 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}) |