diff --git a/.circleci/config.yml b/.circleci/config.yml index 013f1effe8f33..5db4671115737 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -519,7 +519,8 @@ jobs: lsan.test_stdio_locking lsan.test_dlfcn_basic lsan.test_pthread_create - lsan.test_pthread_exit_main_stub" + lsan.test_pthread_exit_main_stub + ubsan.test_externref_emjs_dynlink" - freeze-cache - run-tests: # also run a single test of EMTEST_BROWSER=node. diff --git a/tools/link.py b/tools/link.py index 7b14a75e7cf7e..b7cb3c77ddccb 100644 --- a/tools/link.py +++ b/tools/link.py @@ -1522,6 +1522,19 @@ def phase_linker_setup(options, state, newargs): if sanitize: settings.USE_OFFSET_CONVERTER = 1 + # These symbols are needed by `withBuiltinMalloc` which used to implement + # the `__noleakcheck` attribute. However this dependency is not yet represented in the JS + # symbol graph generated when we run the compiler with `--symbols-only`. + settings.REQUIRED_EXPORTS += [ + 'malloc', + 'calloc', + 'memalign', + 'free', + 'emscripten_builtin_malloc', + 'emscripten_builtin_calloc', + 'emscripten_builtin_memalign', + 'emscripten_builtin_free', + ] if ('leak' in sanitize or 'address' in sanitize) and not settings.ALLOW_MEMORY_GROWTH: # Increase the minimum memory requirements to account for extra memory