You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SjLj] Enable Wasm SjLj with -sSUPPORT_LONGJMP=wasm (#16111)
Because currently `DISABLE_EXCEPTION_THROWING` is 0 by default, which
enables Emscripten EH exception throwing, to use Wasm SjLj, you need to
specify both options, which is inconvenient and unintuitive:
```
emcc -sSUPPORT_LONGJMP=wasm -sDISABLE_EXCEPTION_THROWING=1 test.c
```
So far we've errored out when `SUPPORT_LONGJMP=wasm` was given with
either `DISABLE_EXCEPTION_CATCHING=0` or `DISABLE_EXCEPTION_THROWING=0`.
But unlike `DISABLE_EXCEPTION_CATCHING`, which is 1 by default and you
have to explicitly disable it to make it 0, `DISABLE_EXCEPTION_THROWING`
is 0 by default so you always have to turn it off when we use Wasm SjLj,
which is very inconvenient. This PR automatically sets
`DISABLE_EXCEPTION_THROWING` to 1 when `SUPPORT_LONGJMP` is `wasm`.
self.assertContained('error: longjmp support was disabled (SUPPORT_LONGJMP=0), but it is required by the code (either set SUPPORT_LONGJMP=1, or remove uses of it in the project)',
10506
10506
stderr)
10507
10507
10508
+
deftest_SUPPORT_LONGJMP_wasm(self):
10509
+
# Tests if -sSUPPORT_LONGJMP=wasm alone is enough to use Wasm SjLj, i.e., it
10510
+
# automatically sets DISABLE_EXCEPTION_THROWING to 1, which is 0 by default,
10511
+
# because Emscripten EH and Wasm SjLj cannot be used at the same time.
self.assertContained('pthreads + MODULARIZE currently require you to set -s EXPORT_NAME=Something (see settings.js) to Something != Module, so that the .worker.js file can work',
0 commit comments