summaryrefslogtreecommitdiff
path: root/lld/Common
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2020-08-17 15:31:32 -0700
committerJosh Stone <jistone@redhat.com>2020-08-21 17:47:55 -0700
commitb26b32b5d3b85812a12f5e3bf011428612f78e19 (patch)
treedc8ce419105f888304ce6d504f37d853f2806eb2 /lld/Common
parentf55ad3973dec62b1dd6dbe9c4eb81c5e883e3628 (diff)
downloadllvm-b26b32b5d3b85812a12f5e3bf011428612f78e19.tar.gz
lld: link libatomic if needed for Timer
D80298 made Timer::total atomic, but this requires linking libatomic on some targets. Reviewed By: aaronpuchert Differential Revision: https://reviews.llvm.org/D85691
Diffstat (limited to 'lld/Common')
-rw-r--r--lld/Common/CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/lld/Common/CMakeLists.txt b/lld/Common/CMakeLists.txt
index 212328b784c5..bfa4f7b8ee58 100644
--- a/lld/Common/CMakeLists.txt
+++ b/lld/Common/CMakeLists.txt
@@ -1,3 +1,9 @@
+set(LLD_SYSTEM_LIBS ${LLVM_PTHREAD_LIB})
+
+if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+ list(APPEND LLD_SYSTEM_LIBS atomic)
+endif()
+
find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
find_first_existing_vc_file("${LLD_SOURCE_DIR}" lld_vc)
@@ -50,7 +56,7 @@ add_lld_library(lldCommon
Target
LINK_LIBS
- ${LLVM_PTHREAD_LIB}
+ ${LLD_SYSTEM_LIBS}
DEPENDS
intrinsics_gen