Skip to content

Commit 1bb543b

Browse files
committed
[Web] Force emcc to use "wasm" longjmp mode
SUPPORT_LONGJMP have changed since emscripten 3.1.32 to default to "wasm" mode when exceptions are enabled, and "emscripten" mode when disabled. While we generally doesn't use exception in core, linked libraries may need them, and emscripten don't plan to support WASM EH + Emscripten SjLj in the long term.
1 parent 6c40641 commit 1bb543b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/web.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ def generate(env):
3636

3737
# Thread support (via SharedArrayBuffer).
3838
if env["threads"]:
39-
env.Append(CCFLAGS=["-s", "USE_PTHREADS=1"])
40-
env.Append(LINKFLAGS=["-s", "USE_PTHREADS=1"])
39+
env.Append(CCFLAGS=["-sUSE_PTHREADS=1"])
40+
env.Append(LINKFLAGS=["-sUSE_PTHREADS=1"])
4141

4242
# Build as side module (shared library).
43-
env.Append(CPPFLAGS=["-s", "SIDE_MODULE=1"])
44-
env.Append(LINKFLAGS=["-s", "SIDE_MODULE=1"])
43+
env.Append(CPPFLAGS=["-sSIDE_MODULE=1"])
44+
env.Append(LINKFLAGS=["-sSIDE_MODULE=1"])
45+
46+
# Force wasm longjmp mode.
47+
env.Append(CCFLAGS=["-sSUPPORT_LONGJMP='wasm'"])
48+
env.Append(LINKFLAGS=["-sSUPPORT_LONGJMP='wasm'"])
4549

4650
env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"])
4751

0 commit comments

Comments
 (0)