Skip to content

Commit dd34e39

Browse files
committed
set WASM_BIGINT setting, fix tests
1 parent 22165af commit dd34e39

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

src/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,7 @@ var DYNCALLS = false;
14981498
// i64 is used. If WASM_BIGINT is present, the default minimum supported browser
14991499
// versions will be increased to the min version that supports BigInt.
15001500
// [link]
1501-
var WASM_BIGINT = false;
1501+
var WASM_BIGINT = true;
15021502

15031503
// WebAssembly defines a "producers section" which compilers and tools can
15041504
// annotate themselves in, and LLVM emits this by default.

test/test_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4204,7 +4204,7 @@ def test_small_js_flags(self):
42044204
print('size:', size)
42054205
# Note that this size includes test harness additions (for reporting the result, etc.).
42064206
if not self.is_wasm64() and not self.is_2gb():
4207-
self.assertLess(abs(size - 4592), 100)
4207+
self.assertLess(abs(size - 4486), 100)
42084208

42094209
# Tests that it is possible to initialize and render WebGL content in a
42104210
# pthread by using OffscreenCanvas.

test/test_core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7005,6 +7005,7 @@ def test_EXPORTED_RUNTIME_METHODS(self):
70057005
'': [],
70067006
'minimal_runtime': ['-sMINIMAL_RUNTIME=1']
70077007
})
7008+
@no_wasm2js('wasm2js incompatible with Bigint')
70087009
def test_dyncall_specific(self, *args):
70097010
if self.get_setting('MEMORY64'):
70107011
self.skipTest('not compatible with MEMORY64')
@@ -8428,6 +8429,7 @@ def test_wasm2js(self):
84288429
if self.is_wasm2js():
84298430
self.skipTest('redundant to test wasm2js in wasm2js* mode')
84308431
self.set_setting('WASM', 0)
8432+
self.set_setting('WASM_BIGINT', 0)
84318433
self.do_core_test('test_hello_world.c')
84328434
self.assertNotExists('test_hello_world.js.mem')
84338435

test/test_other.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12902,7 +12902,7 @@ def test_wasm2js_no_dylink(self):
1290212902
self.assertContained('WASM2JS is not compatible with relocatable output', err)
1290312903

1290412904
def test_wasm2js_standalone(self):
12905-
self.do_run_in_out_file_test('hello_world.c', emcc_args=['-sSTANDALONE_WASM', '-sWASM=0'])
12905+
self.do_run_in_out_file_test('hello_world.c', emcc_args=['-sSTANDALONE_WASM', '-sWASM=0', '-sWASM_BIGINT=0'])
1290612906

1290712907
def test_oformat(self):
1290812908
self.run_process([EMCC, test_file('hello_world.c'), '--oformat=wasm', '-o', 'out.foo'])

tools/link.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,11 +797,13 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
797797
settings.WASM2JS = 1
798798
# Wasm bigint doesn't make sense with wasm2js, since it controls how the
799799
# wasm and JS interact.
800-
if settings.WASM_BIGINT:
801-
exit_with_error('WASM_BIGINT is not compatible with WASM=0')
800+
settings.WASM_BIGINT = 0
801+
feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION)
802802
if settings.WASM == 2:
803803
# Requesting both Wasm and Wasm2JS support
804804
settings.WASM2JS = 1
805+
settings.WASM_BIGINT = 0
806+
feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION)
805807

806808
if options.oformat == OFormat.WASM and not settings.SIDE_MODULE:
807809
# if the output is just a wasm file, it will normally be a standalone one,
@@ -1764,7 +1766,7 @@ def get_full_import_name(name):
17641766
exit_with_error('wasm2js does not support source maps yet (debug in wasm for now)')
17651767
if settings.MEMORY64:
17661768
exit_with_error('wasm2js does not support MEMORY64')
1767-
if settings.WASM_BIGINT and 'WASM_BIGINT' in user_settings:
1769+
if settings.WASM_BIGINT:
17681770
exit_with_error('wasm2js does not support WASM_BIGINT')
17691771
if settings.CAN_ADDRESS_2GB:
17701772
exit_with_error('wasm2js does not support >2gb address space')

0 commit comments

Comments
 (0)