Build compiler-rt with C++ exception tag definition#603
Build compiler-rt with C++ exception tag definition#603kketch wants to merge 1 commit intoWebAssembly:mainfrom
Conversation
necesary at runtime when wasm eh is enabled
32e856a to
7dc9143
Compare
|
Thanks for the PR! I was just digging into this myself yesterday and there's been a few updates on this in the meantime. The problem here is that the exceptions-testing in CI is done with LLVM prior to 22, and this change you're running into happened in LLVM 22. This means that the exceptions-support for wasi-sdk is broken with LLVM 22, which is what the submodule in this repository contains. The "true fix" here is a PR I sent yesterday upstream to LLVM -- llvm/llvm-project#185770 -- which moves the definition of That's all basically a long way of saying -- thanks for the PR, I agree this is broken, but if you wouldn't mind I'd prefer to not land this solution. I'll try to follow-up with some submodule-patches today to get exceptions working once wasi-sdk-31 is released. |
|
Thanks, after opening this PR I noticed the exceptions test was failing locally but not on CI, that makes more sense now. |
|
#606 is the PR I wanted to make, and that should fix exceptions with LLVM 22 by including upstream patches. |
I tried compiling wasi-sdk's sysroot to build a C++ library for
wasm32-wasip1by following these instructions: https://github.com/WebAssembly/wasi-sdk/blob/main/CppExceptions.md.However when running the resulting WASM module it tries to import a non existent exception tag:
__cpp_exception.I found out that LLVM's compiler-rt also needs to be built with
-fwasm-exceptionsotherwise the compiled object does not define the__cpp_exceptiontag used for C++ exceptions.