[all-commits] [llvm/llvm-project] 058222: [libunwind][WebAssembly] Support Wasm EH
Heejin Ahn via All-commits
all-commits at lists.llvm.org
Fri Sep 22 00:39:21 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 058222b2316615194c089f2bc68d11341f39d26e
https://github.com/llvm/llvm-project/commit/058222b2316615194c089f2bc68d11341f39d26e
Author: Heejin Ahn <aheejin at gmail.com>
Date: 2023-09-22 (Fri, 22 Sep 2023)
Changed paths:
A libunwind/src/Unwind-wasm.c
M libunwind/src/config.h
Log Message:
-----------
[libunwind][WebAssembly] Support Wasm EH
This adds Wasm-specific libunwind port to support Wasm exception
handling (https://github.com/WebAssembly/exception-handling).
Wasm EH requires `__USING_WASM_EXCEPTIONS__` to be defined. This adds
`Unwind-wasm.c`, which defines libunwind APIs for Wasm. This also adds a
`thread_local` struct of type `_Unwind_LandingPadContext`, which serves
as a medium for input/output data between the user code and the
personality function. How all these work is explained in
https://github.com/WebAssembly/tool-conventions/blob/main/EHScheme.md.
(The doc is old and "You Shouldn't Prune Unreachable Resumes" section
doesn't apply anymore, but otherwise it should be good)
The bulk of these changes was added back in Mar 2020 in
https://github.com/emscripten-core/emscripten/pull/10577 to emscripten
repo and has been used ever since. Now we'd like to upstream this so
that other toolchains that don't use emscripten libraries, e.g., WASI,
can use this too.
Companion patch: D158918
Reviewed By: dschuff, #libunwind, phosek
Differential Revision: https://reviews.llvm.org/D158919
More information about the All-commits
mailing list