Skip to content

Commit

Permalink
Remove LLD_REPORT_UNDEFINED setting
Browse files Browse the repository at this point in the history
This setting became the default in #16003 and there is no reason to
keep it around anymore.
  • Loading branch information
sbc100 committed Feb 24, 2023
1 parent 65f36f3 commit 085718e
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')


Expand Down
3 changes: 0 additions & 3 deletions src/jsifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
];
5 changes: 0 additions & 5 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
15 changes: 0 additions & 15 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 085718e

Please sign in to comment.