[libcxx-commits] [PATCH] D129469: [libcxxabi][CMake] Set --unwindlib=none when using LLVM libunwind

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 11 00:58:54 PDT 2022


phosek created this revision.
phosek added reviewers: ldionne, mstorsjo.
Herald added a subscriber: mgorny.
Herald added a project: All.
phosek requested review of this revision.
Herald added a project: libc++abi.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++abi.

We already link libunwinb explicitly so avoid trying to link toolchain's
default libunwind which may be missing. This matches what we already do
for libcxx.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129469

Files:
  libcxxabi/src/CMakeLists.txt


Index: libcxxabi/src/CMakeLists.txt
===================================================================
--- libcxxabi/src/CMakeLists.txt
+++ libcxxabi/src/CMakeLists.txt
@@ -99,6 +99,13 @@
   add_link_flags_if_supported(-nodefaultlibs)
 endif()
 
+if (CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG AND LIBCXXABI_USE_LLVM_UNWINDER)
+  # If we're linking directly against the libunwind that we're building
+  # in the same invocation, don't try to link in the toolchain's
+  # default libunwind (which may be missing still).
+  add_link_flags_if_supported(--unwindlib=none)
+endif()
+
 if ( APPLE )
   if (LLVM_USE_SANITIZER)
     if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129469.443570.patch
Type: text/x-patch
Size: 671 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220711/408b1fdd/attachment.bin>


More information about the libcxx-commits mailing list