[libcxx-commits] [libcxxabi] [libcxxabi] declare __gnu_unwind_frame when not using libunwind (PR #189280)

Andrew Marshall via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 29 13:10:13 PDT 2026


https://github.com/planetmarshall updated https://github.com/llvm/llvm-project/pull/189280

>From 64c24f00ead7c5af6bffd4929c4ec47972d13e3a Mon Sep 17 00:00:00 2001
From: Andrew Marshall <planetmarshalluk at gmail.com>
Date: Sun, 29 Mar 2026 20:49:33 +0100
Subject: [PATCH] [libcxxabi] declare __gnu_unwind_frame when not using
 libunwind

---
 libcxxabi/src/cxa_personality.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libcxxabi/src/cxa_personality.cpp b/libcxxabi/src/cxa_personality.cpp
index 35f4e38077248..9c2edf56f520a 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -1116,6 +1116,10 @@ __gxx_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,
 
 #else
 
+#  if !defined(_LIBUNWIND_VERSION)
+extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*, _Unwind_Context*);
+#  endif
+
 // Helper function to unwind one frame.
 // ARM EHABI 7.3 and 7.4: If the personality function returns _URC_CONTINUE_UNWIND, the
 // personality routine should update the virtual register set (VRS) according to the
@@ -1134,9 +1138,9 @@ static _Unwind_Reason_Code continue_unwind(_Unwind_Exception* unwind_exception,
 }
 
 // ARM register names
-#if !defined(_LIBUNWIND_VERSION)
+#  if !defined(_LIBUNWIND_VERSION)
 static const uint32_t REG_UCB = 12;  // Register to save _Unwind_Control_Block
-#endif
+#  endif
 static const uint32_t REG_SP = 13;
 
 static void save_results_to_barrier_cache(_Unwind_Exception* unwind_exception,



More information about the libcxx-commits mailing list