mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-07 10:20:29 +00:00
third_party/libunwind: Fix unwind ABI
`resumeParameters` in `_Unwind_FunctionContext` should be "unwind words" (typically 64-bit) instead of 32-bit. This fix, along with the pending libcxxabi port, allows the first binaries with exception handling to properly run.
This commit is contained in:
parent
b8e7fdd2f5
commit
3356605531
2 changed files with 6 additions and 1 deletions
3
third_party/libunwind/README.cosmo
vendored
3
third_party/libunwind/README.cosmo
vendored
|
@ -11,3 +11,6 @@ ORIGIN
|
||||||
Author: Tobias Hieta <tobias@hieta.se>
|
Author: Tobias Hieta <tobias@hieta.se>
|
||||||
Date: Tue, 28 Nov 2023 09:52:28 +0100
|
Date: Tue, 28 Nov 2023 09:52:28 +0100
|
||||||
|
|
||||||
|
LOCAL CHANGES
|
||||||
|
- Fixed `_Unwind_FunctionContext` struct to be ABI-compatible with code
|
||||||
|
generated by GCC.
|
||||||
|
|
4
third_party/libunwind/Unwind-sjlj.c
vendored
4
third_party/libunwind/Unwind-sjlj.c
vendored
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#if defined(_LIBUNWIND_BUILD_SJLJ_APIS)
|
#if defined(_LIBUNWIND_BUILD_SJLJ_APIS)
|
||||||
|
|
||||||
|
typedef uintptr_t _Unwind_Word __attribute__((__mode__(__unwind_word__)));
|
||||||
|
|
||||||
struct _Unwind_FunctionContext {
|
struct _Unwind_FunctionContext {
|
||||||
// next function in stack of handlers
|
// next function in stack of handlers
|
||||||
struct _Unwind_FunctionContext *prev;
|
struct _Unwind_FunctionContext *prev;
|
||||||
|
@ -47,7 +49,7 @@ struct _Unwind_FunctionContext {
|
||||||
uint32_t resumeLocation;
|
uint32_t resumeLocation;
|
||||||
|
|
||||||
// set by personality handler to be parameters passed to landing pad function
|
// set by personality handler to be parameters passed to landing pad function
|
||||||
uint32_t resumeParameters[4];
|
_Unwind_Word resumeParameters[4];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// set by calling function before registering
|
// set by calling function before registering
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue