Skip to content

Commit 29adc84

Browse files
authored
Fix for MEMORY64 + -O3 (#16509)
Right now disabling `MINIFY_WASM_IMPORTS_AND_EXPORTS` requires that `MINIFY_WASM_IMPORTED_MODULES` is also disabled. This is because the call to `minify_wasm_imports_and_exports` which handles both of these processes is currently guarded by `MINIFY_WASM_IMPORTS_AND_EXPORTS`. In the long run we need to address this and avoid disabling these but in the short term this fixes the broken logic. Fixes: WebAssembly/binaryen#4532
1 parent c603839 commit 29adc84

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

emcc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,7 @@ def get_full_import_name(name):
25072507
exit_with_error('MEMORY64 is not compatible with WASM_BIGINT=0')
25082508
settings.WASM_BIGINT = 1
25092509
settings.MINIFY_WASM_IMPORTS_AND_EXPORTS = 0
2510+
settings.MINIFY_WASM_IMPORTED_MODULES = 0
25102511

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

tests/test_other.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11836,3 +11836,11 @@ def test_extended_const(self):
1183611836
self.assertTrue(re.search(r'\(data \(i32.add\s+\(global.get \$\S+\)\s+\(i32.const \d+\)', wat))
1183711837
# Test that extended-const expressions are used in at least one global initializer.
1183811838
self.assertTrue(re.search(r'\(global \$\S+ i32 \(i32.add\s+\(global.get \$\S+\)\s+\(i32.const \d+\)', wat))
11839+
11840+
# Smoketest for MEMORY64 setting. Most of the testing of MEMORY64 is by way of the wasm64
11841+
# variant of the core test suite.
11842+
@require_v8
11843+
def test_memory64(self):
11844+
self.v8_args += ['--experimental-wasm-memory64']
11845+
for opt in ['-O0', '-O1', '-O2', '-O3']:
11846+
self.do_runf(test_file('hello_world.c'), 'hello, world', emcc_args=['-sMEMORY64', opt])

0 commit comments

Comments
 (0)