Skip to content

Commit 6334959

Browse files
authored
Fix EXPORT_ALL with wasm backend (#7310)
The semantics of EXPORT_ALL are not that we should avoid doing any GC but rather that any symbols that survive GC should be exported.
1 parent f00d4ae commit 6334959

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/shared.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,11 +1918,10 @@ def link_lld(args, target, opts=[], lto_level=0):
19181918
# if Settings.DEBUG_LEVEL < 2 and not Settings.PROFILING_FUNCS:
19191919
# cmd.append('--strip-debug')
19201920

1921+
for export in expand_response(Settings.EXPORTED_FUNCTIONS):
1922+
cmd += ['--export', export[1:]] # Strip the leading underscore
19211923
if Settings.EXPORT_ALL:
1922-
cmd += ['--no-gc-sections', '--export-all']
1923-
else:
1924-
for export in expand_response(Settings.EXPORTED_FUNCTIONS):
1925-
cmd += ['--export', export[1:]] # Strip the leading underscore
1924+
cmd += ['--export-all']
19261925

19271926
logging.debug('emcc: lld-linking: %s to %s', args, target)
19281927
check_call(cmd)

0 commit comments

Comments
 (0)