Skip to content

Commit 8ec8132

Browse files
authored
Handle -s alias for for --strip-all linker flag (#20875)
1 parent 86eacff commit 8ec8132

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/test_other.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14224,6 +14224,7 @@ def test_strip_all(self):
1422414224
# Test that even with `-Wl,--strip-all` the target features section is generated
1422514225
# by wasm-ld so that later phases (e.g. wasm-opt) can read it.
1422614226
self.do_runf('hello_world.c', emcc_args=['-Wl,--strip-all', '-pthread'])
14227+
self.do_runf('hello_world.c', emcc_args=['-Wl,-s', '-pthread'])
1422714228

1422814229
def test_embind_no_duplicate_symbols(self):
1422914230
# Embind implementation lives almost entirely in headers, which have special rules

tools/building.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ def link_lld(args, target, external_symbols=None):
270270
if settings.STRICT:
271271
args.append('--fatal-warnings')
272272

273-
if '--strip-all' in args:
274-
# Tell wasm-ld to always generate a target_features section even if --strip-all
273+
if any(a in args for a in ('--strip-all', '-s')):
274+
# Tell wasm-ld to always generate a target_features section even if --strip-all/-s
275275
# is passed.
276276
args.append('--keep-section=target_features')
277277

0 commit comments

Comments
 (0)