Skip to content

[Memory64] Turn off minifying to ensure export instrumentation will work #15305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/settings_internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down