[PATCH] D64134: [scudo][standalone] Link tests against libatomic

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 07:51:54 PDT 2019


cryptoad created this revision.
cryptoad added reviewers: morehouse, eugenis, vitalybuka, hctim, tejohnson.
Herald added subscribers: Sanitizers, jfb, delcypher, mgorny.
Herald added projects: LLVM, Sanitizers.

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.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D64134

Files:
  lib/scudo/standalone/tests/CMakeLists.txt


Index: lib/scudo/standalone/tests/CMakeLists.txt
===================================================================
--- lib/scudo/standalone/tests/CMakeLists.txt
+++ lib/scudo/standalone/tests/CMakeLists.txt
@@ -23,6 +23,8 @@
   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})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64134.207797.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190703/bf470618/attachment.bin>


More information about the llvm-commits mailing list