From ee34a80845a99e1c04edc209c347faed9842a8a6 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 10 Apr 2023 16:40:38 -0700 Subject: [PATCH 01/42] yolo --- tools/feature_matrix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index a20086d21ea4b..ec640435c8cd8 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -50,7 +50,8 @@ class Feature(IntEnum): Feature.JS_BIGINT_INTEGRATION: { 'chrome': 67, 'firefox': 68, - 'safari': 150000, + # Note: Safari 14.1 shipped only in iOS 14.5, which can be confusing. + 'safari': 140100, }, Feature.THREADS: { 'chrome': 74, From 5b5e426827abf3ac5ea6330ded43f5ac9adedc35 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 10 Apr 2023 16:50:14 -0700 Subject: [PATCH 02/42] make it work --- emcc.py | 3 +++ src/settings.js | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/emcc.py b/emcc.py index ccfb59bc4f3a2..ec1c8efb2b3fc 100755 --- a/emcc.py +++ b/emcc.py @@ -1893,6 +1893,9 @@ def phase_linker_setup(options, state, newargs): if settings.LZ4: settings.EXPORTED_RUNTIME_METHODS += ['LZ4'] + default_setting('WASM_BIGINT', + feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION)) + if settings.PURE_WASI: settings.STANDALONE_WASM = 1 settings.WASM_BIGINT = 1 diff --git a/src/settings.js b/src/settings.js index e839bf2a78fd0..802431ae8c82a 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1382,7 +1382,7 @@ var DYNCALLS = false; // i64 is used. If WASM_BIGINT is present, the default minimum supported browser // versions will be increased to the min version that supports BigInt. // [link] -var WASM_BIGINT = false; +var WASM_BIGINT = true; // WebAssembly defines a "producers section" which compilers and tools can // annotate themselves in, and LLVM emits this by default. @@ -1745,10 +1745,10 @@ var AUTO_NATIVE_LIBRARIES = true; // versions >= MIN_FIREFOX_VERSION // are desired to work. Pass -sMIN_FIREFOX_VERSION=majorVersion to drop support // for Firefox versions older than < majorVersion. -// Firefox ESR 60.5 (Firefox 65) was released on 2019-01-29. +// Firefox ESR 68 was released on July 9, 2019. // MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported. // [link] -var MIN_FIREFOX_VERSION = 65; +var MIN_FIREFOX_VERSION = 68; // Specifies the oldest version of desktop Safari to target. Version is encoded // in MMmmVV, e.g. 70101 denotes Safari 7.1.1. From 520301b367e0bba0404c1155be570cc9c38e3496 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 10 Apr 2023 16:55:09 -0700 Subject: [PATCH 03/42] fix --- test/test_other.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 9ca7e4efe0289..3132e452f2aee 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -11091,19 +11091,18 @@ def ok(args, filename='hello_world.cpp', expected='hello, world!'): args += ['-sERROR_ON_WASM_CHANGES_AFTER_LINK'] self.do_runf(test_file(filename), expected, emcc_args=args) - # -O0 with BigInt support (to avoid the need for legalization) - required_flags = ['-sWASM_BIGINT'] - ok(required_flags) + # -O0 just works + ok([]) # Same with DWARF - ok(required_flags + ['-g']) + ok(['-g']) # Function pointer calls from JS work too - ok(required_flags, filename='hello_world_main_loop.cpp') + ok([], filename='hello_world_main_loop.cpp') # -O1 is ok as we don't run wasm-opt there (but no higher, see below) - ok(required_flags + ['-O1']) + ok(['-O1']) # Exception support shouldn't require changes after linking - ok(required_flags + ['-fexceptions']) + ok(['-fexceptions']) # Standalone mode should not do anything special to the wasm. - ok(required_flags + ['-sSTANDALONE_WASM']) + ok(['-sSTANDALONE_WASM']) # other builds fail with a standard message + extra details def fail(args, details): @@ -11113,13 +11112,10 @@ def fail(args, details): self.assertContained('changes to the wasm are required after link, but disallowed by ERROR_ON_WASM_CHANGES_AFTER_LINK', err) self.assertContained(details, err) - # plain -O0 - legalization_message = 'to disable int64 legalization (which requires changes after link) use -sWASM_BIGINT' - fail([], legalization_message) # optimized builds even without legalization optimization_message = '-O2+ optimizations always require changes, build with -O0 or -O1 instead' - fail(required_flags + ['-O2'], optimization_message) - fail(required_flags + ['-O3'], optimization_message) + fail(['-O2'], optimization_message) + fail(['-O3'], optimization_message) @crossplatform def test_output_to_nowhere(self): From 85793acdb72a593a0cfd24fa678bce6a7aa0e0c7 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 10 Apr 2023 17:10:48 -0700 Subject: [PATCH 04/42] fix closure --- src/polyfill/bigint64array.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/polyfill/bigint64array.js b/src/polyfill/bigint64array.js index 5555a10fc5b02..324c02c0bbcd8 100644 --- a/src/polyfill/bigint64array.js +++ b/src/polyfill/bigint64array.js @@ -23,6 +23,12 @@ if (typeof globalThis.BigInt64Array === "undefined") { } function createBigIntArrayShim(partsToBigInt) { + /** + * Closure thinks .set is not defined on Proxy objects for some reason. The + * error is on the line with proxy.set but we can only apply the + * suppression at the function level here. + * @suppress {missingProperties} + */ function createBigInt64Array(array) { if (typeof array === "number") { array = new Uint32Array(2 * array); From 9fe22ab5caa747ae41d70f427e96398e14286c73 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Apr 2023 15:27:15 -0700 Subject: [PATCH 05/42] fix wasm2js --- emcc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emcc.py b/emcc.py index 44e3c772775e4..87ebf636d03e5 100755 --- a/emcc.py +++ b/emcc.py @@ -1896,8 +1896,10 @@ def phase_linker_setup(options, state, newargs): if settings.LZ4: settings.EXPORTED_RUNTIME_METHODS += ['LZ4'] + # WASM_BIGINT defaults to 1 when VMs support it, and when not using wasm2js default_setting('WASM_BIGINT', - feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION)) + feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION) and \ + not settings.WASM2JS) if settings.PURE_WASI: settings.STANDALONE_WASM = 1 From e255dad7deca1a5ad6254ac0a0d2171215877368 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Apr 2023 15:28:34 -0700 Subject: [PATCH 06/42] fix test --- test/test_core.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/test_core.py b/test/test_core.py index dec35b9f46535..396add47db43c 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -2327,11 +2327,9 @@ def test_em_js(self, args, force_c): @no_wasm2js('WASM_BIGINT is not compatible with wasm2js') def test_em_js_i64(self): - err = self.expect_fail([EMCC, '-Werror', test_file('core/test_em_js_i64.c')]) + err = self.expect_fail([EMCC, '-sWASM=0', '-Werror', test_file('core/test_em_js_i64.c')]) self.assertContained('emcc: error: using 64-bit arguments in EM_JS function without WASM_BIGINT is not yet fully supported: `foo`', err) - self.set_setting('WASM_BIGINT') - self.node_args += shared.node_bigint_flags() self.do_core_test('test_em_js_i64.c') def test_em_js_address_taken(self): From e1108d622a044b4e9e1a6186ce8200b0cb9fcd6b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Apr 2023 15:30:10 -0700 Subject: [PATCH 07/42] fix --- test/common.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/common.py b/test/common.py index 676738a8e0e55..c539c8ea1ae97 100644 --- a/test/common.py +++ b/test/common.py @@ -283,14 +283,13 @@ def metafunc(self, with_bigint): self.skipTest('wasm2js does not support WASM_BIGINT') if self.get_setting('WASM_BIGINT') is not None: self.skipTest('redundant in bigint test config') - self.set_setting('WASM_BIGINT') - self.node_args += shared.node_bigint_flags() f(self) else: + self.set_setting('WASM_BIGINT', '0') f(self) - metafunc._parameterize = {'': (False,), - 'bigint': (True,)} + metafunc._parameterize = {'no_bigint': (False,), + '': (True,)} return metafunc From 314cf8a00d0f9fb5e9b1a0ef587ee37e94e8584e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Apr 2023 15:30:38 -0700 Subject: [PATCH 08/42] fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f964b520d2973..26116089cba8e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -592,7 +592,7 @@ jobs: other.test_min_node_version other.test_node_emscripten_num_logical_cores core2.test_pthread_create - core2.test_i64_invoke_bigint + core2.test_i64_invoke core2.test_sse2 core2.test_source_map core2.test_exceptions_wasm From a52372dae6af2a971b841e38f0e02eb5386e0c45 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Apr 2023 15:38:47 -0700 Subject: [PATCH 09/42] cleanup --- test/runner.py | 1 - test/test_core.py | 29 +++-------------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/test/runner.py b/test/runner.py index 3baf775eb970c..ddf0031af935f 100755 --- a/test/runner.py +++ b/test/runner.py @@ -91,7 +91,6 @@ 'wasmfs', 'wasm64', 'wasm64l', - 'bigint', ] diff --git a/test/test_core.py b/test/test_core.py index 396add47db43c..7d2357ac7582a 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -205,16 +205,10 @@ def metafunc(self, standalone): if not can_do_standalone(self): self.skipTest('Test configuration is not compatible with STANDALONE_WASM') self.set_setting('STANDALONE_WASM') - # we will not legalize the JS ffi interface, so we must use BigInt - # support in order for JS to have a chance to run this without trapping - # when it sees an i64 on the ffi. - self.set_setting('WASM_BIGINT') self.emcc_args.append('-Wno-unused-command-line-argument') # if we are impure, disallow all wasm engines if impure: self.wasm_engines = [] - self.js_engines = [config.NODE_JS] - self.node_args += shared.node_bigint_flags() func(self) if wasm2c: print('wasm2c') @@ -545,9 +539,7 @@ def test_i64_varargs(self): @no_wasm64('MEMORY64 does not yet support exceptions') @requires_node def test_i64_invoke_bigint(self): - self.set_setting('WASM_BIGINT') self.emcc_args += ['-fexceptions'] - self.node_args += shared.node_bigint_flags() self.do_core_test('test_i64_invoke_bigint.cpp') def test_vararg_copy(self): @@ -4261,7 +4253,6 @@ def test_dylink_basics_no_modify(self): self.skipTest('no modify mode only works with non-optimizing builds') if self.get_setting('MEMORY64') == 2: self.skipTest('MEMORY64=2 always requires module re-writing') - self.set_setting('WASM_BIGINT') self.set_setting('ERROR_ON_WASM_CHANGES_AFTER_LINK') self.do_basic_dylink_test() @@ -7141,12 +7132,6 @@ def test_autodebug_wasm(self): 'none': ('none',), }) def test_wasm2c_sandboxing(self, mode): - if self.get_setting('WASMFS'): - # wasm2c disables JS legalization since we are building in standalone - # mode. this happens to work without wasmfs, but with wasmfs we get the - # time when we create/update a file, which uses clock_time_get that has an - # i64 param. For such an import to work we need wasm-bigint support. - self.node_args += shared.node_bigint_flags() if not can_do_standalone(self): return self.skipTest('standalone mode not supported') self.set_setting('STANDALONE_WASM') @@ -7229,8 +7214,8 @@ def test_EXPORTED_RUNTIME_METHODS(self): 'minimal_runtime': ['-sMINIMAL_RUNTIME=1'] }) def test_dyncall_specific(self, *args): - if self.get_setting('WASM_BIGINT') or self.get_setting('MEMORY64'): - self.skipTest('not compatible with WASM_BIGINT') + if self.get_setting('MEMORY64'): + self.skipTest('not compatible with MEMORY64') cases = [ ('DIRECT', []), ('DYNAMIC_SIG', ['-sDYNCALLS=1']), @@ -7719,16 +7704,12 @@ def test_embind_dynamic_initialization(self): @no_wasm2js('wasm_bigint') def test_embind_i64_val(self): - self.set_setting('WASM_BIGINT') self.emcc_args += ['-lembind'] - self.node_args += shared.node_bigint_flags() self.do_run_in_out_file_test('embind/test_i64_val.cpp', assert_identical=True) @no_wasm2js('wasm_bigint') def test_embind_i64_binding(self): - self.set_setting('WASM_BIGINT') self.emcc_args += ['-lembind'] - self.node_args += shared.node_bigint_flags() self.do_run_in_out_file_test('embind/test_i64_binding.cpp', assert_identical=True) def test_embind_no_rtti(self): @@ -9842,8 +9823,7 @@ def setUp(self): settings={'MEMORY64': 1}, require_wasm64=True, require_v8=True) # MEMORY64=2, or "lowered" wasm64l = make_run('wasm64l', emcc_args=['-Wno-experimental', '--profiling-funcs'], - settings={'MEMORY64': 2}, - node_args=shared.node_bigint_flags()) + settings={'MEMORY64': 2}) lto0 = make_run('lto0', emcc_args=['-flto', '-O0']) lto1 = make_run('lto1', emcc_args=['-flto', '-O1']) @@ -9879,9 +9859,6 @@ def setUp(self): core2s = make_run('core2s', emcc_args=['-O2'], settings={'SAFE_HEAP': 1}) core2ss = make_run('core2ss', emcc_args=['-O2'], settings={'STACK_OVERFLOW_CHECK': 2}) -bigint = make_run('bigint', emcc_args=['--profiling-funcs'], settings={'WASM_BIGINT': 1}, - node_args=shared.node_bigint_flags()) - # Add DEFAULT_TO_CXX=0 strict = make_run('strict', emcc_args=[], settings={'STRICT': 1}) From c64adf28f48a4618aff26ff3f1a1ba2c23c05f08 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Apr 2023 15:41:34 -0700 Subject: [PATCH 10/42] more --- test/test_browser.py | 5 +---- test/test_other.py | 16 +--------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/test/test_browser.py b/test/test_browser.py index 36e2e38825569..f18c37802fdcb 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -4017,7 +4017,7 @@ def test_pthread_iostream(self): @requires_threads def test_pthread_unistd_io_bigint(self): - self.btest_exit(test_file('unistd/io.c'), args=['-pthread', '-sPROXY_TO_PTHREAD', '-sWASM_BIGINT']) + self.btest_exit(test_file('unistd/io.c'), args=['-pthread', '-sPROXY_TO_PTHREAD']) # Test that the main thread is able to use pthread_set/getspecific. @also_with_wasm2js @@ -5380,9 +5380,6 @@ def test_dlmalloc_3GB(self): 'main_thread': (['-sPTHREAD_POOL_SIZE=5'],), # using proxy_to_pthread also works, of course 'proxy_to_pthread': (['-sPROXY_TO_PTHREAD', '-sINITIAL_MEMORY=32MB', '-DPROXYING'],), - # using BigInt support affects the ABI, and should not break things. (this - # could be tested on either thread; do the main thread for simplicity) - 'bigint': (['-sPTHREAD_POOL_SIZE=5', '-sWASM_BIGINT'],), }) @requires_threads def test_wasmfs_fetch_backend(self, args): diff --git a/test/test_other.py b/test/test_other.py index 94f79d4e9741c..44ad4a5118e2d 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -1986,14 +1986,12 @@ def test_dylink_pthread_warning(self): @node_pthreads def test_dylink_pthread_bigint_em_asm(self): self.set_setting('MAIN_MODULE', 2) - self.set_setting('WASM_BIGINT') self.emcc_args += ['-Wno-experimental', '-pthread'] self.do_runf(test_file('hello_world_em_asm.c'), 'hello, world') @node_pthreads def test_dylink_pthread_bigint_em_js(self): self.set_setting('MAIN_MODULE', 2) - self.set_setting('WASM_BIGINT') self.emcc_args += ['-Wno-experimental', '-pthread'] self.do_runf(test_file('core/test_em_js.cpp')) @@ -4477,12 +4475,6 @@ def guess_symbols_file_type(symbols_file): self.assertContained(UNMINIFIED_HEAP8, js) self.assertContained(UNMINIFIED_MIDDLE, js) - @parameterized({ - '': [[]], - # bigint support is interesting to test here because it changes which - # binaryen tools get run, which can affect how debug info is kept around - 'bigint': [['-sWASM_BIGINT']], - }) def test_symbol_map_output_size(self, args): # build with and without a symbol map and verify that the sizes are the # same. using a symbol map should add the map on the side, but not increase @@ -7337,7 +7329,6 @@ def test_EM_ASM_i64(self): expected_output=expected, assert_returncode=NON_ZERO) - self.set_setting('WASM_BIGINT') self.do_other_test('test_em_asm_i64.cpp') self.do_other_test('test_em_asm_i64.cpp', force_c=True) @@ -11485,7 +11476,6 @@ def test_standalone_export_main(self): @requires_wasm_eh def test_standalone_wasm_exceptions(self): self.set_setting('STANDALONE_WASM') - self.set_setting('WASM_BIGINT') self.wasm_engines = [] self.emcc_args += ['-fwasm-exceptions'] self.do_run_from_file(test_file('core/test_exceptions.cpp'), test_file('core/test_exceptions_caught.out')) @@ -11701,7 +11691,6 @@ def test_this_in_dyncall_memory64(self): @parameterized({ 'plain': [[]], 'asyncify': [['-sASYNCIFY']], - 'asyncify_bigint': [['-sASYNCIFY', '-sWASM_BIGINT']]}) def test_closure_safe(self, args): self.run_process([EMCC, test_file('hello_world.c'), '--closure=1'] + args) @@ -12613,8 +12602,6 @@ def test_wasmfs_readfile(self): @wasmfs_all_backends def test_wasmfs_readfile_bigint(self): self.set_setting('FORCE_FILESYSTEM') - self.set_setting('WASM_BIGINT') - self.node_args += shared.node_bigint_flags() self.do_run_in_out_file_test(test_file('wasmfs/wasmfs_readfile.c')) def test_wasmfs_jsfile(self): @@ -13176,7 +13163,7 @@ def test_reproduce(self): def test_min_browser_version(self): err = self.expect_fail([EMCC, test_file('hello_world.c'), '-Werror', '-sWASM_BIGINT', '-sMIN_SAFARI_VERSION=120000']) - self.assertContained('emcc: error: MIN_SAFARI_VERSION=120000 is not compatible with WASM_BIGINT (150000 or above required)', err) + self.assertContained('emcc: error: MIN_SAFARI_VERSION=120000 is not compatible with WASM_BIGINT (140100 or above required)', err) err = self.expect_fail([EMCC, test_file('hello_world.c'), '-Werror', '-pthread', '-sMIN_CHROME_VERSION=73']) self.assertContained('emcc: error: MIN_CHROME_VERSION=73 is not compatible with pthreads (74 or above required)', err) @@ -13333,7 +13320,6 @@ def test_missing_struct_info(self): def run_wasi_test_suite_test(self, name): if not os.path.exists(path_from_root('test/third_party/wasi-test-suite')): self.fail('wasi-testsuite not found; run `git submodule update --init`') - self.node_args += shared.node_bigint_flags() wasm = path_from_root('test', 'third_party', 'wasi-test-suite', name + '.wasm') with open(path_from_root('test', 'third_party', 'wasi-test-suite', name + '.json')) as f: config = json.load(f) From e7259ed5521d87362f96d5fe8480ef05128e7bee Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Apr 2023 15:58:04 -0700 Subject: [PATCH 11/42] fix --- test/test_other.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_other.py b/test/test_other.py index 44ad4a5118e2d..19777535c8380 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -11691,6 +11691,7 @@ def test_this_in_dyncall_memory64(self): @parameterized({ 'plain': [[]], 'asyncify': [['-sASYNCIFY']], + }) def test_closure_safe(self, args): self.run_process([EMCC, test_file('hello_world.c'), '--closure=1'] + args) From 09ea912aba00f260391203c30b0ab9e929848113 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Apr 2023 15:58:44 -0700 Subject: [PATCH 12/42] fixflake8 --- emcc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emcc.py b/emcc.py index 87ebf636d03e5..df40d73f75b23 100755 --- a/emcc.py +++ b/emcc.py @@ -1898,7 +1898,7 @@ def phase_linker_setup(options, state, newargs): # WASM_BIGINT defaults to 1 when VMs support it, and when not using wasm2js default_setting('WASM_BIGINT', - feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION) and \ + feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION) and not settings.WASM2JS) if settings.PURE_WASI: From 66995312c43daa35d792a750d214beb70198ede9 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Apr 2023 16:25:25 -0700 Subject: [PATCH 13/42] work --- test/common.py | 11 +++++++---- test/test_other.py | 6 ++++++ tools/feature_matrix.py | 3 +++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/test/common.py b/test/common.py index c539c8ea1ae97..e6db058da27e7 100644 --- a/test/common.py +++ b/test/common.py @@ -600,10 +600,13 @@ def setUp(self): else: # Include backtrace for all uncuaght exceptions (not just Error). self.node_args.append('--trace-uncaught') - if node_version < (15, 0, 0): - # Opt in to node v15 default behaviour: - # https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode - self.node_args.append('--unhandled-rejections=throw') + if node_version < (15, 0, 0): + # Opt in to node v15 default behaviour: + # https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode + self.node_args.append('--unhandled-rejections=throw') + else: + # WASM_BIGINT is on by default, which requires node 15+ + self.emcc_args.append('-sWASM_BIGINT=0') self.v8_args = ['--wasm-staging'] self.env = {} diff --git a/test/test_other.py b/test/test_other.py index 19777535c8380..8f34b792f9a70 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -13269,6 +13269,12 @@ def test_min_node_version(self): expected = 'This emscripten-generated code requires node v21.0.0 (detected v%s' % node_version self.do_runf(test_file('hello_world.c'), expected, assert_returncode=NON_ZERO) + def test_min_node_version_bigint(self): + err = self.expect_fail([EMCC, test_file('hello_world.c'), '-Werror', '-sWASM_BIGINT', '-sMIN_NODE_VERSION=149999']) + self.assertContained('emcc: error: MIN_NODE_VERSION=149999 is not compatible with WASM_BIGINT (150000 or above required)', err) + + self.run_process([EMCC, test_file('hello_world.c'), '-Werror', '-sWASM_BIGINT', '-sMIN_NODE_VERSION=150000']) + def test_deprecated_macros(self): create_file('main.c', ''' #include diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index ec640435c8cd8..cb82558577888 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -52,6 +52,7 @@ class Feature(IntEnum): 'firefox': 68, # Note: Safari 14.1 shipped only in iOS 14.5, which can be confusing. 'safari': 140100, + 'node': 150000, }, Feature.THREADS: { 'chrome': 74, @@ -83,6 +84,8 @@ def caniuse(feature): # IE don't support any non-MVP features if settings.MIN_IE_VERSION != 0x7FFFFFFF: return False + if 'node' in min_versions and settings.MIN_NODE_VERSION < min_versions['node']: + return False return True From d907b0e886b8476648496788f16edf6eff67f4a1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 12 Apr 2023 16:06:53 -0700 Subject: [PATCH 14/42] fix --- test/test_other.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 8f34b792f9a70..5309e82ca04df 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -4475,14 +4475,14 @@ def guess_symbols_file_type(symbols_file): self.assertContained(UNMINIFIED_HEAP8, js) self.assertContained(UNMINIFIED_MIDDLE, js) - def test_symbol_map_output_size(self, args): + def test_symbol_map_output_size(self): # build with and without a symbol map and verify that the sizes are the # same. using a symbol map should add the map on the side, but not increase # the build size. # -Oz is used here to run as many optimizations as possible, to check for # any difference in how the optimizer operates - self.run_process([EMCC, test_file('hello_world.c'), '-Oz', '-o', 'test1.js'] + args) - self.run_process([EMCC, test_file('hello_world.c'), '-Oz', '-o', 'test2.js', '--emit-symbol-map'] + args) + self.run_process([EMCC, test_file('hello_world.c'), '-Oz', '-o', 'test1.js']) + self.run_process([EMCC, test_file('hello_world.c'), '-Oz', '-o', 'test2.js', '--emit-symbol-map']) self.assertEqual(os.path.getsize('test1.js'), os.path.getsize('test2.js')) self.assertEqual(os.path.getsize('test1.wasm'), os.path.getsize('test2.wasm')) @@ -7324,13 +7324,8 @@ def test_memory_growth_noasm(self): assert 'use asm' not in src def test_EM_ASM_i64(self): - expected = 'Invalid character 106("j") in readEmAsmArgs!' - self.do_runf(test_file('other/test_em_asm_i64.cpp'), - expected_output=expected, - assert_returncode=NON_ZERO) - self.do_other_test('test_em_asm_i64.cpp') - self.do_other_test('test_em_asm_i64.cpp', force_c=True) + # self.do_other_test('test_em_asm_i64.cpp', force_c=True) def test_eval_ctor_ordering(self): # ensure order of execution remains correct, even with a bad ctor From af838e7f146afc788b5343a91abdeb0ce529110c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 12 Apr 2023 16:07:01 -0700 Subject: [PATCH 15/42] fix --- src/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings.js b/src/settings.js index 802431ae8c82a..62eb363b8285d 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1796,7 +1796,7 @@ var MIN_CHROME_VERSION = 75; // distinct from the minimum version required run the emscripten compiler. // This version aligns with the current Ubuuntu TLS 20.04 (Focal). // Version is encoded in MMmmVV, e.g. 1814101 denotes Node 18.14.01. -var MIN_NODE_VERSION = 101900; +var MIN_NODE_VERSION = 150000; // Tracks whether we are building with errno support enabled. Set to 0 // to disable compiling errno support in altogether. This saves a little From 9aac7435af9c29873ed047a480829695e2d869ea Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 12 Apr 2023 16:07:12 -0700 Subject: [PATCH 16/42] fix --- test/common.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/common.py b/test/common.py index e6db058da27e7..d8dd6d873c1c8 100644 --- a/test/common.py +++ b/test/common.py @@ -604,8 +604,7 @@ def setUp(self): # Opt in to node v15 default behaviour: # https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode self.node_args.append('--unhandled-rejections=throw') - else: - # WASM_BIGINT is on by default, which requires node 15+ + # WASM_BIGINT requires node 15+ self.emcc_args.append('-sWASM_BIGINT=0') self.v8_args = ['--wasm-staging'] From 51423004315e90787c27d066e8ac1ae36d17eca8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 12 Apr 2023 16:16:40 -0700 Subject: [PATCH 17/42] work --- tools/feature_matrix.py | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index cb82558577888..64c4c0b14b078 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -70,22 +70,26 @@ class Feature(IntEnum): def caniuse(feature): - min_versions = min_browser_versions[feature] - if settings.MIN_CHROME_VERSION < min_versions['chrome']: - return False - # For edge we just use the same version requirements as chrome since, - # at least for modern versions of edge, they share version numbers. - if settings.MIN_EDGE_VERSION < min_versions['chrome']: - return False - if settings.MIN_FIREFOX_VERSION < min_versions['firefox']: - return False - if settings.MIN_SAFARI_VERSION < min_versions['safari']: - return False - # IE don't support any non-MVP features - if settings.MIN_IE_VERSION != 0x7FFFFFFF: - return False - if 'node' in min_versions and settings.MIN_NODE_VERSION < min_versions['node']: - return False + if settings.ENVIRONMENT_MAY_BE_WEB or settings.ENVIRONMENT_MAY_BE_WORKER: + min_versions = min_browser_versions[feature] + if settings.MIN_CHROME_VERSION < min_versions['chrome']: + return False + # For edge we just use the same version requirements as chrome since, + # at least for modern versions of edge, they share version numbers. + if settings.MIN_EDGE_VERSION < min_versions['chrome']: + return False + if settings.MIN_FIREFOX_VERSION < min_versions['firefox']: + return False + if settings.MIN_SAFARI_VERSION < min_versions['safari']: + return False + # IE don't support any non-MVP features + if settings.MIN_IE_VERSION != 0x7FFFFFFF: + return False + + if settings.ENVIRONMENT_MAY_BE_NODE: + if 'node' in min_versions and settings.MIN_NODE_VERSION < min_versions['node']: + return False + return True From 71ca03a1a5899739bc0c533f5567da5736e8c929 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 12 Apr 2023 16:43:13 -0700 Subject: [PATCH 18/42] feedback --- ChangeLog.md | 3 +++ src/settings.js | 3 +-- test/test_core.py | 2 +- test/test_other.py | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index e3abed28e258c..6d7f6ea1a24d7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -20,6 +20,9 @@ See docs/process.md for more on how version tagging works. 3.1.36 (in development) ----------------------- +- Enable WASM_BIGINT support by default. (#19156) +- Bump the default minimum Firefox version from 65 to 68. +- Bump the default minimum Node version from 10.19 to 15.0. 3.1.35 - 04/03/23 ----------------- diff --git a/src/settings.js b/src/settings.js index 62eb363b8285d..a2c295d3efb66 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1379,8 +1379,7 @@ var DYNCALLS = false; // WebAssembly integration with JavaScript BigInt. When enabled we don't need to // legalize i64s into pairs of i32s, as the wasm VM will use a BigInt where an -// i64 is used. If WASM_BIGINT is present, the default minimum supported browser -// versions will be increased to the min version that supports BigInt. +// i64 is used. // [link] var WASM_BIGINT = true; diff --git a/test/test_core.py b/test/test_core.py index 7d2357ac7582a..53511fa5bbe0a 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -2319,7 +2319,7 @@ def test_em_js(self, args, force_c): @no_wasm2js('WASM_BIGINT is not compatible with wasm2js') def test_em_js_i64(self): - err = self.expect_fail([EMCC, '-sWASM=0', '-Werror', test_file('core/test_em_js_i64.c')]) + err = self.expect_fail([EMCC, '-sWASM_BIGINT=0', '-Werror', test_file('core/test_em_js_i64.c')]) self.assertContained('emcc: error: using 64-bit arguments in EM_JS function without WASM_BIGINT is not yet fully supported: `foo`', err) self.do_core_test('test_em_js_i64.c') diff --git a/test/test_other.py b/test/test_other.py index 5309e82ca04df..6a07173c48c05 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -7183,7 +7183,6 @@ def test_i64_return_value(self, args, bind_js): ''') # Run the test and confirm the output is as expected. - self.node_args += shared.node_bigint_flags() out = self.run_js('testrun.js') self.assertContained('''\ input = 0xaabbccdd11223344 From d23687e71b5564d00f19850e539f21fa61e37847 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 13 Apr 2023 12:28:25 -0700 Subject: [PATCH 19/42] update test --- test/core/test_getValue_setValue.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/test_getValue_setValue.out b/test/core/test_getValue_setValue.out index 7ddde3db3e75b..70b13d736ab52 100644 --- a/test/core/test_getValue_setValue.out +++ b/test/core/test_getValue_setValue.out @@ -1,4 +1,4 @@ i32: 120 i32: 1234 -i64: 0x12345678 number +i64: 0x7766554412345678 bigint ptr: 0x12345678 number From 83165d18a475e99d01d3473b2d2d11163669046a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 13 Apr 2023 12:29:06 -0700 Subject: [PATCH 20/42] fix --- tools/feature_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 64c4c0b14b078..b9e701fdd96f0 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -70,8 +70,8 @@ class Feature(IntEnum): def caniuse(feature): + min_versions = min_browser_versions[feature] if settings.ENVIRONMENT_MAY_BE_WEB or settings.ENVIRONMENT_MAY_BE_WORKER: - min_versions = min_browser_versions[feature] if settings.MIN_CHROME_VERSION < min_versions['chrome']: return False # For edge we just use the same version requirements as chrome since, From 0fb245855274c6761122a048cd0b06b19d0f16f1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 13 Apr 2023 13:36:59 -0700 Subject: [PATCH 21/42] try to fix test_dyncall_specific --- src/library.js | 4 ++++ test/core/dyncall_specific.c | 16 +++++++--------- test/core/dyncall_specific.out | 4 ++-- test/test_core.py | 3 ++- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/library.js b/src/library.js index f2afff44362cd..65eef95185542 100644 --- a/src/library.js +++ b/src/library.js @@ -3191,8 +3191,12 @@ mergeInto(LibraryManager.library, { assert(('dynCall_' + sig) in Module, 'bad function pointer type - dynCall function not found for sig \'' + sig + '\''); #endif if (args && args.length) { +#if WASM_BIGINT + assert(args.length === sig.length - 1); +#else // j (64-bit integer) must be passed in as two numbers [low 32, high 32]. assert(args.length === sig.substring(1).replace(/j/g, '--').length); +#endif } else { assert(sig.length == 1); } diff --git a/test/core/dyncall_specific.c b/test/core/dyncall_specific.c index 52c0ed1eef58d..632fbda591a95 100644 --- a/test/core/dyncall_specific.c +++ b/test/core/dyncall_specific.c @@ -11,11 +11,9 @@ int waka(int w, long long xy, int z) { // xy should be 0xffff_ffff_0000_0004 - int x = (int) xy; // should be 4 - int y = xy >> 32; // should be -1 EM_ASM({ - out('received ' + [$0, $1, $2, $3] + '.'); - }, w, x, y, z); + out('received ' + [$0, $1, $2] + '.'); + }, w, xy, z); return 42; } @@ -26,23 +24,23 @@ int main() { // Note that these would need to use BigInts if the file were built with // -sWASM_BIGINT #if DIRECT - console.log('Received ' + dynCall_iiji($0, 1, 4, 0xffffffff, 9)); + console.log('Received ' + dynCall_iiji($0, 1, BigInt(4), 9)); return; #endif #if DYNAMIC_SIG - console.log('Received ' + dynCall('iiji', $0, [1, 4, 0xffffffff, 9])); + console.log('Received ' + dynCall('iiji', $0, [1, BigInt(4), 9])); return; #endif #if EXPORTED - console.log('Received ' + Module['dynCall_iiji']($0, 1, 4, 0xffffffff, 9)); + console.log('Received ' + Module['dynCall_iiji']($0, 1, BigInt(4), 9)); return; #endif #if EXPORTED_DYNAMIC_SIG - console.log('Received ' + Module['dynCall']('iiji', $0, [1, 4, 0xffffffff, 9])); + console.log('Received ' + Module['dynCall']('iiji', $0, [1, BigInt(4), 9])); return; #endif #if FROM_OUTSIDE - eval("console.log('Received ' + Module['dynCall_iiji'](" + $0 + ", 1, 4, 0xffffffff, 9))"); + eval("console.log('Received ' + Module['dynCall_iiji'](" + $0 + ", 1, BigInt(4), 9))"); return; #endif throw "no test mode"; diff --git a/test/core/dyncall_specific.out b/test/core/dyncall_specific.out index b3911f38b37b2..622c81c0b148c 100644 --- a/test/core/dyncall_specific.out +++ b/test/core/dyncall_specific.out @@ -1,2 +1,2 @@ -received 1,4,-1,9. -Received 42 \ No newline at end of file +received 1,4,9. +Received 42 diff --git a/test/test_core.py b/test/test_core.py index 53511fa5bbe0a..deb0a04b75abc 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7216,8 +7216,9 @@ def test_EXPORTED_RUNTIME_METHODS(self): def test_dyncall_specific(self, *args): if self.get_setting('MEMORY64'): self.skipTest('not compatible with MEMORY64') + args = list(args) + ['-sDYNCALLS=1'] # why was this not needed before wasm_bigint? cases = [ - ('DIRECT', []), + ('DIRECT', ['-sDYNCALLS=1']), ('DYNAMIC_SIG', ['-sDYNCALLS=1']), ] if '-sMINIMAL_RUNTIME=1' in args: From d1e4aecc04116bc3c35295697a7048f1b41bb35e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 13 Apr 2023 14:04:11 -0700 Subject: [PATCH 22/42] fix old node version handling in common.py (maybe) --- test/common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/common.py b/test/common.py index d8dd6d873c1c8..f09232a93189b 100644 --- a/test/common.py +++ b/test/common.py @@ -600,10 +600,11 @@ def setUp(self): else: # Include backtrace for all uncuaght exceptions (not just Error). self.node_args.append('--trace-uncaught') + if node_version < (15, 0, 0): + # Opt in to node v15 default behaviour: + # https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode + self.node_args.append('--unhandled-rejections=throw') if node_version < (15, 0, 0): - # Opt in to node v15 default behaviour: - # https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode - self.node_args.append('--unhandled-rejections=throw') # WASM_BIGINT requires node 15+ self.emcc_args.append('-sWASM_BIGINT=0') From 2ae89c59c3dbd45f7c54b10df3cbad8049dcddf3 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 13 Apr 2023 15:05:59 -0700 Subject: [PATCH 23/42] fix --- test/common.py | 5 +++++ test/test_other.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/common.py b/test/common.py index f09232a93189b..11fc5189124db 100644 --- a/test/common.py +++ b/test/common.py @@ -607,6 +607,11 @@ def setUp(self): if node_version < (15, 0, 0): # WASM_BIGINT requires node 15+ self.emcc_args.append('-sWASM_BIGINT=0') + # Adjust the minimum node version for what we will run in. To do so, + # convert to the format we use in our settings, XXYYZZ, for example, + # 10.1.7 will turn into "100107". + str_node_version = ''.join([str(part).rjust(2, '0') for part in node_version]) + self.emcc_args.append(f'-sMIN_NODE_VERSION={str_node_version}') self.v8_args = ['--wasm-staging'] self.env = {} diff --git a/test/test_other.py b/test/test_other.py index 623b302cc46e0..a44e0ef32bef8 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12378,7 +12378,7 @@ def test_node_unhandled_rejection(self): # With NODEJS_CATCH_REJECTION we expect the unhandled rejection to cause a non-zero # exit code and log the stack trace correctly. - self.run_process([EMCC, '--pre-js=pre.js', '-sNODEJS_CATCH_REJECTION', 'main.c']) + self.run_process([EMCC, '--pre-js=pre.js', '-sNODEJS_CATCH_REJECTION', 'main.c'] + self.emcc_args) output = self.run_js('a.out.js', assert_returncode=NON_ZERO) self.assertContained('unhandledRejection', read_file('a.out.js')) self.assertContained('ReferenceError: missing is not defined', output) @@ -12387,7 +12387,7 @@ def test_node_unhandled_rejection(self): # Without NODEJS_CATCH_REJECTION we expect node to log the unhandled rejection # but return 0. self.node_args = [a for a in self.node_args if '--unhandled-rejections' not in a] - self.run_process([EMCC, '--pre-js=pre.js', '-sNODEJS_CATCH_REJECTION=0', 'main.c']) + self.run_process([EMCC, '--pre-js=pre.js', '-sNODEJS_CATCH_REJECTION=0', 'main.c'] + self.emcc_args) self.assertNotContained('unhandledRejection', read_file('a.out.js')) if shared.check_node_version()[0] >= 15: From 3f3c561960bce38889d8ad633cdd59fdca5d1e24 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 13 Apr 2023 15:37:03 -0700 Subject: [PATCH 24/42] fix --- test/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/common.py b/test/common.py index 11fc5189124db..8a8163a3b874e 100644 --- a/test/common.py +++ b/test/common.py @@ -884,9 +884,9 @@ def cleanup(line): if len(line) > 2048: # Sanity check that this is really the emscripten program/module on # a single line. - assert line.startswith('var Module=typeof Module!="undefined"') - long_lines.append(line) - line = '' + if line.startswith('var Module=typeof Module!="undefined"'): + long_lines.append(line) + line = '' return line lines = [cleanup(l) for l in lines] From bf566aa62be5a276f5ed55418a98a8f8b84a6ec8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 13 Apr 2023 17:09:41 -0700 Subject: [PATCH 25/42] fix --- test/common.py | 9 +-------- tools/building.py | 17 +++++++++++++++++ tools/cache.py | 1 + tools/gen_struct_info.py | 5 ++++- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/test/common.py b/test/common.py index 8a8163a3b874e..329c2696477a2 100644 --- a/test/common.py +++ b/test/common.py @@ -604,14 +604,7 @@ def setUp(self): # Opt in to node v15 default behaviour: # https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode self.node_args.append('--unhandled-rejections=throw') - if node_version < (15, 0, 0): - # WASM_BIGINT requires node 15+ - self.emcc_args.append('-sWASM_BIGINT=0') - # Adjust the minimum node version for what we will run in. To do so, - # convert to the format we use in our settings, XXYYZZ, for example, - # 10.1.7 will turn into "100107". - str_node_version = ''.join([str(part).rjust(2, '0') for part in node_version]) - self.emcc_args.append(f'-sMIN_NODE_VERSION={str_node_version}') + self.emcc_args += building.get_emcc_node_flags(node_version) self.v8_args = ['--wasm-staging'] self.env = {} diff --git a/tools/building.py b/tools/building.py index 9125335950d0f..a59b907ca772c 100644 --- a/tools/building.py +++ b/tools/building.py @@ -1338,3 +1338,20 @@ def js_legalization_pass_flags(): # assumes they are imports. flags += ['--pass-arg=legalize-js-interface-exported-helpers'] return flags + + +# Returns a list of flags to pass to emcc that make the output run properly in +# the given node version. +def get_emcc_node_flags(node_version): + if not node_version: + return [] + ret = [] + if node_version < (15, 0, 0): + # WASM_BIGINT requires node 15+ + ret.append('-sWASM_BIGINT=0') + # Adjust the minimum node version for what we will run in. To do so, + # convert to the format we use in our settings, XXYYZZ, for example, + # 10.1.7 will turn into "100107". + str_node_version = ''.join([str(part).rjust(2, '0') for part in node_version]) + ret.append(f'-sMIN_NODE_VERSION={str_node_version}') + return ret diff --git a/tools/cache.py b/tools/cache.py index 1d3d433aa0f52..aab304f90045c 100644 --- a/tools/cache.py +++ b/tools/cache.py @@ -70,6 +70,7 @@ def ensure(): def erase(): + return with lock('erase'): # Delete everything except the lockfile itself utils.delete_contents(cachedir, exclude=[os.path.basename(cachelock_name)]) diff --git a/tools/gen_struct_info.py b/tools/gen_struct_info.py index ec746aee87d74..4eddd8d93541b 100755 --- a/tools/gen_struct_info.py +++ b/tools/gen_struct_info.py @@ -67,6 +67,7 @@ __rootdir__ = os.path.dirname(__scriptdir__) sys.path.append(__rootdir__) +from tools import building from tools import shared from tools import system_libs from tools import utils @@ -239,6 +240,8 @@ def inspect_headers(headers, cflags): else: compiler = shared.EMCC + node_flags = building.get_emcc_node_flags(shared.check_node_version()) + # -O1+ produces calls to iprintf, which libcompiler_rt doesn't support cmd = [compiler] + cflags + ['-o', js_file[1], src_file[1], '-O0', @@ -248,7 +251,7 @@ def inspect_headers(headers, cflags): compiler_rt, '-sBOOTSTRAPPING_STRUCT_INFO', '-sSTRICT', - '-sASSERTIONS=0'] + '-sASSERTIONS=0'] + node_flags # Default behavior for emcc is to warn for binaryen version check mismatches # so we should try to match that behavior. From 94597013dce6c09360466b67d1efddf066f5dc6b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 14 Apr 2023 12:33:48 -0700 Subject: [PATCH 26/42] fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 222eba5ad4868..ffd8a4ce41e27 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -593,7 +593,7 @@ jobs: other.test_min_node_version other.test_node_emscripten_num_logical_cores core2.test_pthread_create - core2.test_i64_invoke + core2.test_i64_invoke_bigint core2.test_sse2 core2.test_source_map core2.test_exceptions_wasm From 8dbb1ae77930eb0a80588b74ba4593432b3a4e68 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 14 Apr 2023 12:34:58 -0700 Subject: [PATCH 27/42] more test workarounds --- test/test_core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_core.py b/test/test_core.py index deb0a04b75abc..451702b396cea 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7209,6 +7209,7 @@ def test_EXPORTED_RUNTIME_METHODS(self): self.set_setting('EXPORTED_RUNTIME_METHODS', ['dynCall', 'addFunction', 'lengthBytesUTF8', 'getTempRet0', 'setTempRet0']) self.do_core_test('EXPORTED_RUNTIME_METHODS.c') + @no_wasm2js('depends on bigint support directly, which wasm2js disallows') @parameterized({ '': [], 'minimal_runtime': ['-sMINIMAL_RUNTIME=1'] @@ -7234,6 +7235,7 @@ def test_dyncall_specific(self, *args): print(str(args) + ' ' + which) self.do_core_test('dyncall_specific.c', emcc_args=['-D' + which] + list(args) + extra_args) + @no_wasm2js('depends on bigint support directly, which wasm2js disallows') def test_getValue_setValue(self): # these used to be exported, but no longer are by default def test(out_suffix='', args=None, assert_returncode=0): From 560120af3eb85765f387b1ef5f883426340dd205 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 17 Apr 2023 09:54:39 -0700 Subject: [PATCH 28/42] fix --- tools/building.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tools/building.py b/tools/building.py index a59b907ca772c..1edc328cf107d 100644 --- a/tools/building.py +++ b/tools/building.py @@ -1345,13 +1345,7 @@ def js_legalization_pass_flags(): def get_emcc_node_flags(node_version): if not node_version: return [] - ret = [] - if node_version < (15, 0, 0): - # WASM_BIGINT requires node 15+ - ret.append('-sWASM_BIGINT=0') - # Adjust the minimum node version for what we will run in. To do so, - # convert to the format we use in our settings, XXYYZZ, for example, - # 10.1.7 will turn into "100107". - str_node_version = ''.join([str(part).rjust(2, '0') for part in node_version]) - ret.append(f'-sMIN_NODE_VERSION={str_node_version}') - return ret + # Vconvert to the format we use in our settings, XXYYZZ, for example, + # 10.1.7 will turn into "100107". + str_node_version = ''.join([str(part).rjust(2, '0') for part in node_version]) + return [f'-sMIN_NODE_VERSION={str_node_version}'] From 84836b2f2ba50fb482acfbb5dd7c17a7d8fc7d2f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 17 Apr 2023 09:55:05 -0700 Subject: [PATCH 29/42] fix --- tools/building.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/building.py b/tools/building.py index 1edc328cf107d..2132660f7adb0 100644 --- a/tools/building.py +++ b/tools/building.py @@ -1345,7 +1345,7 @@ def js_legalization_pass_flags(): def get_emcc_node_flags(node_version): if not node_version: return [] - # Vconvert to the format we use in our settings, XXYYZZ, for example, + # Convert to the format we use in our settings, XXYYZZ, for example, # 10.1.7 will turn into "100107". str_node_version = ''.join([str(part).rjust(2, '0') for part in node_version]) return [f'-sMIN_NODE_VERSION={str_node_version}'] From 356a840ee671ea6bb3407befe183890641210039 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 17 Apr 2023 10:00:08 -0700 Subject: [PATCH 30/42] Explain safari-bigint issue and set version to 15 --- tools/feature_matrix.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 189c794c350bc..8701edb284790 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -51,8 +51,11 @@ class Feature(IntEnum): Feature.JS_BIGINT_INTEGRATION: { 'chrome': 67, 'firefox': 68, - # Note: Safari 14.1 shipped only in iOS 14.5, which can be confusing. - 'safari': 140100, + # Note: Safari 14.1 is enough for wasm-bigint by itself (not that that + # shipped only in iOS 14.5, not 14.1, which can be confusing) - but it is + # not enough for us as we use BigInt64Array in that mode, and that only + # shipped in 15.0, so mark this feature as depending on that version. + 'safari': 150000, 'node': 150000, }, Feature.THREADS: { From 5985cddedc51819164f35aa71969c8438939be14 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 21 Jun 2023 11:01:32 -0700 Subject: [PATCH 31/42] fix --- ChangeLog.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 9a3d215bb78a9..2b6b8baf58b98 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -22,7 +22,6 @@ See docs/process.md for more on how version tagging works. ----------------------- - Enable WASM_BIGINT support by default. (#19156) - Bump the default minimum Firefox version from 65 to 68. -- Bump the default minimum Node version from 10.19 to 15.0. - The default minimum Node version of Emscripten output was bumped from 10.19 to 16.0. To run the output JS in an older version of node, you can use e.g. `-sMIN_NODE_VERSION=101900` which will apply the previous minimum version of From 85666844af5bb8a670a37e07eca2bd186117d839 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 21 Jun 2023 11:03:12 -0700 Subject: [PATCH 32/42] fix --- test/test_core.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/test_core.py b/test/test_core.py index 54cef8244b54c..b03c33b4fdbf9 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -210,10 +210,6 @@ def metafunc(self, standalone): # if we are impure, disallow all wasm engines if impure: self.wasm_engines = [] -<<<<<<< HEAD -======= - self.node_args += shared.node_bigint_flags() ->>>>>>> origin/main func(self) metafunc._parameterize = {'': (False,), From b537cc7968fe2a6767cb332e4dc62132f3271b8b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 10:16:07 -0700 Subject: [PATCH 33/42] fix --- test/common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/common.py b/test/common.py index 28ad808e7e397..d18c1e9400bd6 100644 --- a/test/common.py +++ b/test/common.py @@ -663,7 +663,6 @@ def setUp(self): # Opt in to node v15 default behaviour: # https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode self.node_args.append('--unhandled-rejections=throw') - self.emcc_args += building.get_emcc_node_flags(node_version) # If the version we are running tests in is lower than the version that # emcc targets then we need to tell emcc to target that older version. From 339b323f51220371f2dc2a76b94928654a6316b2 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 10:18:09 -0700 Subject: [PATCH 34/42] fix --- test/test_other.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_other.py b/test/test_other.py index 6758be9ca7aaa..b78871fcb0ff1 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -11810,7 +11810,7 @@ def test_split_module(self, customLoader, jspi): 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'] if jspi: - wasm_split_run += ['--jspi', '--enable-reference-types'] + wasm_split_run += ['--jspi', '--enable-reference-types', '--enable-bulk-memory'] self.run_process(wasm_split_run) os.remove('test_split_module.wasm') From 400f01ee293415bd532664fdbf62f389e32f6078 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 10:24:07 -0700 Subject: [PATCH 35/42] fix --- test/test_other.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_other.py b/test/test_other.py index b78871fcb0ff1..9e750d033dc81 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -13231,7 +13231,11 @@ def test_parseTools_legacy(self): def test_min_node_version(self): node_version = shared.check_node_version() node_version = '.'.join(str(x) for x in node_version) - self.set_setting('MIN_NODE_VERSION', 210000) + # use self.emcc_args so that we append this to the very end (using + # self.set_setting would cause it to be at the start, and overridden by + # the test runner's own changes to self.emcc_args, if it sets a node version + # as well). + self.emcc_args += ['-sMIN_NODE_VERSION=210000'] expected = 'This emscripten-generated code requires node v21.0.0 (detected v%s' % node_version self.do_runf(test_file('hello_world.c'), expected, assert_returncode=NON_ZERO) From 62366ca0ccc1a028c25d2e14d8aa3b29897f5e0b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 12:47:16 -0700 Subject: [PATCH 36/42] clean --- ChangeLog.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 2b6b8baf58b98..b970d804f2a0e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -21,7 +21,6 @@ See docs/process.md for more on how version tagging works. 3.1.42 (in development) ----------------------- - Enable WASM_BIGINT support by default. (#19156) -- Bump the default minimum Firefox version from 65 to 68. - The default minimum Node version of Emscripten output was bumped from 10.19 to 16.0. To run the output JS in an older version of node, you can use e.g. `-sMIN_NODE_VERSION=101900` which will apply the previous minimum version of From 2f8f82c1c717435c37bfcd568596a8363f63c5c2 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 12:49:25 -0700 Subject: [PATCH 37/42] waka --- src/library.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/library.js b/src/library.js index 8dc36d39ecca6..1de5dd96b26c2 100644 --- a/src/library.js +++ b/src/library.js @@ -3158,6 +3158,7 @@ mergeInto(LibraryManager.library, { #endif if (args && args.length) { // j (64-bit integer) must be passed in as two numbers [low 32, high 32]. + throw 'waka waka'; assert(args.length === sig.substring(1).replace(/j/g, '--').length); } else { assert(sig.length == 1); From 8eab1f5a0b99f4db2016f5e727fa9ae6766fd177 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 14:46:04 -0700 Subject: [PATCH 38/42] fix --- src/library.js | 8 +++++- test/core/dyncall_specific.c | 52 +++++++++++++++++++++++++++++----- test/core/dyncall_specific.out | 3 +- test/test_core.py | 4 ++- 4 files changed, 56 insertions(+), 11 deletions(-) diff --git a/src/library.js b/src/library.js index 1de5dd96b26c2..4ef958dd1f806 100644 --- a/src/library.js +++ b/src/library.js @@ -3157,9 +3157,15 @@ mergeInto(LibraryManager.library, { assert(('dynCall_' + sig) in Module, `bad function pointer type - dynCall function not found for sig '${sig}'`); #endif if (args && args.length) { +#if WASM_BIGINT + // j (64-bit integer) is fine, and is implemented as a BigInt. Without + // legalization, the number of parameters should match (j is not expanded + // into two i's). + assert(args.length === sig.length - 1); +#else // j (64-bit integer) must be passed in as two numbers [low 32, high 32]. - throw 'waka waka'; assert(args.length === sig.substring(1).replace(/j/g, '--').length); +#endif } else { assert(sig.length == 1); } diff --git a/test/core/dyncall_specific.c b/test/core/dyncall_specific.c index 52c0ed1eef58d..9e409ae5018ec 100644 --- a/test/core/dyncall_specific.c +++ b/test/core/dyncall_specific.c @@ -5,17 +5,27 @@ * found in the LICENSE file. */ +#include #include #include #include int waka(int w, long long xy, int z) { +#ifndef WASM_BIGINT // xy should be 0xffff_ffff_0000_0004 - int x = (int) xy; // should be 4 - int y = xy >> 32; // should be -1 - EM_ASM({ - out('received ' + [$0, $1, $2, $3] + '.'); - }, w, x, y, z); + int x = (int) xy; + int y = xy >> 32; + assert(w == 1); + assert(x == 4); + assert(y == -1); + assert(z == 9); +#else + // With WASM_BIGINT things are straightforward: the 64-bit value just arrives + // with the expected value of 4. + assert(w == 1); + assert(xy == 4); + assert(z == 9); +#endif return 42; } @@ -23,8 +33,9 @@ EM_JS_DEPS(main, "$dynCall"); int main() { EM_ASM({ - // Note that these would need to use BigInts if the file were built with - // -sWASM_BIGINT + +#ifndef WASM_BIGINT + #if DIRECT console.log('Received ' + dynCall_iiji($0, 1, 4, 0xffffffff, 9)); return; @@ -45,6 +56,33 @@ int main() { eval("console.log('Received ' + Module['dynCall_iiji'](" + $0 + ", 1, 4, 0xffffffff, 9))"); return; #endif + +#else // WASM_BIGINT + +#if DIRECT + console.log('Received ' + dynCall_iiji($0, 1, BigInt(4), 9)); + return; +#endif +#if DYNAMIC_SIG + console.log('Received ' + dynCall('iiji', $0, [1, BigInt(4), 9])); + return; +#endif +#if EXPORTED + console.log('Received ' + Module['dynCall_iiji']($0, 1, BigInt(4), 9)); + return; +#endif +#if EXPORTED_DYNAMIC_SIG + console.log('Received ' + Module['dynCall']('iiji', $0, [1, BigInt(4), 9])); + return; +#endif +#if FROM_OUTSIDE + eval("console.log('Received ' + Module['dynCall_iiji'](" + $0 + ", 1, BigInt(4), 9))"); + return; +#endif + +#endif + + // We should have run the test and returned before we get here. throw "no test mode"; }, &waka); } diff --git a/test/core/dyncall_specific.out b/test/core/dyncall_specific.out index b3911f38b37b2..665f2d084a1d8 100644 --- a/test/core/dyncall_specific.out +++ b/test/core/dyncall_specific.out @@ -1,2 +1 @@ -received 1,4,-1,9. -Received 42 \ No newline at end of file +Received 42 diff --git a/test/test_core.py b/test/test_core.py index 835fac77de60d..4717baa68e534 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7209,8 +7209,10 @@ def test_EXPORTED_RUNTIME_METHODS(self): 'minimal_runtime': ['-sMINIMAL_RUNTIME=1'] }) def test_dyncall_specific(self, *args): - if self.get_setting('WASM_BIGINT') or self.get_setting('MEMORY64'): + if self.get_setting('MEMORY64'): self.skipTest('not compatible with WASM_BIGINT') + if self.get_setting('WASM_BIGINT'): + args = list(args) + ['-sDYNCALLS=1', '-DWASM_BIGINT'] cases = [ ('DIRECT', []), ('DYNAMIC_SIG', ['-sDYNCALLS=1']), From c93f72f94a8741906a1d7ba7c66eadf843ccfa55 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 14:48:49 -0700 Subject: [PATCH 39/42] comment --- test/test_core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test_core.py b/test/test_core.py index 4717baa68e534..292b81bd14085 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7212,6 +7212,9 @@ def test_dyncall_specific(self, *args): if self.get_setting('MEMORY64'): self.skipTest('not compatible with WASM_BIGINT') if self.get_setting('WASM_BIGINT'): + # define DYNCALLS because this test does test calling them directly, and + # in WASM_BIGINT mode we do not enable them by default (since we can do + # more without them - we don't need to legalize) args = list(args) + ['-sDYNCALLS=1', '-DWASM_BIGINT'] cases = [ ('DIRECT', []), From 568ee4076338310e7f3d74845a8ab2e5a0de2d2b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 14:53:07 -0700 Subject: [PATCH 40/42] fix --- test/test_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_core.py b/test/test_core.py index 292b81bd14085..24ea055461910 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7210,7 +7210,7 @@ def test_EXPORTED_RUNTIME_METHODS(self): }) def test_dyncall_specific(self, *args): if self.get_setting('MEMORY64'): - self.skipTest('not compatible with WASM_BIGINT') + self.skipTest('not compatible with MEMORY64') if self.get_setting('WASM_BIGINT'): # define DYNCALLS because this test does test calling them directly, and # in WASM_BIGINT mode we do not enable them by default (since we can do From fe12dc03d9e574a3d984ee688ceae145a4efb7a6 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 15:36:50 -0700 Subject: [PATCH 41/42] flip --- test/core/dyncall_specific.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/test/core/dyncall_specific.c b/test/core/dyncall_specific.c index 9e409ae5018ec..9b7045e872aa4 100644 --- a/test/core/dyncall_specific.c +++ b/test/core/dyncall_specific.c @@ -11,7 +11,13 @@ #include int waka(int w, long long xy, int z) { -#ifndef WASM_BIGINT +#ifdef WASM_BIGINT + // With WASM_BIGINT things are straightforward: the 64-bit value just arrives + // with the expected value of 4. + assert(w == 1); + assert(xy == 4); + assert(z == 9); +#else // xy should be 0xffff_ffff_0000_0004 int x = (int) xy; int y = xy >> 32; @@ -19,12 +25,6 @@ int waka(int w, long long xy, int z) { assert(x == 4); assert(y == -1); assert(z == 9); -#else - // With WASM_BIGINT things are straightforward: the 64-bit value just arrives - // with the expected value of 4. - assert(w == 1); - assert(xy == 4); - assert(z == 9); #endif return 42; } @@ -34,49 +34,49 @@ EM_JS_DEPS(main, "$dynCall"); int main() { EM_ASM({ -#ifndef WASM_BIGINT +#ifdef WASM_BIGINT #if DIRECT - console.log('Received ' + dynCall_iiji($0, 1, 4, 0xffffffff, 9)); + console.log('Received ' + dynCall_iiji($0, 1, BigInt(4), 9)); return; #endif #if DYNAMIC_SIG - console.log('Received ' + dynCall('iiji', $0, [1, 4, 0xffffffff, 9])); + console.log('Received ' + dynCall('iiji', $0, [1, BigInt(4), 9])); return; #endif #if EXPORTED - console.log('Received ' + Module['dynCall_iiji']($0, 1, 4, 0xffffffff, 9)); + console.log('Received ' + Module['dynCall_iiji']($0, 1, BigInt(4), 9)); return; #endif #if EXPORTED_DYNAMIC_SIG - console.log('Received ' + Module['dynCall']('iiji', $0, [1, 4, 0xffffffff, 9])); + console.log('Received ' + Module['dynCall']('iiji', $0, [1, BigInt(4), 9])); return; #endif #if FROM_OUTSIDE - eval("console.log('Received ' + Module['dynCall_iiji'](" + $0 + ", 1, 4, 0xffffffff, 9))"); + eval("console.log('Received ' + Module['dynCall_iiji'](" + $0 + ", 1, BigInt(4), 9))"); return; #endif #else // WASM_BIGINT #if DIRECT - console.log('Received ' + dynCall_iiji($0, 1, BigInt(4), 9)); + console.log('Received ' + dynCall_iiji($0, 1, 4, 0xffffffff, 9)); return; #endif #if DYNAMIC_SIG - console.log('Received ' + dynCall('iiji', $0, [1, BigInt(4), 9])); + console.log('Received ' + dynCall('iiji', $0, [1, 4, 0xffffffff, 9])); return; #endif #if EXPORTED - console.log('Received ' + Module['dynCall_iiji']($0, 1, BigInt(4), 9)); + console.log('Received ' + Module['dynCall_iiji']($0, 1, 4, 0xffffffff, 9)); return; #endif #if EXPORTED_DYNAMIC_SIG - console.log('Received ' + Module['dynCall']('iiji', $0, [1, BigInt(4), 9])); + console.log('Received ' + Module['dynCall']('iiji', $0, [1, 4, 0xffffffff, 9])); return; #endif #if FROM_OUTSIDE - eval("console.log('Received ' + Module['dynCall_iiji'](" + $0 + ", 1, BigInt(4), 9))"); + eval("console.log('Received ' + Module['dynCall_iiji'](" + $0 + ", 1, 4, 0xffffffff, 9))"); return; #endif From a42cb9ec11808dde768df46bae7d6bfef2fccdeb Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Jun 2023 15:37:54 -0700 Subject: [PATCH 42/42] remove =1s --- test/test_core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_core.py b/test/test_core.py index 24ea055461910..a1ba088731bbf 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7215,17 +7215,17 @@ def test_dyncall_specific(self, *args): # define DYNCALLS because this test does test calling them directly, and # in WASM_BIGINT mode we do not enable them by default (since we can do # more without them - we don't need to legalize) - args = list(args) + ['-sDYNCALLS=1', '-DWASM_BIGINT'] + args = list(args) + ['-sDYNCALLS', '-DWASM_BIGINT'] cases = [ ('DIRECT', []), - ('DYNAMIC_SIG', ['-sDYNCALLS=1']), + ('DYNAMIC_SIG', ['-sDYNCALLS']), ] if '-sMINIMAL_RUNTIME=1' in args: self.emcc_args += ['--pre-js', test_file('minimal_runtime_exit_handling.js')] else: cases += [ ('EXPORTED', []), - ('EXPORTED_DYNAMIC_SIG', ['-sDYNCALLS=1', '-sEXPORTED_RUNTIME_METHODS=dynCall']), + ('EXPORTED_DYNAMIC_SIG', ['-sDYNCALLS', '-sEXPORTED_RUNTIME_METHODS=dynCall']), ('FROM_OUTSIDE', ['-sEXPORTED_RUNTIME_METHODS=dynCall_iiji']) ]