From ffc016942156ca4958b840cc6a0c0ef55950a86c Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Thu, 14 Oct 2021 15:34:29 -0700 Subject: [PATCH] [Memory64] Turn off minifying to ensure export instrumentation will work --- emcc.py | 2 ++ src/preamble.js | 3 ++- src/settings_internal.js | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/emcc.py b/emcc.py index 3aa68df98f17c..4e1de1b1d051d 100755 --- a/emcc.py +++ b/emcc.py @@ -2331,10 +2331,12 @@ def get_full_import_name(name): '_emscripten_stack_get_end'] # Any "pointers" passed to JS will now be i64's, in both modes. + # Also turn off minifying, which clashes with instrumented functions in preamble.js if settings.MEMORY64: if settings_map.get('WASM_BIGINT') == '0': exit_with_error('MEMORY64 is not compatible with WASM_BIGINT=0') settings.WASM_BIGINT = 1 + settings.MINIFY_WASM_IMPORTS_AND_EXPORTS = 0 # check if we can address the 2GB mark and higher: either if we start at # 2GB, or if we allow growth to either any amount or to 2GB or more. diff --git a/src/preamble.js b/src/preamble.js index 44557262e6592..77f160318bcaa 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -757,7 +757,8 @@ function instrumentWasmTableWithAbort() { // BigInts. For now we keep JS as much the same as it always was, that is, // stackAlloc() receives and returns a Number from the JS point of view - // we translate BigInts automatically for that. -// TODO: support minified export names +// TODO: support minified export names, so we can turn MINIFY_WASM_IMPORTS_AND_EXPORTS +// back on for MEMORY64. function instrumentWasmExportsForMemory64(exports) { var instExports = {}; for (var name in exports) { diff --git a/src/settings_internal.js b/src/settings_internal.js index ff241a08669db..7a73d048d5694 100644 --- a/src/settings_internal.js +++ b/src/settings_internal.js @@ -143,6 +143,7 @@ var ENVIRONMENT_MAY_BE_SHELL = 1; var ENVIRONMENT_MAY_BE_WEBVIEW = 1; // Whether to minify import and export names in the minify_wasm_js stage. +// Currently always off for MEMORY64. var MINIFY_WASM_IMPORTS_AND_EXPORTS = 0; // Whether to minify imported module names.