Skip to content

Commit

Permalink
lld: link libatomic if needed for Timer
Browse files Browse the repository at this point in the history
D80298 made Timer::total atomic, but this requires linking libatomic
on some targets.

Reviewed By: aaronpuchert

Differential Revision: https://reviews.llvm.org/D85691
  • Loading branch information
cuviper committed Aug 22, 2020
1 parent f55ad39 commit b26b32b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions lld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
include(AddLLVM)
include(TableGen)
include(HandleLLVMOptions)
include(CheckAtomic)

if(LLVM_INCLUDE_TESTS)
if(CMAKE_VERSION VERSION_LESS 3.12)
Expand Down
8 changes: 7 additions & 1 deletion lld/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -50,7 +56,7 @@ add_lld_library(lldCommon
Target

LINK_LIBS
${LLVM_PTHREAD_LIB}
${LLD_SYSTEM_LIBS}

DEPENDS
intrinsics_gen
Expand Down

0 comments on commit b26b32b

Please sign in to comment.