[libcxx-commits] [libcxxabi] 1f3f483 - [libcxxabi][CMake] Set --unwindlib=none when using LLVM libunwind

Petr Hosek via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 14 11:59:50 PDT 2022


Author: Petr Hosek
Date: 2022-07-14T18:59:40Z
New Revision: 1f3f4833eae7ec276530ad0c0018d46a01563420

URL: https://github.com/llvm/llvm-project/commit/1f3f4833eae7ec276530ad0c0018d46a01563420
DIFF: https://github.com/llvm/llvm-project/commit/1f3f4833eae7ec276530ad0c0018d46a01563420.diff

LOG: [libcxxabi][CMake] Set --unwindlib=none when using LLVM libunwind

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

Differential Revision: https://reviews.llvm.org/D129469

Added: 
    

Modified: 
    libcxxabi/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index a8c79aa6f380a..248acc6567ab9 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -99,6 +99,13 @@ else()
   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


        


More information about the libcxx-commits mailing list