[libcxx-commits] [PATCH] D68791: [libc++] Fix linker script generation

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 10 08:22:01 PDT 2019


phosek created this revision.
phosek added reviewers: ldionne, EricWF.
Herald added subscribers: libcxx-commits, dexonsmith, christof, mgorny.

Handle the case when libc++abi and libunwind are being built together
with libc++ in the runtimes build. This logic was used in the previous
implementation but dropped in r374116.


Repository:
  rCXX libc++

https://reviews.llvm.org/D68791

Files:
  libcxx/cmake/Modules/DefineLinkerScript.cmake


Index: libcxx/cmake/Modules/DefineLinkerScript.cmake
===================================================================
--- libcxx/cmake/Modules/DefineLinkerScript.cmake
+++ libcxx/cmake/Modules/DefineLinkerScript.cmake
@@ -31,7 +31,9 @@
   set(link_libraries)
   if (interface_libs)
     foreach(lib IN LISTS interface_libs)
-      if (TARGET "${lib}")
+      if (TARGET "${lib}" OR
+          (${lib} MATCHES "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI) OR
+          (${lib} MATCHES "unwind(_static|_shared)?" AND HAVE_LIBUNWIND))
         list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}$<TARGET_PROPERTY:${lib},OUTPUT_NAME>")
       else()
         list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}${lib}")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68791.224346.patch
Type: text/x-patch
Size: 726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20191010/ddedbada/attachment.bin>


More information about the libcxx-commits mailing list