Skip to content

Commit 5921734

Browse files
Falessdsnopek
authored andcommitted
[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. (cherry picked from commit 1bb543b)
1 parent fd31fab commit 5921734

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/web.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ def generate(env):
3535

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

4141
# Build as side module (shared library).
4242
env.Append(CCFLAGS=["-sSIDE_MODULE=1"])
4343
env.Append(LINKFLAGS=["-sSIDE_MODULE=1"])
4444

45+
# Force wasm longjmp mode.
46+
env.Append(CCFLAGS=["-sSUPPORT_LONGJMP='wasm'"])
47+
env.Append(LINKFLAGS=["-sSUPPORT_LONGJMP='wasm'"])
48+
4549
env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"])
4650

4751
common_compiler_flags.generate(env)

0 commit comments

Comments
 (0)