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 @@ -43,6 +43,7 @@ See docs/process.md for more on how version tagging works.
43
43
example, ` -sEXPORTED_RUNTIME_METHODS=HEAP8,HEAPU32 ` (if you need ` HEAP8 ` and
44
44
` HEAPU32 ` ). (#24079 )
45
45
- libjpeg port updated from 9c to 9f. (#24085 )
46
+ - Missing exports in EXPORTED_RUNTIME_METHODS will now error instead of warn.
46
47
47
48
4.0.6 - 03/26/25
48
49
----------------
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 @@ -2698,6 +2698,11 @@ def test_undefined_exported_function(self, outfile):
2698
2698
cmd += ['-Wno-undefined']
2699
2699
self.run_process(cmd)
2700
2700
2701
+ def test_undefined_exported_runtime_method(self):
2702
+ # Adding a missing symbol to EXPORTED_RUNTIME_METHODS should cause a failure
2703
+ err = self.expect_fail([EMCC, '-sEXPORTED_RUNTIME_METHODS=foobar', test_file('hello_world.c')])
2704
+ self.assertContained('undefined exported symbol: "foobar" in EXPORTED_RUNTIME_METHODS', err)
2705
+
2701
2706
@parameterized({
2702
2707
'': ('out.js',),
2703
2708
'standalone': ('out.wasm',)
@@ -14528,7 +14533,7 @@ def test_legacy_runtime(self):
14528
14533
self.clear_setting('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE')
14529
14534
for opt in ('-O0', '-O3'):
14530
14535
err = self.expect_fail([EMCC, test_file('other/test_legacy_runtime.c'), opt] + self.get_emcc_args())
14531
- self.assertContained('invalid item in EXPORTED_RUNTIME_METHODS: allocate', err)
14536
+ self.assertContained('undefined exported symbol: " allocate" in EXPORTED_RUNTIME_METHODS ', err)
14532
14537
14533
14538
def test_fetch_settings(self):
14534
14539
create_file('pre.js', '''
You can’t perform that action at this time.
0 commit comments