[lld] 9034449 - [lld-macho] Fix BUILD_SHARED_LIBS build
Alex Richardson via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 3 12:00:11 PDT 2021
Author: Alex Richardson
Date: 2021-06-03T19:58:43+01:00
New Revision: 90344499ae76dffa56363e2f167c2c34a76cbfaf
URL: https://github.com/llvm/llvm-project/commit/90344499ae76dffa56363e2f167c2c34a76cbfaf
DIFF: https://github.com/llvm/llvm-project/commit/90344499ae76dffa56363e2f167c2c34a76cbfaf.diff
LOG: [lld-macho] Fix BUILD_SHARED_LIBS build
ca6751043d8899b12baeb48621e61fb352cfee09 added a dependency on XAR (at
least for the shared libs build), so without this change we get the
following linker error:
Undefined symbols for architecture x86_64:
"_xar_close", referenced from:
lld::macho::BitcodeBundleSection::finalize() in SyntheticSections.cpp.o
Reviewed By: #lld-macho, int3, thakis
Differential Revision: https://reviews.llvm.org/D100999
Added:
Modified:
lld/MachO/CMakeLists.txt
lld/tools/lld/CMakeLists.txt
Removed:
################################################################################
diff --git a/lld/MachO/CMakeLists.txt b/lld/MachO/CMakeLists.txt
index a805e1789e69d..61ac878ffbb7c 100644
--- a/lld/MachO/CMakeLists.txt
+++ b/lld/MachO/CMakeLists.txt
@@ -55,3 +55,7 @@ add_lld_library(lldMachO2
MachOOptionsTableGen
${tablegen_deps}
)
+
+if(LLVM_HAVE_LIBXAR)
+ target_link_libraries(lldMachO2 PRIVATE ${XAR_LIB})
+endif()
diff --git a/lld/tools/lld/CMakeLists.txt b/lld/tools/lld/CMakeLists.txt
index 738f484a97c21..e77b2161a8731 100644
--- a/lld/tools/lld/CMakeLists.txt
+++ b/lld/tools/lld/CMakeLists.txt
@@ -20,10 +20,6 @@ target_link_libraries(lld
lldWasm
)
-if(LLVM_HAVE_LIBXAR)
- target_link_libraries(lld PRIVATE ${XAR_LIB})
-endif()
-
install(TARGETS lld
RUNTIME DESTINATION bin)
More information about the llvm-commits
mailing list