Files
gex/tools/gexcc/cpp_exception.s
velzieandClaude Opus 5.5 417571d6e4 gexcc: C++ (libc++ over wasm EH) and loop safepoints for asynchronous signals
C++: build-cxx.sh builds libc++, libc++abi and libunwind from an LLVM tree
into the sysroot; gexc++ compiles with -fwasm-exceptions plus
-mllvm -wasm-enable-eh (clang turns the backend's EH lowering on only for
emscripten; without it every catch was dropped). The __cpp_exception tag is
cpp_exception.s. tests/gexcc/cxx.cpp: throws through frames with
destructors, rethrow, std exceptions, RTTI, iostreams, std::thread.

Signals: gex delivers them at a system call's return, so a loop that never
calls the kernel never saw SIGALRM (findutils' configure hung in its
alarm-guarded strcasestr check). The GexPoll pass plugin puts a countdown
on every loop header (a per-thread wasm global); every 65536 back-edges
__gex_poll (rt/, libgexcc.a) makes one getpid, where pending signals and
expired timers are delivered. GEXCC_POLL=0 / -fno-gex-poll leaves it out.
tests/gexcc/alarmloop.c: a handler and the default action both stop a busy
loop (it hangs without the polls).

Also: -Wl,--version for Meson, -print-prog-name, the TRIPLE-ld wrapper.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_685ed8fb0aed4f7099b7ecc34fc3b595
2026-10-07 12:26:22 -04:00

8 lines
318 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.
.globl __cpp_exception
.tagtype __cpp_exception i32
__cpp_exception: