Skip to content

Commit

Permalink
[Web] Force emcc to use "wasm" longjmp mode
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Faless committed Jun 14, 2024
1 parent e874cd8 commit 7af8c49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platform/web/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ def configure(env: "SConsEnvironment"):
# Wrap the JavaScript support code around a closure named Godot.
env.Append(LINKFLAGS=["-sMODULARIZE=1", "-sEXPORT_NAME='Godot'"])

# Force long jump mode to 'wasm'
env.Append(CCFLAGS=["-sSUPPORT_LONGJMP='wasm'"])
env.Append(LINKFLAGS=["-sSUPPORT_LONGJMP='wasm'"])

# Allow increasing memory buffer size during runtime. This is efficient
# when using WebAssembly (in comparison to asm.js) and works well for
# us since we don't know requirements at compile-time.
Expand Down

0 comments on commit 7af8c49

Please sign in to comment.