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
This commit is contained in:
Josh Stone 2020-08-17 15:31:32 -07:00
parent f55ad3973d
commit b26b32b5d3
2 changed files with 8 additions and 1 deletions

View file

@ -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)

View file

@ -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