[PATCH] D100999: [lld-macho] Fix BUILD_SHARED_LIBS build

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 21 14:59:31 PDT 2021


arichardson created this revision.
arichardson added reviewers: lld-macho, int3, thakis.
Herald added subscribers: pengfei, mgorny.
Herald added a project: lld-macho.
arichardson requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

ca6751043d8899b12baeb48621e61fb352cfee09 <https://reviews.llvm.org/rGca6751043d8899b12baeb48621e61fb352cfee09> 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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100999

Files:
  lld/MachO/CMakeLists.txt


Index: lld/MachO/CMakeLists.txt
===================================================================
--- lld/MachO/CMakeLists.txt
+++ lld/MachO/CMakeLists.txt
@@ -52,3 +52,7 @@
   MachOOptionsTableGen
   ${tablegen_deps}
   )
+
+if(HAVE_LIBXAR)
+  target_link_libraries(lldMachO2 PRIVATE ${XAR_LIB})
+endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100999.339397.patch
Type: text/x-patch
Size: 308 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210421/150a2065/attachment.bin>


More information about the llvm-commits mailing list