Crafter.Build/tests/WasmExceptions
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf 70ff11d0a1
All checks were successful
Flatpak / flatpak (push) Successful in 17m58s
feat(wasm): link libsetjmp, so setjmp needs no flag
-mllvm -wasm-enable-sjlj, in every wasm compile because setjmp.h does
not compile without it, turns setjmp and longjmp into calls to
__wasm_setjmp, __wasm_setjmp_test and __wasm_longjmp and a throw of
the __c_longjmp tag, all of which live in wasi-libc's libsetjmp. The
driver does not link it, so a program that used setjmp, or a C library
that handles its errors that way, failed to link with undefined
__wasm_setjmp until the project put -lsetjmp in its linkFlags.

Build() adds it to every wasm link, next to -lunwind. A static archive
contributes only the members something references, so a program
without setjmp gets nothing from it, and every sysroot that passes the
exception check ships it. WasmExceptions drops its own -lsetjmp, and
its C fixture now fails to link without this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 06:29:52 +01:00
..
fixture test(wasm): the cases the review found 2026-10-31 06:10:41 +01:00
main.cpp feat(wasm): link libsetjmp, so setjmp needs no flag 2026-10-31 06:29:52 +01:00