Skip to content

Remove LLD_REPORT_UNDEFINED setting #18342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ See docs/process.md for more on how version tagging works.
3.1.33 (in development)
-----------------------
- Update SDL2_ttf port to 2.20.2 (#18804)
- The `LLD_REPORT_UNDEFINED` setting has been removed. It's now essentially
always enabled. (#18342)

3.1.32 - 02/17/23
-----------------
Expand Down
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
9 changes: 1 addition & 8 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1935,14 +1935,6 @@ var USE_OFFSET_CONVERTER = false;
// This is enabled automatically when using -gsource-map with sanitizers.
var LOAD_SOURCE_MAP = false;

// If set to 0, delay undefined symbol report until after wasm-ld runs. This
// avoids running the JS compiler prior to wasm-ld, but reduces the amount
// of information in the undefined symbol message (Since JS compiler cannot
// report the name of the object file that contains the reference to the
// undefined symbol).
// [link]
var LLD_REPORT_UNDEFINED = true;

// Default to c++ mode even when run as `emcc` rather then `emc++`.
// When this is disabled `em++` is required when compiling and linking C++
// programs. This which matches the behaviour of gcc/g++ and clang/clang++.
Expand Down Expand Up @@ -2188,4 +2180,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], 'Disabling is 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