Skip to content

[libcxxabi] declare __gnu_unwind_frame when not using libunwind - #189280

Closed
planetmarshall wants to merge 1 commit into
llvm:mainfrom
planetmarshall:libcxxabi-gnu-unwind-frame
Closed

[libcxxabi] declare __gnu_unwind_frame when not using libunwind#189280
planetmarshall wants to merge 1 commit into
llvm:mainfrom
planetmarshall:libcxxabi-gnu-unwind-frame

Conversation

@planetmarshall

@planetmarshall planetmarshall commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

#116261 removed the declaration of __gnu_unwind_frame and moved it to libunwind, however libunwind is not a required component for libcxxabi. Specifically, this does not compile for ARMv7 targets when libunwind is configured as part of llvm-libgcc where we must have LIBCXXABI_USE_LLVM_UNWINDER=OFF

This PR restores the declaration of __gnu_unwind_frame for ARMv7 targets when _LIBUNWIND_VERSION is not defined.

@planetmarshall
planetmarshall requested a review from a team as a code owner March 29, 2026 19:55
@github-actions

Copy link
Copy Markdown

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the libc++abi libc++abi C++ Runtime Library. Not libc++. label Mar 29, 2026
@llvmbot

llvmbot commented Mar 29, 2026

Copy link
Copy Markdown
Member

@llvm/pr-subscribers-libcxxabi

Author: Andrew Marshall (planetmarshall)

Changes

#116261 removed the declaration of __gnu_unwind_frame and moved it to libunwind, however libunwind is not a required component for libcxxabi. Specifically, this does not compile when libunwind is configured as part of llvm-libgcc where we must have LIBCXXABI_USE_LLVM_UNWINDER=OFF

This PR restores the declaration of __gnu_unwind_frame when _LIBUNWIND_VERSION is not defined.


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

1 Files Affected:

  • (modified) libcxxabi/src/cxa_personality.cpp (+5)
diff --git a/libcxxabi/src/cxa_personality.cpp b/libcxxabi/src/cxa_personality.cpp
index 35f4e38077248..70c8e474c78a6 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -1116,6 +1116,11 @@ __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

@github-actions

github-actions Bot commented Mar 29, 2026

Copy link
Copy Markdown

✅ With the latest revision this PR passed the C/C++ code formatter.

@planetmarshall
planetmarshall force-pushed the libcxxabi-gnu-unwind-frame branch from 2509763 to 64c24f0 Compare March 29, 2026 20:10
@planetmarshall
planetmarshall force-pushed the libcxxabi-gnu-unwind-frame branch from 64c24f0 to 8d9ad93 Compare March 29, 2026 20:14
@MaskRay

MaskRay commented Mar 31, 2026

Copy link
Copy Markdown
Member

__gnu_unwind_frame is a aarch32-specific function in libgcc. Is your build related to aarch32?

@planetmarshall

Copy link
Copy Markdown
Contributor Author

__gnu_unwind_frame is a aarch32-specific function in libgcc. Is your build related to aarch32?

Armv7, yes.

@planetmarshall

Copy link
Copy Markdown
Contributor Author

Superseded by #189787

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++abi libc++abi C++ Runtime Library. Not libc++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants