Commit Graph

2 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto ca364e3f3e emscripten.rake: use native WASM exception handling
Enable -fwasm-exceptions and -sSUPPORT_LONGJMP=wasm for the Emscripten
toolchain. This implements setjmp/longjmp using native WebAssembly
exception handling instructions instead of Asyncify-based emulation.

Benefits:
- Minimal memory overhead (no shadow stack buffer needed)
- No code size penalty
- Works with both C and C++ code

WASM exception handling is supported by all major browsers since 2021-2022
(Chrome 95+, Firefox 100+, Safari 15.2+) and standalone runtimes
(Node.js 17+, Wasmtime, Wasmer).

For older runtimes, users can override with CFLAGS/LDFLAGS environment
variables.

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-22 18:02:33 +09:00
esotericpig bfc9742848 Add Emscripten toolchain & build_config 2025-03-07 12:39:54 -10:00