Open SanderVocke opened 1 year ago
Wasmer does not support the Exception extension for now. That's why you don't see --enable-exceptions
on the CLI indeed.
I am not aware on any mecanism to have a _Unwind_RaiseException
with asyncify
. WASIX does support setjmp(...)
and longjmp(...)
, so it might be enough to implement exception? I'm unsure how emscripten impleted them.
I have spent quite some time trying to build a libc++ with exception handling enabled against
wasix-libc
.Eventually I concluded I could not get it done, and based on the information I could find I am not even sure that the
Wasmer
runtime would support it at all (I don't see anenable-exceptions
CLI option).What I eventually got stuck on is that in
libc++abi
, there is no_Unwind_RaiseException
symbol available, even when built with-fwasm-exceptions
. I figured such a symbol should be provided bylibunwind
, but LLVM'slibunwind
does not seem to accept wasm as a target architecture.Apparently,
emscripten
has a workinglibunwind
, but I am guessing this one wouldn't be possible to get running in pure WASM.I also noticed that the examples Makefile of this repo uses
asyncify
viabinaryen
, to somehow make stack unwinding possible. I don't know how that works, but could there maybe be a possibility to build a workinglibunwind
on top of this stack unwinding principle? Maybe it could even be used to implement exception handling via SJLJ without using native WASM instructions?It seems to me like the pieces to the puzzle are there and we are possibly quite close to exception support via
WASIX
or even viaWASI
's exception proposal withoutWASIX
required. I hope you can shed some light on the situation as the available info is very scattered at the moment.