Skip to content

[Wasm64] Enable import/export name minification with MEMORY64 #18897

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
Mar 6, 2023
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
5 changes: 1 addition & 4 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2538,16 +2538,13 @@ def check_memory_setting(setting):
if settings.SHARED_MEMORY or settings.RELOCATABLE or settings.ASYNCIFY_LAZY_LOAD_CODE or settings.WASM2JS:
settings.IMPORTED_MEMORY = 1

# 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.ASYNCIFY and settings.MEMORY64 == 1:
exit_with_error('MEMORY64=1 is not compatible with ASYNCIFY')
if not settings.DISABLE_EXCEPTION_CATCHING:
exit_with_error('MEMORY64 is not compatible with DISABLE_EXCEPTION_CATCHING=0')
# Any "pointers" passed to JS will now be i64's, in both modes.
settings.WASM_BIGINT = 1
settings.MINIFY_WASM_IMPORTS_AND_EXPORTS = 0
settings.MINIFY_WASM_IMPORTED_MODULES = 0

if settings.WASM_BIGINT:
settings.LEGALIZE_JS_FFI = 0
Expand Down
4 changes: 4 additions & 0 deletions test/other/metadce/test_metadce_minimal_64.exports
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a
b
c
d
2 changes: 2 additions & 0 deletions test/other/metadce/test_metadce_minimal_64.funcs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$__wasm_call_ctors
$add
1 change: 1 addition & 0 deletions test/other/metadce/test_metadce_minimal_64.imports
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions test/other/metadce/test_metadce_minimal_64.jssize
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4077
1 change: 1 addition & 0 deletions test/other/metadce/test_metadce_minimal_64.sent
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions test/other/metadce/test_metadce_minimal_64.size
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
302
1 change: 1 addition & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -7787,6 +7787,7 @@ def strip_numeric_suffixes(funcname):
'Os_mr': (['-Os', '-sMINIMAL_RUNTIME'], [], [], 74), # noqa
# EVAL_CTORS also removes the __wasm_call_ctors function
'Oz-ctors': (['-Oz', '-sEVAL_CTORS'], [], []), # noqa
'64': (['-Oz', '-sMEMORY64', '-Wno-experimental'], [], []), # noqa
})
def test_metadce_minimal(self, *args):
self.set_setting('INCOMING_MODULE_JS_API', [])
Expand Down