Skip to content

Commit b0777e2

Browse files
committed
Fix missing dependencies in sanitizer builds. NFC
This change reverts part of emscripten-core#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 2b0980d commit b0777e2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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)