Skip to content

Commit 8baffd4

Browse files
authored
[Memory64] Turn off minifying to ensure export instrumentation will work (#15305)
1 parent 0c7f23d commit 8baffd4

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

emcc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,10 +2335,12 @@ def get_full_import_name(name):
23352335
'_emscripten_stack_get_end']
23362336

23372337
# Any "pointers" passed to JS will now be i64's, in both modes.
2338+
# Also turn off minifying, which clashes with instrumented functions in preamble.js
23382339
if settings.MEMORY64:
23392340
if settings_map.get('WASM_BIGINT') == '0':
23402341
exit_with_error('MEMORY64 is not compatible with WASM_BIGINT=0')
23412342
settings.WASM_BIGINT = 1
2343+
settings.MINIFY_WASM_IMPORTS_AND_EXPORTS = 0
23422344

23432345
# check if we can address the 2GB mark and higher: either if we start at
23442346
# 2GB, or if we allow growth to either any amount or to 2GB or more.

src/preamble.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,8 @@ function instrumentWasmTableWithAbort() {
757757
// BigInts. For now we keep JS as much the same as it always was, that is,
758758
// stackAlloc() receives and returns a Number from the JS point of view -
759759
// we translate BigInts automatically for that.
760-
// TODO: support minified export names
760+
// TODO: support minified export names, so we can turn MINIFY_WASM_IMPORTS_AND_EXPORTS
761+
// back on for MEMORY64.
761762
function instrumentWasmExportsForMemory64(exports) {
762763
var instExports = {};
763764
for (var name in exports) {

src/settings_internal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ var ENVIRONMENT_MAY_BE_SHELL = 1;
143143
var ENVIRONMENT_MAY_BE_WEBVIEW = 1;
144144

145145
// Whether to minify import and export names in the minify_wasm_js stage.
146+
// Currently always off for MEMORY64.
146147
var MINIFY_WASM_IMPORTS_AND_EXPORTS = 0;
147148

148149
// Whether to minify imported module names.

0 commit comments

Comments
 (0)