[libcxx-commits] [libcxxabi] [libc++abi] Always re-export std:: exception types from libc++abi (PR #84031)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 5 07:32:50 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxxabi

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

We always provide the std:: exception types, even when exceptions are disabled. This is a bit counter-intuitive, but these exception types are just normal types at the end of the day so we made the decision to always provide their definition. Failure to re-export these types would cause libc++ to fail to link on Apple platforms when exceptions are disabled.

---
Full diff: https://github.com/llvm/llvm-project/pull/84031.diff


1 Files Affected:

- (modified) libcxxabi/src/CMakeLists.txt (+4-1) 


``````````diff
diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 0f17ea9184c824..0af4dc1448e91a 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -230,9 +230,12 @@ if (LIBCXXABI_ENABLE_SHARED)
     reexport_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/new-delete.exp")
   endif()
 
+  # Note that std:: exception types are always defined by the library regardless of
+  # whether the exception runtime machinery is provided.
+  reexport_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/std-exceptions.exp")
+
   if (LIBCXXABI_ENABLE_EXCEPTIONS)
     reexport_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/itanium-exceptions.exp")
-    reexport_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/std-exceptions.exp")
 
     if ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "^(armv6|armv7|armv7s)$")
       reexport_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/personality-sjlj.exp")

``````````

</details>


https://github.com/llvm/llvm-project/pull/84031


More information about the libcxx-commits mailing list