From: Kostya Kortchinsky Date: Wed, 3 Jul 2019 16:32:01 +0000 (+0000) Subject: [scudo][standalone] Link tests against libatomic X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f50a953ea77623fd286ef238f9bb49f56ad46fee;p=platform%2Fupstream%2Fllvm.git [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 llvm-svn: 365052 --- diff --git a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt index 8a3c4cd..039ad48 100644 --- a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt +++ b/compiler-rt/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})