[libcxx-commits] [PATCH] D158918: [libc++abi][WebAssembly] Support Wasm EH
Heejin Ahn via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 28 22:34:41 PDT 2023
aheejin added a comment.
@dschuff
> I notice there are no changes to the build system for this; presumably that's just because we don't have CMake support for building LLVM libraries for wasm in general. I wonder whether LLVM or the libc++abi maintainers have any policies about that.
> Also, regarding the `__USING_WASM_EXCEPTIONS__` macro: this is not predefined by the compiler but needs to be defined by the builder/build system, right? I wonder if that's something that belongs in <__cxxabi_config.h>
We currently define it in the library building script: https://github.com/emscripten-core/emscripten/blob/df74d74f5dfce1c2128fdb0dde1b09c178f7a38a/tools/system_libs.py#L1505-L1506
`__USING_SJLJ_EXCEPTIONS__`, a preexisting macro, seems to be defined here: https://github.com/llvm/llvm-project/blob/15b5ac38cf5d2272e28076357c207194f0ef6a6c/clang/lib/Frontend/InitPreprocessor.cpp#L913-L914; It's not defined in either `__cxxabi_config.h` or `CMakeLists.txt`.
We can maybe add something like
if (LangOpts.hasWasmExceptions())
Builder.defineMacro("__USING_WASM_EXCEPTIONS__");
in `InitProcessor.cpp` too, like `__USING_SJLJ_EXCEPTIONS__`. So far it has not really necessary because we only use it within libraries and the libraries are built with `system_libs.py`, which defines it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158918/new/
https://reviews.llvm.org/D158918
More information about the libcxx-commits
mailing list