Open calvin2021y opened 3 months ago
it looks like you're trying to run an emscripten module. wabt is only a wasm engine, not a full wasm runtime, and definitely not an emscripten runtime. however, if you can get a pure-wasi module instead, you can try compiling wabt with wasi support.
I use WASI sdk with --target=wasm32-wasi -mllvm -wasm-enable-sjlj
, not emscripten
.
oh, in that case, you may be missing wasi-libc?
do you mean link step or runtime step?
I static link with wasi-libc libc.a
it's trying to import stuff that's not provided by wasi. check wasm-objdump.
It use setjmp provide by wasi.
is wasm-interp support setjmp?
wasi doesn't provide setjmp
saveSetjmp
is the name of a function that LLVM used to call prior to https://github.com/llvm/llvm-project/pull/84137.
Starting with LLVM 19 you should see __wasm_setjmp
and __wasm_setjmp_test
instead.
Support for these symbols was added to wasi-libc in https://github.com/WebAssembly/wasi-libc/pull/483 which is part of wasi-sdk-22, but it looks like there is no version of wasi-sdk yet that includes LLVM 19, so there is not yet an official version of wasi-sdk that supports sjlj. I think this is because LLVM 19 has not yet actually been released.
Anyway, none of this has anything to do with wabt.. so I think this issue can be closed.
wasm-interp --enable-exceptions test