[dsymutil] Explicitly link against libatomic when necessary

In some systems, such as RISC-V, atomic support requires explicit linking
against '-latomic' (see https://github.com/riscv/riscv-gcc/issues/12).

Reviewers: davezarzycki, hhb, beanz, jfb, JDevlieghere
Reviewed By: beanz, JDevlieghere
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69003
This commit is contained in:
Gokturk Yuksek 2020-02-17 22:26:59 +00:00 committed by Luís Marques
parent e5608f4ac0
commit 715ddfd799

View File

@ -37,3 +37,7 @@ add_llvm_tool(dsymutil
if(APPLE)
target_link_libraries(dsymutil PRIVATE "-framework CoreFoundation")
endif(APPLE)
if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
target_link_libraries(dsymutil PRIVATE atomic)
endif()