Restore MODE=dbg support

We recently broke MODE=dbg support when we added C++ exception support.
This change adds the missing UBSAN interfaces, needed to get it working
again. Some of the ASAN checking in the SJLJ guts needed to be disabled
since I doubt anyone's combined the two features until now.
This commit is contained in:
Justine Tunney 2024-01-26 23:07:18 -08:00
parent f27808c4d2
commit c1e18e7903
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
5 changed files with 34 additions and 38 deletions

View file

@ -12,5 +12,8 @@ ORIGIN
Date: Tue, 28 Nov 2023 09:52:28 +0100
LOCAL CHANGES
- Fixed `_Unwind_FunctionContext` struct to be ABI-compatible with code
generated by GCC.
- Fixed `_Unwind_FunctionContext` struct to be ABI-compatible with
code generated by GCC.
- Added `dontasan` annotations to functions that raised ASAN errors.

View file

@ -105,7 +105,7 @@ __Unwind_SjLj_SetTopOfFunctionStack(struct _Unwind_FunctionContext *fc) {
/// Called at start of each function that catches exceptions
_LIBUNWIND_EXPORT void
_LIBUNWIND_EXPORT void dontasan
_Unwind_SjLj_Register(struct _Unwind_FunctionContext *fc) {
fc->prev = __Unwind_SjLj_GetTopOfFunctionStack();
__Unwind_SjLj_SetTopOfFunctionStack(fc);
@ -113,7 +113,7 @@ _Unwind_SjLj_Register(struct _Unwind_FunctionContext *fc) {
/// Called at end of each function that catches exceptions
_LIBUNWIND_EXPORT void
_LIBUNWIND_EXPORT void dontasan
_Unwind_SjLj_Unregister(struct _Unwind_FunctionContext *fc) {
__Unwind_SjLj_SetTopOfFunctionStack(fc->prev);
}
@ -426,6 +426,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetGR(struct _Unwind_Context *context,
/// Called by personality handler during phase 2 to alter register values.
dontasan
_LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index,
uintptr_t new_value) {
_LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, value=0x%" PRIuPTR