[libcxx-commits] [PATCH] D121015: [libunwind] Add a _LIBUNWIND_VERSION macro

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 4 11:36:16 PST 2022


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

This allows us to detect whether we're being compiled with LLVM's libunwind
more easily, without CMake having to set explicit variables.

As discussed in https://llvm.org/D119538.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121015

Files:
  libcxx/docs/Contributing.rst
  libcxxabi/CMakeLists.txt
  libcxxabi/src/cxa_personality.cpp
  libunwind/include/__libunwind_config.h


Index: libunwind/include/__libunwind_config.h
===================================================================
--- libunwind/include/__libunwind_config.h
+++ libunwind/include/__libunwind_config.h
@@ -9,6 +9,8 @@
 #ifndef ____LIBUNWIND_CONFIG_H__
 #define ____LIBUNWIND_CONFIG_H__
 
+#define _LIBUNWIND_VERSION 15000
+
 #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
     !defined(__ARM_DWARF_EH__)
 #define _LIBUNWIND_ARM_EHABI
Index: libcxxabi/src/cxa_personality.cpp
===================================================================
--- libcxxabi/src/cxa_personality.cpp
+++ libcxxabi/src/cxa_personality.cpp
@@ -1015,7 +1015,7 @@
 }
 
 // ARM register names
-#if !defined(LIBCXXABI_USE_LLVM_UNWINDER)
+#if !defined(_LIBUNWIND_VERSION)
 static const uint32_t REG_UCB = 12;  // Register to save _Unwind_Control_Block
 #endif
 static const uint32_t REG_SP = 13;
@@ -1050,7 +1050,7 @@
 
     bool native_exception = __isOurExceptionClass(unwind_exception);
 
-#if !defined(LIBCXXABI_USE_LLVM_UNWINDER)
+#if !defined(_LIBUNWIND_VERSION)
     // Copy the address of _Unwind_Control_Block to r12 so that
     // _Unwind_GetLanguageSpecificData() and _Unwind_GetRegionStart() can
     // return correct address.
Index: libcxxabi/CMakeLists.txt
===================================================================
--- libcxxabi/CMakeLists.txt
+++ libcxxabi/CMakeLists.txt
@@ -478,11 +478,6 @@
   add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 endif()
 
-# Define LIBCXXABI_USE_LLVM_UNWINDER for conditional compilation.
-if (LIBCXXABI_USE_LLVM_UNWINDER)
-  add_definitions(-DLIBCXXABI_USE_LLVM_UNWINDER)
-endif()
-
 if (LIBCXXABI_SILENT_TERMINATE)
   add_definitions(-DLIBCXXABI_SILENT_TERMINATE)
 endif()
Index: libcxx/docs/Contributing.rst
===================================================================
--- libcxx/docs/Contributing.rst
+++ libcxx/docs/Contributing.rst
@@ -70,6 +70,7 @@
 2. Update the ``libcxx/include/__libcpp_version`` file
 3. Update the version number in ``libcxx/docs/conf.py``
 4. Update ``_LIBCPPABI_VERSION`` in ``libcxxabi/include/cxxabi.h``
+5. Update ``_LIBUNWIND_VERSION`` in ``libunwind/include/__libunwind_config.h``
 
 Exporting new symbols from the library
 ======================================


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121015.413084.patch
Type: text/x-patch
Size: 2251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220304/fd81bae2/attachment-0001.bin>


More information about the libcxx-commits mailing list