[libcxx-commits] [libcxx] b1c9d3d - [libcxx] Add a dependency on unwind in cxx_static, if LIBCXXABI_USE_LLVM_UNWINDER is set

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 9 07:46:16 PST 2021


Author: Martin Storsjö
Date: 2021-11-09T17:44:48+02:00
New Revision: b1c9d3d29a1e3cc6a9ad6f0fd1a3a0fa15800f64

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

LOG: [libcxx] Add a dependency on unwind in cxx_static, if LIBCXXABI_USE_LLVM_UNWINDER is set

Even if building cxx_static in itself doesn't actually link in the
requested unwinder, add a synthetic dependency so that building
cxx_static makes sure that the unwinder that was requested to be used
also gets built.

This makes sure that tests (when run with just a plain "ninja check-cxx")
actually use the newly built unwinder, as intended.

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

Added: 
    

Modified: 
    libcxx/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index b5a870a5a4992..dbd0135fc9930 100644
--- a/libcxx/src/CMakeLists.txt
+++ b/libcxx/src/CMakeLists.txt
@@ -286,6 +286,13 @@ if (LIBCXX_ENABLE_STATIC)
   cxx_add_common_build_flags(cxx_static)
   cxx_set_common_defines(cxx_static)
 
+  if (LIBCXXABI_USE_LLVM_UNWINDER)
+    # If we intend to use the just-built unwinder, add a dependency so that it
+    # gets built, even if we technically aren't going to link it in at this
+    # stage.
+    add_dependencies(cxx_static unwind)
+  endif()
+
   if (LIBCXX_HERMETIC_STATIC_LIBRARY)
     # If the hermetic library doesn't define the operator new/delete functions
     # then its code shouldn't declare them with hidden visibility.  They might


        


More information about the libcxx-commits mailing list