Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2517,6 +2517,21 @@ def phase_linker_setup(options, state, newargs):
settings.SUPPORTS_PROMISE_ANY = feature_matrix.caniuse(feature_matrix.Feature.PROMISE_ANY)
if not settings.BULK_MEMORY:
settings.BULK_MEMORY = feature_matrix.caniuse(feature_matrix.Feature.BULK_MEMORY)
if settings.MEMORY64 and settings.MIN_NODE_VERSION < 180000:
# Note that we do not update tools/feature_matrix.py for this, as this issue is
# wasm64-specific: bulk memory for wasm32 has shipped in Node.js 12.5, but
# bulk memory for wasm64 has shipped only in Node.js 18.
#
# Feature matrix currently cannot express such complex combinations of
# features, so the only options are to either choose the least common
# denominator and disable bulk memory altogether for Node.js < 18 or to
# special-case this situation here. The former would be limiting for
# wasm32 users, so instead we do the latter:
logger.warning(
"Disabling bulk memory because it doesn't work correctly with wasm64 in Node.js < 18.\n"
"Set MIN_NODE_VERSION to 180000 or above to enable it."
)
settings.BULK_MEMORY = 0

if settings.AUDIO_WORKLET:
if settings.AUDIO_WORKLET == 1:
Expand Down