File tree 3 files changed +9
-4
lines changed
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ See docs/process.md for more on how version tagging works.
40
40
example, ` -sEXPORTED_RUNTIME_METHODS=HEAP8,HEAPU32 ` (if you need ` HEAP8 ` and
41
41
` HEAPU32 ` ). (#24079 )
42
42
- libjpeg port updated from 9c to 9f. (#24085 )
43
+ - Missing exports in EXPORTED_RUNTIME_METHODS will now error instead of warn.
43
44
44
45
4.0.6 - 03/26/25
45
46
----------------
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import {
13
13
isJsOnlySymbol ,
14
14
error ,
15
15
readFile ,
16
- warn ,
17
16
pushCurrentFile ,
18
17
popCurrentFile ,
19
18
printErr ,
@@ -512,11 +511,11 @@ function exportRuntimeSymbols() {
512
511
}
513
512
}
514
513
515
- // check all exported things exist, warn about typos
514
+ // check all exported things exist, error when missing
516
515
runtimeElementsSet = new Set ( runtimeElements ) ;
517
516
for ( const name of EXPORTED_RUNTIME_METHODS ) {
518
517
if ( ! runtimeElementsSet . has ( name ) ) {
519
- warn ( `invalid item in EXPORTED_RUNTIME_METHODS: ${ name } `) ;
518
+ error ( `undefined exported symbol: " ${ name } " in EXPORTED_RUNTIME_METHODS `) ;
520
519
}
521
520
}
522
521
Original file line number Diff line number Diff line change @@ -2708,6 +2708,11 @@ def test_undefined_exported_function(self, outfile):
2708
2708
cmd += ['-Wno-undefined']
2709
2709
self.run_process(cmd)
2710
2710
2711
+ def test_undefined_exported_runtime_method(self):
2712
+ # Adding a missing symbol to EXPORTED_RUNTIME_METHODS should cause a failure
2713
+ err = self.expect_fail([EMCC, '-sEXPORTED_RUNTIME_METHODS=foobar', test_file('hello_world.c')])
2714
+ self.assertContained('undefined exported symbol: "foobar" in EXPORTED_RUNTIME_METHODS', err)
2715
+
2711
2716
@parameterized({
2712
2717
'': ('out.js',),
2713
2718
'standalone': ('out.wasm',)
@@ -14424,7 +14429,7 @@ def test_legacy_runtime(self):
14424
14429
self.clear_setting('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE')
14425
14430
for opt in ('-O0', '-O3'):
14426
14431
err = self.expect_fail([EMCC, test_file('other/test_legacy_runtime.c'), opt] + self.get_emcc_args())
14427
- self.assertContained('invalid item in EXPORTED_RUNTIME_METHODS: allocate', err)
14432
+ self.assertContained('undefined exported symbol: " allocate" in EXPORTED_RUNTIME_METHODS ', err)
14428
14433
14429
14434
def test_fetch_settings(self):
14430
14435
create_file('pre.js', '''
You can’t perform that action at this time.
0 commit comments