[PATCH] D23287: [libcxxabi] Add lib directory to list of linker directories

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 17:28:35 PDT 2016


phosek created this revision.
phosek added reviewers: EricWF, compnerd.
phosek added a subscriber: llvm-commits.

When using libunwind and not building as standalone project, we need to add LLVM library directory to the list of linker directories to ensure it can find libunwind dependency.

This wasn't previously needed since there was only only one `unwind` target and CMake resolved the name directly. However, with the latest change which allows building both static and shared version of libunwind in one build, that's no longer the case.

This fixes the failure introduced in the latest libunwind change.

https://reviews.llvm.org/D23287

Files:
  src/CMakeLists.txt

Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -55,6 +55,9 @@
 append_if(libraries LIBCXXABI_HAS_C_LIB c)
 
 if (LIBCXXABI_USE_LLVM_UNWINDER)
+  if (NOT LIBCXXABI_BUILT_STANDALONE)
+    link_directories(${LLVM_LIBRARY_DIR})
+  endif()
   list(APPEND libraries unwind)
 else()
   append_if(libraries LIBCXXABI_HAS_GCC_S_LIB gcc_s)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23287.67258.patch
Type: text/x-patch
Size: 426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160809/1698300d/attachment.bin>


More information about the llvm-commits mailing list