[PATCH] D136281: [lld] [CMake] Link liblldCOFF against libatomic when necessary

Sam James via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 12:11:24 PDT 2022


thesamesam created this revision.
thesamesam added reviewers: mgorny, MaskRay.
Herald added a subscriber: StephenFan.
Herald added a project: All.
thesamesam requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Also simplify code for liblldCommon using the new LLVM_ATOMIC_LIB variable.

Depends on D136280 <https://reviews.llvm.org/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>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136281

Files:
  lld/COFF/CMakeLists.txt
  lld/Common/CMakeLists.txt


Index: lld/Common/CMakeLists.txt
===================================================================
--- lld/Common/CMakeLists.txt
+++ 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 @@
   Target
 
   LINK_LIBS
-  ${LLD_SYSTEM_LIBS}
+  ${LLVM_PTHREAD_LIB}
+  ${LLVM_ATOMIC_LIB}
 
   DEPENDS
   intrinsics_gen
Index: lld/COFF/CMakeLists.txt
===================================================================
--- lld/COFF/CMakeLists.txt
+++ lld/COFF/CMakeLists.txt
@@ -44,6 +44,7 @@
   LINK_LIBS
   lldCommon
   ${LLVM_PTHREAD_LIB}
+  ${LLVM_ATOMIC_LIB}
 
   DEPENDS
   COFFOptionsTableGen


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136281.469002.patch
Type: text/x-patch
Size: 852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221019/dc91fa35/attachment.bin>


More information about the llvm-commits mailing list