Skip to content
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

Exception support: Compatibility with LLVM 17 #3087

Open
fredldotme opened this issue Jan 26, 2024 · 3 comments
Open

Exception support: Compatibility with LLVM 17 #3087

fredldotme opened this issue Jan 26, 2024 · 3 comments
Labels
done The feature/issue was implemented/resolved exception handling

Comments

@fredldotme
Copy link
Contributor

fredldotme commented Jan 26, 2024

The problem:

WAMR with its current exception-handling branch has some support for it but various things happened in the meantime: new proposals getting made, and probably implemented.

So much so that the current LLVM 17 upstream stable is unable to function properly as a compilation toolchain for exception-handling support, not even with this fork of it: https://github.com/fredldotme/llvm-project

How to test:

  • Build and check out this repository on Linux or macOS: https://github.com/fredldotme/Tide
  • Manual intervention: Enable EXCEPTION=ON in bootstrap.sh
  • Bootstrap the environment with this script

Invoking bash bootstrap.sh on macOS/bash boostrap.sh --linux on GNU/Linux should then lead you to getting a full Clang environment set up that is able to build WASI using CMake (without Emscripten).

The status quo:

Right now running two binaries creates two different results, both failing in proper exception handling:

  • { printf("Hello\n"); throw; } results in an exception from the WAMR environment rather than the WASM binary
  • More sophisticated C++ linking against libcxx{,abi} might cause it to get code emitted which has unknown label errors thrown at WAMR runtime.
@wenyongh
Copy link
Contributor

Hi, @yamt, I found that you wanted to help look into this issue (#1884 (comment)) and had submitted several PRs before, eg. #3106, #3107, not sure whether the issue is resolved now? Thanks.

@yamt
Copy link
Collaborator

yamt commented Apr 26, 2024

Hi, @yamt, I found that you wanted to help look into this issue (#1884 (comment)) and had submitted several PRs before, eg. #3106, #3107, not sure whether the issue is resolved now? Thanks.

it certainly has a better chance to work than before.
at least i'm sure trivial cases compiled with LLVM 17 work.

@fredldotme can you confirm if/when you have time? thank you.

@fredldotme
Copy link
Contributor Author

I have indeed been able to compile and run code with exceptions on my Clang iPad enablement branch and execute it using WAMR on the tablet itself! Great job! I was wondering about more sophisticated test cases but when I encounter them I surely would like to report them.

@wenyongh wenyongh added the done The feature/issue was implemented/resolved label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done The feature/issue was implemented/resolved exception handling
Projects
None yet
Development

No branches or pull requests

3 participants