[PATCH] D70868: [libunwind] Emit dependent libraries only when detected by CMake

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 1 08:23:15 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG35bc5276ca31: [libunwind] Emit dependent libraries only when detected by CMake (authored by mgorny).
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70868/new/

https://reviews.llvm.org/D70868

Files:
  libunwind/CMakeLists.txt
  libunwind/src/AddressSpace.hpp
  libunwind/src/RWMutex.hpp


Index: libunwind/src/RWMutex.hpp
===================================================================
--- libunwind/src/RWMutex.hpp
+++ libunwind/src/RWMutex.hpp
@@ -17,7 +17,7 @@
 #include <windows.h>
 #elif !defined(_LIBUNWIND_HAS_NO_THREADS)
 #include <pthread.h>
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBUNWIND_LINK_PTHREAD_LIB)
 #pragma comment(lib, "pthread")
 #endif
 #endif
Index: libunwind/src/AddressSpace.hpp
===================================================================
--- libunwind/src/AddressSpace.hpp
+++ libunwind/src/AddressSpace.hpp
@@ -27,7 +27,7 @@
 
 #if _LIBUNWIND_USE_DLADDR
 #include <dlfcn.h>
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBUNWIND_LINK_DL_LIB)
 #pragma comment(lib, "dl")
 #endif
 #endif
Index: libunwind/CMakeLists.txt
===================================================================
--- libunwind/CMakeLists.txt
+++ libunwind/CMakeLists.txt
@@ -352,7 +352,12 @@
 endif()
 
 if (LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
-  add_definitions(-D_LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
+  if (LIBUNWIND_HAS_DL_LIB)
+    add_definitions(-D_LIBUNWIND_LINK_DL_LIB)
+  endif()
+  if (LIBUNWIND_HAS_PTHREAD_LIB)
+    add_definitions(-D_LIBUNWIND_LINK_PTHREAD_LIB)
+  endif()
 endif()
 
 #===============================================================================


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70868.231614.patch
Type: text/x-patch
Size: 1486 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191201/8edd6fd6/attachment.bin>


More information about the cfe-commits mailing list