-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Considering support setjmp & longjmp? #109
Comments
OK. Though I think setjmp/longjmp is out of the scope of emnapi, I'll investigate how it works in WASIX and Emscripten, then consider providing prebuilt static library as temporary solution before wasi-libc have it. Happy dragon new year! |
WASIX and kripken's demo rely on the Asyncify feature of binaryen, which will affect runtime performance and increases code size. Emscripten has two implementations of setjmp/longjmp, the default way relies on generated JavaScript glue code by emcc, the other relies on WebAssembly Exception Handling feature, they both require passing additional flags to llvm backend to let llvm transform the I've created a separate repository (https://github.com/toyobayashi/wasm-sjlj) to test if the wasm EH way works in WASI, included the prebuilt libraries. I used the implementation in emscripten repo, and pass Refs:
Could you try it to build libavif? |
@toyobayashi it works! thanks for your help! |
Can you publish a npm package that contains |
setjmp.h
is not supported inwasi-libc
at this moment: WebAssembly/wasi-libc#432If you could support
setjmp.h
in emnapi, it would be very useful for C++ projects compiled to wasi target, such as https://github.com/AOMediaCodec/libavif.For references:
setjmp.h
here: https://github.com/wasix-org/wasix-libc/blob/main/libc-bottom-half/sources/__wasilibc_stack.cThe text was updated successfully, but these errors were encountered: