[ports] Pass integer for WASM_LEGACY_EXCEPTIONS when building ports - #27651
Merged
Conversation
In emscripten-core#27579, `WASM_LEGACY_EXCEPTIONS` was forwarded to sub-compilations when building ports with wasm SjLj. However, `settings.WASM_LEGACY_EXCEPTIONS` defaults to a boolean (`True`) in Python when not explicitly set via `-s` on the command line (e.g. when using `-fwasm-exceptions`). Stringifying it into `-sWASM_LEGACY_EXCEPTIONS={settings.WASM_LEGACY_EXCEPTIONS}` resulted in `-sWASM_LEGACY_EXCEPTIONS=True`, which `emcc` rejects because boolean settings require 1 or 0. Ensure we format it as an integer so `1` or `0` is always passed. Fixes: emscripten-core#27650
kripken
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #27579,
WASM_LEGACY_EXCEPTIONSwas forwarded to sub-compilations when building ports with wasm SjLj. However,settings.WASM_LEGACY_EXCEPTIONSdefaults to a boolean (True) in Python when not explicitly set via-son the command line (e.g. when using-fwasm-exceptions). Stringifying it into-sWASM_LEGACY_EXCEPTIONS={settings.WASM_LEGACY_EXCEPTIONS}resulted in-sWASM_LEGACY_EXCEPTIONS=True, whichemccrejects because boolean settings require 1 or 0.Ensure we format it as an integer so
1or0is always passed.Also, update the variants to set
WASM_LEGACY_EXCEPTIONSto True/False which means that the embuilder build of these libraries will fail in the same way.Fixes: #27650