[llvm-branch-commits] [libcxxabi] release/22.x: libcxxabi: declare __gnu_unwind_frame in cxa_personality (#189787) (PR #194305)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Apr 27 00:42:48 PDT 2026


https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/194305

Backport 8119f1854948b50358bbfaea08f207f51970f06c

Requested by: @alexrp

>From 7fc01bd5ae1d0da04646425bedbe5d16b28bb8b0 Mon Sep 17 00:00:00 2001
From: Khem Raj <khem.raj at oss.qualcomm.com>
Date: Mon, 27 Apr 2026 00:35:24 -0700
Subject: [PATCH] libcxxabi: declare __gnu_unwind_frame in cxa_personality
 (#189787)

ARM EHABI builds of libcxxabi fail with clang-22+ because
cxa_personality.cpp calls __gnu_unwind_frame without a visible
declaration, triggering:

  error: use of undeclared identifier '__gnu_unwind_frame'

Add an extern "C" forward declaration before the EHABI unwind helper so
the source compiles correctly.

Signed-off-by: Khem Raj <khem.raj at oss.qualcomm.com>
(cherry picked from commit 8119f1854948b50358bbfaea08f207f51970f06c)
---
 libcxxabi/src/cxa_personality.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libcxxabi/src/cxa_personality.cpp b/libcxxabi/src/cxa_personality.cpp
index 77b2eb53af0e4..28208194edb3e 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -1125,6 +1125,8 @@ __gxx_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,
 
 #else
 
+extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*, _Unwind_Context*);
+
 // 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



More information about the llvm-branch-commits mailing list