[lld] f0b451c - Link liblldCOFF against libatomic when necessary
Michał Górny via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 3 13:08:14 PDT 2022
Author: Sam James
Date: 2022-11-03T21:07:43+01:00
New Revision: f0b451c77f14947e3e7d314f048679fa2f5c6298
URL: https://github.com/llvm/llvm-project/commit/f0b451c77f14947e3e7d314f048679fa2f5c6298
DIFF: https://github.com/llvm/llvm-project/commit/f0b451c77f14947e3e7d314f048679fa2f5c6298.diff
LOG: Link liblldCOFF against libatomic when necessary
Also simplify code for liblldCommon using the new LLVM_ATOMIC_LIB variable.
Depends on D136280.
Bug: https://bugs.gentoo.org/832675
Thanks-to: Arfrever Frehtes Taifersar Arahesis <Arfrever at Apache.Org>
Tested-by: erhard_f at mailbox.org <erhard_f at mailbox.org>
Differential Revision: https://reviews.llvm.org/D136281
Added:
Modified:
lld/COFF/CMakeLists.txt
lld/Common/CMakeLists.txt
Removed:
################################################################################
diff --git a/lld/COFF/CMakeLists.txt b/lld/COFF/CMakeLists.txt
index d289bd5910348..55aec26854c8d 100644
--- a/lld/COFF/CMakeLists.txt
+++ b/lld/COFF/CMakeLists.txt
@@ -44,6 +44,7 @@ add_lld_library(lldCOFF
LINK_LIBS
lldCommon
${LLVM_PTHREAD_LIB}
+ ${LLVM_ATOMIC_LIB}
DEPENDS
COFFOptionsTableGen
diff --git a/lld/Common/CMakeLists.txt b/lld/Common/CMakeLists.txt
index 1ae7da1f5f7f0..9c23ed3952235 100644
--- a/lld/Common/CMakeLists.txt
+++ b/lld/Common/CMakeLists.txt
@@ -1,9 +1,3 @@
-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)
@@ -54,7 +48,8 @@ add_lld_library(lldCommon
Target
LINK_LIBS
- ${LLD_SYSTEM_LIBS}
+ ${LLVM_PTHREAD_LIB}
+ ${LLVM_ATOMIC_LIB}
DEPENDS
intrinsics_gen
More information about the llvm-commits
mailing list