From 085718ec6f05a488fa29cf1a7ceba8af829b420d Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 7 Dec 2022 13:56:07 -0800 Subject: [PATCH] Remove LLD_REPORT_UNDEFINED setting This setting became the default in #16003 and there is no reason to keep it around anymore. --- emcc.py | 2 +- emscripten.py | 2 +- src/jsifier.js | 3 --- src/settings.js | 1 + test/test_core.py | 5 ----- test/test_other.py | 15 --------------- 6 files changed, 3 insertions(+), 25 deletions(-) diff --git a/emcc.py b/emcc.py index ae1db63c9b057..222547aace2fc 100755 --- a/emcc.py +++ b/emcc.py @@ -3075,7 +3075,7 @@ def phase_link(linker_arguments, wasm_target): # fastcomp deferred linking opts. # TODO: we could check if this is a fastcomp build, and still speed things up here js_syms = None - if settings.LLD_REPORT_UNDEFINED and settings.ERROR_ON_UNDEFINED_SYMBOLS and not settings.SIDE_MODULE: + if settings.ERROR_ON_UNDEFINED_SYMBOLS and not settings.SIDE_MODULE: js_syms = get_all_js_syms() building.link_lld(linker_arguments, wasm_target, external_symbols=js_syms) diff --git a/emscripten.py b/emscripten.py index 989aa6edf9c91..fcf545e0242d7 100644 --- a/emscripten.py +++ b/emscripten.py @@ -239,7 +239,7 @@ def report_missing_symbols(js_symbols): if settings.EXPECT_MAIN and 'main' not in settings.WASM_EXPORTS and '__main_argc_argv' not in settings.WASM_EXPORTS: # For compatibility with the output of wasm-ld we use the same wording here in our - # error message as if wasm-ld had failed (i.e. in LLD_REPORT_UNDEFINED mode). + # error message as if wasm-ld had failed. exit_with_error('entry symbol not defined (pass --no-entry to suppress): main') diff --git a/src/jsifier.js b/src/jsifier.js index a05dc93c846d5..c80e2a42997fe 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -278,9 +278,6 @@ function ${name}(${args}) { if (dependent) msg += ` (referenced by ${dependent})`; if (ERROR_ON_UNDEFINED_SYMBOLS) { error(msg); - if (dependent == TOP_LEVEL && !LLD_REPORT_UNDEFINED) { - warnOnce('Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols'); - } warnOnce('To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`'); warnOnce(mangled + ' may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library'); } else if (VERBOSE || WARN_ON_UNDEFINED_SYMBOLS) { diff --git a/src/settings.js b/src/settings.js index 9a60fc4e62505..3170f6d438e5f 100644 --- a/src/settings.js +++ b/src/settings.js @@ -2188,4 +2188,5 @@ var LEGACY_SETTINGS = [ ['LIBRARY_DEPS_TO_AUTOEXPORT', [[]], 'No longer needed'], ['EMIT_EMSCRIPTEN_METADATA', [0], 'No longer supported'], ['SHELL_FILE', [''], 'No longer supported'], + ['LLD_REPORT_UNDEFINED', [1], 'No longer supported'], ]; diff --git a/test/test_core.py b/test/test_core.py index 76a6f82d38f3c..89eaf39909cb2 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -4223,11 +4223,6 @@ def test_dylink_basics_no_modify(self): self.set_setting('ERROR_ON_WASM_CHANGES_AFTER_LINK') self.do_basic_dylink_test() - @needs_dylink - def test_dylink_basics_no_lld_report_undefined(self): - self.set_setting('LLD_REPORT_UNDEFINED', 0) - self.do_basic_dylink_test() - @needs_dylink def test_dylink_no_export(self): self.set_setting('NO_DECLARE_ASM_MODULE_EXPORTS') diff --git a/test/test_other.py b/test/test_other.py index 82aa3c966fc32..06168bbccf3db 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -11037,21 +11037,6 @@ def test_signature_mismatch(self): self.expect_fail([EMCC, '-Wl,--fatal-warnings', 'a.c', 'b.c']) self.expect_fail([EMCC, '-sSTRICT', 'a.c', 'b.c']) - # TODO(sbc): Remove these tests once we remove the LLD_REPORT_UNDEFINED - def test_lld_report_undefined(self): - create_file('main.c', 'void foo(); int main() { foo(); return 0; }') - stderr = self.expect_fail([EMCC, '-sLLD_REPORT_UNDEFINED=0', 'main.c']) - self.assertContained('error: undefined symbol: foo (referenced by top-level compiled C/C++ code)', stderr) - - def test_lld_report_undefined_reverse_deps(self): - self.run_process([EMCC, '-sLLD_REPORT_UNDEFINED=0', '-sREVERSE_DEPS=all', test_file('hello_world.c')]) - - def test_lld_report_undefined_exceptions(self): - self.run_process([EMXX, '-sLLD_REPORT_UNDEFINED=0', '-fwasm-exceptions', test_file('hello_libcxx.cpp')]) - - def test_lld_report_undefined_main_module(self): - self.run_process([EMCC, '-sLLD_REPORT_UNDEFINED=0', '-sMAIN_MODULE=2', test_file('hello_world.c')]) - # Verifies that warning messages that Closure outputs are recorded to console def test_closure_warnings(self): # Default should be no warnings