Skip to content

Commit 9a489b0

Browse files
authored
Honor -Wl,--no-fatal-warnings, even in strict mode. (#22255)
Fixes: #22253
1 parent 6cf4672 commit 9a489b0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/test_other.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12154,7 +12154,11 @@ def test_signature_mismatch(self):
1215412154
stderr = self.run_process([EMCC, 'a.c', 'b.c'], stderr=PIPE).stderr
1215512155
self.assertContained('function signature mismatch: foo', stderr)
1215612156
self.expect_fail([EMCC, '-Wl,--fatal-warnings', 'a.c', 'b.c'])
12157+
# STRICT mode implies fatal warnings
1215712158
self.expect_fail([EMCC, '-sSTRICT', 'a.c', 'b.c'])
12159+
# Unless `--no-fatal-warnings` is explictly passed
12160+
stderr = self.run_process([EMCC, '-sSTRICT', '-Wl,--no-fatal-warnings', 'a.c', 'b.c'], stderr=PIPE).stderr
12161+
self.assertContained('function signature mismatch: foo', stderr)
1215812162

1215912163
# Verifies that warning messages that Closure outputs are recorded to console
1216012164
def test_closure_warnings(self):

tools/building.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def link_lld(args, target, external_symbols=None):
264264
args.insert(0, '--whole-archive')
265265
args.append('--no-whole-archive')
266266

267-
if settings.STRICT:
267+
if settings.STRICT and '--no-fatal-warnings' not in args:
268268
args.append('--fatal-warnings')
269269

270270
if any(a in args for a in ('--strip-all', '-s')):

0 commit comments

Comments
 (0)