fix(libc): export the C personality to guest code

Guest C built with -fexceptions imports __gcc_personality_v0 for its
cleanup frames, and libc.prx did not export it. The routine becomes
__gcc_personality_v0_nid_postfix, the host __gcc_personality_v0
forwards to it as __gxx_personality_v0 already does, and
CallPersonality recognizes both names.
This commit is contained in:
mugurc
2026-10-06 20:19:20 +03:00
parent 30e89cc6a0
commit 1ac6866980
3 changed files with 11 additions and 3 deletions
@@ -99,6 +99,7 @@ inline unsigned EncodingSize(Byte encoding) {
extern "C" {
_Unwind_Reason_Code APS5_VABI __gxx_personality_v0_nid_postfix(int, _Unwind_Action, std::uint64_t, _Unwind_Exception*, _Unwind_Context*);
_Unwind_Reason_Code APS5_VABI __gcc_personality_v0_nid_postfix(int, _Unwind_Action, std::uint64_t, _Unwind_Exception*, _Unwind_Context*);
_Unwind_Reason_Code APS5_VABI _Unwind_RaiseException_nid_postfix(_Unwind_Exception*);
[[noreturn]] void APS5_VABI _Unwind_Resume_nid_postfix(_Unwind_Exception*);
_Unwind_Reason_Code APS5_VABI _Unwind_Resume_or_Rethrow_nid_postfix(_Unwind_Exception*);
@@ -78,7 +78,7 @@ extern "C" _Unwind_Reason_Code __gxx_personality_v0(
return __gxx_personality_v0_nid_postfix(version, actions, exceptionClass, exception, context);
}
extern "C" _Unwind_Reason_Code __gcc_personality_v0(
extern "C" _Unwind_Reason_Code APS5_VABI __gcc_personality_v0_nid_postfix(
int version, _Unwind_Action actions, std::uint64_t,
_Unwind_Exception* exception, _Unwind_Context* context
) {
@@ -107,3 +107,10 @@ extern "C" _Unwind_Reason_Code __gcc_personality_v0(
}
return _URC_CONTINUE_UNWIND;
}
extern "C" _Unwind_Reason_Code __gcc_personality_v0(
int version, _Unwind_Action actions, std::uint64_t exceptionClass,
_Unwind_Exception* exception, _Unwind_Context* context
) {
return __gcc_personality_v0_nid_postfix(version, actions, exceptionClass, exception, context);
}
+2 -2
View File
@@ -25,8 +25,8 @@ _Unwind_Reason_Code CallPersonality(Word personality, _Unwind_Action actions, _U
#endif
if (personality == reinterpret_cast<Word>(__gxx_personality_v0_nid_postfix) || personality == reinterpret_cast<Word>(__gxx_personality_v0))
return __gxx_personality_v0_nid_postfix(1, actions, exception->exception_class, exception, context);
if (personality == reinterpret_cast<Word>(__gcc_personality_v0))
return __gcc_personality_v0(1, actions, exception->exception_class, exception, context);
if (personality == reinterpret_cast<Word>(__gcc_personality_v0_nid_postfix) || personality == reinterpret_cast<Word>(__gcc_personality_v0))
return __gcc_personality_v0_nid_postfix(1, actions, exception->exception_class, exception, context);
return (actions & _UA_SEARCH_PHASE) ? _URC_FATAL_PHASE1_ERROR : _URC_FATAL_PHASE2_ERROR;
}
struct Lookup { Word pc; const Byte* fde {}; Word text {}; Word data {}; };