[llvm-branch-commits] [lld] 4c3d838 - Link liblldCOFF against libatomic when necessary

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Nov 10 17:05:03 PST 2022


Author: Sam James
Date: 2022-11-10T17:04:34-08:00
New Revision: 4c3d83810ad7bde70b2665df9a15947695e92adb

URL: https://github.com/llvm/llvm-project/commit/4c3d83810ad7bde70b2665df9a15947695e92adb
DIFF: https://github.com/llvm/llvm-project/commit/4c3d83810ad7bde70b2665df9a15947695e92adb.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

(cherry picked from commit f0b451c77f14947e3e7d314f048679fa2f5c6298)

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-branch-commits mailing list