Skip to content

Commit 507d31f

Browse files
authored
Fix lsan.test_dylink_iostream after #25449 (#25474)
This failure was causing the emscripten-reeleases roller to fail. The code didn't take into about that system_libs could also contains flags such as `--whole-archive`. In this particular test the value of `system_libs` is: ``` ['-lGL-getprocaddr', '-lal', '-lhtml5', '-lstubs-debug', '-lc-debug', '-ldlmalloc-debug', '-lcompiler_rt', '--whole-archive', '-lc++-debug-noexcept', '--no-whole-archive', '-lc++abi-debug-noexcept', '-lsockets', '--whole-archive', '-llsan_rt', '--no-whole-archive', '-llsan_common_rt', '-lsanitizer_common_rt'] ``` Fixes: #25472
1 parent 13810f8 commit 507d31f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ jobs:
661661
lsan.test_dlfcn_basic
662662
lsan.test_pthread_create
663663
lsan.test_pthread_exit_main_stub
664+
lsan.test_dylink_iostream
664665
ubsan.test_externref_emjs_dynlink"
665666
- freeze-cache
666667
- run-tests:

tools/link.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3096,8 +3096,9 @@ def run(options, linker_args):
30963096
# This is not normally a problem except in the case of -sMAIN_MODULE=1 where
30973097
# the duplicate library would result in duplicate symbols.
30983098
for s in system_libs:
3099-
if s not in linker_args:
3100-
linker_args.append(s)
3099+
if s.startswith('-l') and s in linker_args:
3100+
continue
3101+
linker_args.append(s)
31013102

31023103
js_syms = {}
31033104
if (not settings.SIDE_MODULE or settings.ASYNCIFY) and not shared.SKIP_SUBPROCS:

0 commit comments

Comments
 (0)