Would you mind opening a bug report with reproduction instructions?
One thing to node is that EM_JS / EM_ASYNC_JS functions so have slightly
different linkage to normal functions. If you create a pass-through
wrapper from `addPersistentDirsInt` as a normal C function does that fix
the issue?
```
EM_ASYNC_JS(void,__addPersistentDirsInt,(),...);
void addPersistentDirsInt() {
__addPersistentDirsInt()
}
```
cheers,
sam
On Mon, Jan 26, 2026 at 9:09 AM 'leopatras' via emscripten-discuss <
[email protected]> wrote:
> I have an emscripten project which relies on the -sASYNCIFY features.
> Trying to compile it with fsanitize=address as additional argument to
> reveal problems fails because the functions wrapped with the EM_ASYNC_JS macro
> are then not seen by the compiler anymore.
>
> I have a function addPersistentDirs exposed via the EM_ASYNC_JS macro
> EM_ASYNC_JS(void,addPersistentDirsInt,(),...
>
> and the compiler raises
>
> error: undefined symbol: addPersistentDirsInt (referenced by root
> reference (e.g. compiled C/C++ code)) warning: To disable errors for
> undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0` warning:
> _addPersistentDirsInt may need to be added to EXPORTED_FUNCTIONS if it
> arrives from a system library Error: Aborting compilation due to previous
> errors at finalCombiner
> (file:///Users/leo/w/github/emsdk/upstream/emscripten/src/jsifier.mjs:889:13)
> at Module.runJSify
> (file:///Users/leo/w/github/emsdk/upstream/emscripten/src/jsifier.mjs:925:5)
> at
> file:///Users/leo/w/github/emsdk/upstream/emscripten/tools/compiler.mjs:108:17
> emcc: error: '/Users/leo/w/github/emsdk/node/20.18.0_64bit/bin/node
> /Users/leo/w/github/emsdk/upstream/emscripten/tools/compiler.mjs -' failed
> (returned 1)
>
> my compilation flags are
>
> emcc -O2 --pre-js pre.js -s MAIN_MODULE=1 -s FORCE_FILESYSTEM=1 -s
> EXPORT_ALL=1 -s ASSERTIONS=1 -s STACK_SIZE=200000 -s ASYNCIFY -s
> ASYNCIFY_STACK_SIZE=200000 -s MAXIMUM_MEMORY=4GB -s STACK_OVERFLOW_CHECK=2
> -s EXIT_RUNTIME=1 -s ALLOW_MEMORY_GROWTH=1 -lidbfs.js -lproxyfs.js
> -fsanitize=address main.c -o main.html
>
> Is asyncify not supported when building with fsanitize=address ? I can't
> find a notion about that in the docs.
>
> Compiling with -fsanitize=leak is fine btw.
>
> Regards, Leo
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/emscripten-discuss/4524cf56-c8c7-4ed4-bb2d-ecedae8164dcn%40googlegroups.com
> <https://groups.google.com/d/msgid/emscripten-discuss/4524cf56-c8c7-4ed4-bb2d-ecedae8164dcn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va28Bbz6DC60kA3v1OcBr4cX5F82ZsYxzJUN9K33N8-V%2BPg%40mail.gmail.com.