Files
gex/tools/gexcc/rt/cpp_exception.s
velzieandClaude Opus 5.5 99573180fc gexcc: C++ exceptions cross shared modules
Every C++ module had its own exception tag (from the C++ archives), so
an exception thrown in a library was a different one in the program and
went uncaught, and a program with a try block did not link against a
C++ library at all: the library's exported landing-pad context is
thread-local only in its own module.

The tag is now libc.so's, imported by every shared module like setjmp's
(a static program links it from libgexcc_eh.a), and libunwind comes
ahead of the side modules so each module's landing pads use its own
context.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_40f26e8988a74ea098d8bc80ff68287c
2026-10-21 20:19:11 -04:00

11 lines
561 B
ArmAsm

# The wasm exception tag C++ throws and catches with (LLVM's C++ EH lowering
# and libunwind's Unwind-wasm.c refer to it; the runtime defines it, as
# emscripten's libcxxabi/src/__cpp_exception.S does). wasm32: the payload is
# a pointer, an i32. In libgexcc_eh.a for a static program, and in libc.so
# for a shared one and its libraries, which import it: an exception thrown
# in one module is caught in another (with a tag of each module's own it
# would be a different exception there).
.globl __cpp_exception
.tagtype __cpp_exception i32
__cpp_exception: