From 070072e8a49c4a3804b218171965c5a0a566604e Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 28 Oct 2024 09:00:41 -0700 Subject: [PATCH 1/2] allow more features for maybe-wasm2js and wasm-split This is in preparation for alloing bulk memory and nontrapping-fp by default. Maybe-wasm2js just allows all features for simplicity (although if a feature unsupported by wasm2js is used, the test may fail anyway). The wasm-split test fails when reference types are enabled; I haven't investigated that yet, but for now we just enable the 2 we are interested in. --- test/test_other.py | 2 +- tools/maybe_wasm2js.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 9de3bf79e6392..db0fc40b8a1d8 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12859,7 +12859,7 @@ def test_split_module(self, customLoader, jspi): self.assertExists('profile.data') wasm_split = os.path.join(building.get_binaryen_bin(), 'wasm-split') - wasm_split_run = [wasm_split, '-g', '--enable-mutable-globals', '--export-prefix=%', 'test_split_module.wasm.orig', '-o1', 'primary.wasm', '-o2', 'secondary.wasm', '--profile=profile.data'] + wasm_split_run = [wasm_split, '-g', '-all', '--export-prefix=%', 'test_split_module.wasm.orig', '-o1', 'primary.wasm', '-o2', 'secondary.wasm', '--profile=profile.data'] if jspi: wasm_split_run += ['--jspi', '--enable-reference-types'] self.run_process(wasm_split_run) diff --git a/tools/maybe_wasm2js.py b/tools/maybe_wasm2js.py index 6b90ef8f70094..74fb6dd84cb14 100755 --- a/tools/maybe_wasm2js.py +++ b/tools/maybe_wasm2js.py @@ -41,7 +41,7 @@ # main -cmd = [os.path.join(building.get_binaryen_bin(), 'wasm2js'), '--emscripten', wasm_file] +cmd = [os.path.join(building.get_binaryen_bin(), 'wasm2js'), '--emscripten', '-all', wasm_file] cmd += opts js = shared.run_process(cmd, stdout=subprocess.PIPE).stdout # assign the instantiate function to where it will be used From a5a43fb8396dbec94bb4bbddbe2036bcb9121db6 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 29 Oct 2024 11:37:12 -0700 Subject: [PATCH 2/2] switch modules from all to just nontrapping-fp --- test/test_other.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_other.py b/test/test_other.py index db0fc40b8a1d8..40561b8e7e113 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12859,7 +12859,9 @@ def test_split_module(self, customLoader, jspi): self.assertExists('profile.data') wasm_split = os.path.join(building.get_binaryen_bin(), 'wasm-split') - wasm_split_run = [wasm_split, '-g', '-all', '--export-prefix=%', 'test_split_module.wasm.orig', '-o1', 'primary.wasm', '-o2', 'secondary.wasm', '--profile=profile.data'] + wasm_split_run = [wasm_split, '-g', + '--enable-mutable-globals', '--enable-bulk-memory', '--enable-nontrapping-float-to-int', + '--export-prefix=%', 'test_split_module.wasm.orig', '-o1', 'primary.wasm', '-o2', 'secondary.wasm', '--profile=profile.data'] if jspi: wasm_split_run += ['--jspi', '--enable-reference-types'] self.run_process(wasm_split_run)