@@ -2167,8 +2167,8 @@ def test_undefined_symbols(self, action):
2167
2167
print (proc .stderr )
2168
2168
if value or action is None :
2169
2169
# The default is that we error in undefined symbols
2170
- self .assertContained ('error: undefined symbol: something' , proc .stderr )
2171
- self .assertContained ('error: undefined symbol: elsey' , proc .stderr )
2170
+ self .assertContained ('undefined symbol: something' , proc .stderr )
2171
+ self .assertContained ('undefined symbol: elsey' , proc .stderr )
2172
2172
check_success = False
2173
2173
elif action == 'ERROR' and not value :
2174
2174
# Error disables, should only warn
@@ -3548,7 +3548,7 @@ def test_js_lib_missing_sig(self):
3548
3548
def test_js_lib_quoted_key (self ):
3549
3549
create_file ('lib.js' , r'''
3550
3550
mergeInto(LibraryManager.library, {
3551
- __internal_data:{
3551
+ __internal_data:{
3552
3552
'<' : 0,
3553
3553
'white space' : 1
3554
3554
},
@@ -6591,7 +6591,7 @@ def test_no_warn_exported_jslibfunc(self):
6591
6591
err = self .expect_fail ([EMCC , test_file ('hello_world.c' ),
6592
6592
'-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=alGetError' ,
6593
6593
'-sEXPORTED_FUNCTIONS=_main,_alGet' ])
6594
- self .assertContained ('undefined exported symbol: "_alGet"' , err )
6594
+ self .assertContained ('error: undefined exported symbol: "_alGet" [-Wundefined] [-Werror] ' , err )
6595
6595
6596
6596
def test_musl_syscalls (self ):
6597
6597
self .run_process ([EMCC , test_file ('hello_world.c' )])
@@ -8361,7 +8361,7 @@ def test_full_js_library(self):
8361
8361
def test_full_js_library_undefined (self ):
8362
8362
create_file ('main.c' , 'void foo(); int main() { foo(); return 0; }' )
8363
8363
err = self .expect_fail ([EMCC , 'main.c' , '-sSTRICT_JS' , '-sINCLUDE_FULL_LIBRARY' ])
8364
- self .assertContained ('error: undefined symbol: foo' , err )
8364
+ self .assertContained ('undefined symbol: foo' , err )
8365
8365
8366
8366
def test_full_js_library_except (self ):
8367
8367
self .set_setting ('INCLUDE_FULL_LIBRARY' , 1 )
@@ -9017,19 +9017,20 @@ def test_js_preprocess(self):
9017
9017
9018
9018
err = self .run_process ([EMCC , test_file ('hello_world.c' ), '--js-library' , 'lib.js' ], stderr = PIPE ).stderr
9019
9019
self .assertContained ('JSLIB: none of the above' , err )
9020
- self .assertEqual (err .count ('JSLIB' ), 1 )
9020
+ self .assertNotContained ('JSLIB: MAIN_MODULE' , err )
9021
+ self .assertNotContained ('JSLIB: EXIT_RUNTIME' , err )
9021
9022
9022
9023
err = self .run_process ([EMCC , test_file ('hello_world.c' ), '--js-library' , 'lib.js' , '-sMAIN_MODULE' ], stderr = PIPE ).stderr
9023
9024
self .assertContained ('JSLIB: MAIN_MODULE=1' , err )
9024
- self .assertEqual ( err . count ( 'JSLIB' ), 1 )
9025
+ self .assertNotContained ( 'JSLIB: EXIT_RUNTIME' , err )
9025
9026
9026
9027
err = self .run_process ([EMCC , test_file ('hello_world.c' ), '--js-library' , 'lib.js' , '-sMAIN_MODULE=2' ], stderr = PIPE ).stderr
9027
9028
self .assertContained ('JSLIB: MAIN_MODULE=2' , err )
9028
- self .assertEqual ( err . count ( 'JSLIB' ), 1 )
9029
+ self .assertNotContained ( 'JSLIB: EXIT_RUNTIME' , err )
9029
9030
9030
9031
err = self .run_process ([EMCC , test_file ('hello_world.c' ), '--js-library' , 'lib.js' , '-sEXIT_RUNTIME' ], stderr = PIPE ).stderr
9031
9032
self .assertContained ('JSLIB: EXIT_RUNTIME' , err )
9032
- self .assertEqual ( err . count ( 'JSLIB' ), 1 )
9033
+ self .assertNotContained ( 'JSLIB: MAIN_MODULE' , err )
9033
9034
9034
9035
def test_html_preprocess (self ):
9035
9036
src_file = test_file ('module/test_stdin.c' )
@@ -9202,7 +9203,7 @@ def test_dash_s_list_parsing(self):
9202
9203
# stray slash
9203
9204
('EXPORTED_FUNCTIONS=["_a", "_b",\\ "_c", "_d"]' , 'undefined exported symbol: "\\ \\ "_c"' ),
9204
9205
# missing comma
9205
- ('EXPORTED_FUNCTIONS=["_a", "_b" "_c", "_d"]' , 'undefined exported symbol: "_b" "_c"' ),
9206
+ ('EXPORTED_FUNCTIONS=["_a", "_b" "_c", "_d"]' , 'emcc: error: undefined exported symbol: "_b" "_c" [-Wundefined] [-Werror] ' ),
9206
9207
]:
9207
9208
print (export_arg )
9208
9209
proc = self .run_process ([EMCC , 'src.c' , '-s' , export_arg ], stdout = PIPE , stderr = PIPE , check = not expected )
@@ -10886,20 +10887,20 @@ def test_signature_mismatch(self):
10886
10887
self .expect_fail ([EMCC , '-Wl,--fatal-warnings' , 'a.c' , 'b.c' ])
10887
10888
self .expect_fail ([EMCC , '-sSTRICT' , 'a.c' , 'b.c' ])
10888
10889
10890
+ # TODO(sbc): Remove these tests once we remove the LLD_REPORT_UNDEFINED
10889
10891
def test_lld_report_undefined (self ):
10890
10892
create_file ('main.c' , 'void foo(); int main() { foo(); return 0; }' )
10891
- stderr = self .expect_fail ([EMCC , '-sLLD_REPORT_UNDEFINED' , 'main.c' ])
10892
- self .assertContained ('wasm-ld: error:' , stderr )
10893
- self .assertContained ('main_0.o: undefined symbol: foo' , stderr )
10893
+ stderr = self .expect_fail ([EMCC , '-sLLD_REPORT_UNDEFINED=0' , 'main.c' ])
10894
+ self .assertContained ('error: undefined symbol: foo (referenced by top-level compiled C/C++ code)' , stderr )
10894
10895
10895
10896
def test_lld_report_undefined_reverse_deps (self ):
10896
- self .run_process ([EMCC , '-sLLD_REPORT_UNDEFINED' , '-sREVERSE_DEPS=all' , test_file ('hello_world.c' )])
10897
+ self .run_process ([EMCC , '-sLLD_REPORT_UNDEFINED=0 ' , '-sREVERSE_DEPS=all' , test_file ('hello_world.c' )])
10897
10898
10898
10899
def test_lld_report_undefined_exceptions (self ):
10899
- self .run_process ([EMXX , '-sLLD_REPORT_UNDEFINED' , '-fwasm-exceptions' , test_file ('hello_libcxx.cpp' )])
10900
+ self .run_process ([EMXX , '-sLLD_REPORT_UNDEFINED=0 ' , '-fwasm-exceptions' , test_file ('hello_libcxx.cpp' )])
10900
10901
10901
10902
def test_lld_report_undefined_main_module (self ):
10902
- self .run_process ([EMCC , '-sLLD_REPORT_UNDEFINED' , '-sMAIN_MODULE=2' , test_file ('hello_world.c' )])
10903
+ self .run_process ([EMCC , '-sLLD_REPORT_UNDEFINED=0 ' , '-sMAIN_MODULE=2' , test_file ('hello_world.c' )])
10903
10904
10904
10905
# Verifies that warning messages that Closure outputs are recorded to console
10905
10906
def test_closure_warnings (self ):
@@ -11037,14 +11038,12 @@ def test_linker_version(self):
11037
11038
def test_chained_js_error_diagnostics (self ):
11038
11039
err = self .expect_fail ([EMCC , test_file ('test_chained_js_error_diagnostics.c' ), '--js-library' , test_file ('test_chained_js_error_diagnostics.js' )])
11039
11040
self .assertContained ("error: undefined symbol: nonexistent_function (referenced by bar__deps: ['nonexistent_function'], referenced by foo__deps: ['bar'], referenced by top-level compiled C/C++ code)" , err )
11040
- # Check that we don't recommend LLD_REPORT_UNDEFINED for chained dependencies.
11041
- self .assertNotContained ('LLD_REPORT_UNDEFINED' , err )
11042
11041
11043
- # Test without chaining. In this case we don't include the JS library at all resulting in `foo`
11044
- # being undefined in the native code and in this case we recommend LLD_REPORT_UNDEFINED .
11042
+ # Test without chaining. In this case we don't include the JS library at
11043
+ # all resulting in `foo` being undefined in the native code .
11045
11044
err = self .expect_fail ([EMCC , test_file ('test_chained_js_error_diagnostics.c' )])
11046
- self .assertContained ('error: undefined symbol: foo (referenced by top-level compiled C/C++ code) ' , err )
11047
- self .assertContained ( 'Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols ' , err )
11045
+ self .assertContained ('undefined symbol: foo' , err )
11046
+ self .assertNotContained ( 'referenced by top-level compiled C/C++ code ' , err )
11048
11047
11049
11048
def test_xclang_flag (self ):
11050
11049
create_file ('foo.h' , ' ' )
@@ -11846,7 +11845,7 @@ def test_no_main_with_PROXY_TO_PTHREAD(self):
11846
11845
void foo() {}
11847
11846
''' )
11848
11847
err = self .expect_fail ([EMCC , 'lib.cpp' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
11849
- self .assertContained ('error: PROXY_TO_PTHREAD proxies main() for you, but no main exists ' , err )
11848
+ self .assertContained ('crt1_proxy_main.o: undefined symbol: main' , err )
11850
11849
11851
11850
def test_archive_bad_extension (self ):
11852
11851
# Regression test for https://github.com/emscripten-core/emscripten/issues/14012
@@ -11888,7 +11887,7 @@ def test_unimplemented_syscalls(self, args):
11888
11887
cmd = [EMCC , 'main.c' , '-sASSERTIONS' ] + args
11889
11888
if args :
11890
11889
err = self .expect_fail (cmd )
11891
- self .assertContained ('error : undefined symbol: __syscall_mincore' , err )
11890
+ self .assertContained ('libc-debug.a(mincore.o) : undefined symbol: __syscall_mincore' , err )
11892
11891
else :
11893
11892
self .run_process (cmd )
11894
11893
err = self .run_js ('a.out.js' )
0 commit comments