-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
How to build libunwind for wasm? #72771
Comments
@llvm/issue-subscribers-backend-webassembly Author: cqwrteur (trcrsired)
error: "Unsupported architecture."
|
I don't think libunwind can be built for wasm, at least not in its "normal" form. IIUC it depends on being able to directly save and restore the values of the stack pointer, and that's just not possible on the wasm architecture (the underlying stack and return addresses are hidden from the wasm code). |
We only use libunwind's API structure and not really the implementation part like To prevent this kind of confusion from happening, I guess it would be better to consider wrapping |
_LIBUNWIND_CONTEXT_SIZE This macro is not defined. You are not clear on how to use this tbh |
It looks like the issue isn't resolved yet -- https://github.com/llvm/llvm-project/blob/main/libunwind/include/__libunwind_config.h is still included in the build for Is the intention to remove |
Can you try #92192 and let me know if that works?
We don't need that file very much actually, but it contains some common debug-printing routines, so we decided to include it while excluding the bulk of the non-debugging contents. Now I see why that caused compilation problems. |
It works now, but the CMake still pulls in the assembly file |
Excluded the |
This tries to make Wasm compilable in LLVM tree with CMake for non-Emscripten platform. This - Adds `-D__USING_WASM_EXCEPTIONS__` when you compile with `-fwasm-exceptions` (like other EH options) in Clang - Exclude `UnwindLevel1.c`, `UnwindRegistersSave.S`, and `UnwindRegistersRestore.S` when compiling with Wasm - Changed some `__USING_WASM_EXCEPTIONS__` to `__wasm__`; they should be applied when compiling with Wasm w/o exceptions. - Define some unused macros to make it compile Fixes #72771.
error: "Unsupported architecture."
The text was updated successfully, but these errors were encountered: