Skip to content

Commit ceee49d

Browse files
authored
Fix missing dependencies in sanitizer builds. NFC (#22650)
This change reverts part of #22596. A better fix for this would be to add the missing deps to `--symbols-only` but this change seems like the quickest fix.
1 parent b7c1126 commit ceee49d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,8 @@ jobs:
519519
lsan.test_stdio_locking
520520
lsan.test_dlfcn_basic
521521
lsan.test_pthread_create
522-
lsan.test_pthread_exit_main_stub"
522+
lsan.test_pthread_exit_main_stub
523+
ubsan.test_externref_emjs_dynlink"
523524
- freeze-cache
524525
- run-tests:
525526
# also run a single test of EMTEST_BROWSER=node.

tools/link.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,19 @@ def phase_linker_setup(options, state, newargs):
15221522

15231523
if sanitize:
15241524
settings.USE_OFFSET_CONVERTER = 1
1525+
# These symbols are needed by `withBuiltinMalloc` which used to implement
1526+
# the `__noleakcheck` attribute. However this dependency is not yet represented in the JS
1527+
# symbol graph generated when we run the compiler with `--symbols-only`.
1528+
settings.REQUIRED_EXPORTS += [
1529+
'malloc',
1530+
'calloc',
1531+
'memalign',
1532+
'free',
1533+
'emscripten_builtin_malloc',
1534+
'emscripten_builtin_calloc',
1535+
'emscripten_builtin_memalign',
1536+
'emscripten_builtin_free',
1537+
]
15251538

15261539
if ('leak' in sanitize or 'address' in sanitize) and not settings.ALLOW_MEMORY_GROWTH:
15271540
# Increase the minimum memory requirements to account for extra memory

0 commit comments

Comments
 (0)