You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: This is a follow-up to #23272 because it was closed.
When enabling the JSPI flag and attempting to emit Typescript definitions (via --emit-tsd), the build fails. Since we disable Asyncify the library_async is not included and the linker complains about missing emscripten_sleep() function.
# This command is executed by CMake
em++ -gsource-map \
-lembind \
--emit-tsd test1.d.ts \ # It works without this line
-s EXPORT_NAME=Test1Module \
-s JSPI \
-s STRICT \
-s USE_ES6_IMPORT_META \
-s MODULARIZE \
-s EXPORT_ES6=1 \
--no-entry \
test1.cpp.o \
-o test1.js
Full link command and output with -v appended:
>[email protected] cmake:build
>cd build.em && make
-- Configuring done (1.2s)
-- Generating done (0.0s)
-- Build files have been written to: /root/workspace/emscripten-jspi-demo/build.em
[ 33%] Building CXX object CMakeFiles/test1.dir/src/wasm/calc.cpp.o
[ 66%] Building CXX object CMakeFiles/test1.dir/src/wasm/test1.cpp.o
[100%] Linking CXX executable test1.js
em++: warning: -sASYNCIFY=2 (JSPI) is still experimental [-Wexperimental]
error: undefined symbol: emscripten_sleep (referenced by root reference (e.g. compiled C/C++ code))
warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
warning: _emscripten_sleep may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
em++: error: '/root/workspace/emsdk/node/20.18.0_64bit/bin/node /root/workspace/emsdk/upstream/emscripten/src/compiler.mjs /tmp/tmpyi_gjmeb.json' failed (returned 1)
make[2]: *** [CMakeFiles/test1.dir/build.make:114: test1.js] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/test1.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
The text was updated successfully, but these errors were encountered:
We could either 1) require a compatible node version and keep JSPI enabled, 2) still link in library_async.js 3) make it so the JSPI feature detection only runs when an JSPI'd function is called. I don't really like any of those options, but 1 is probably the easiest. Unfortunately, we'll need a very current node to run with with the latest JSPI.
Version of emscripten/emsdk:
Issue:
This is a follow-up to #23272 because it was closed.
When enabling the JSPI flag and attempting to emit Typescript definitions (via --emit-tsd), the build fails. Since we disable Asyncify the
library_async
is not included and the linker complains about missingemscripten_sleep()
function.Demo to reproduce: https://github.com/mroohian/emscripten-jspi-demo
Failing command line in full:
Full link command and output with
-v
appended:The text was updated successfully, but these errors were encountered: