mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
libcxx: fix building for wasm32-wasi by disabling exceptions
I accidentally regressed this in the LLVM 20 upgrade. Closes #24437.
This commit is contained in:
parent
5696bbb307
commit
c6a18e9534
1 changed files with 11 additions and 0 deletions
|
|
@ -211,6 +211,10 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
|
|||
try cflags.append("-DLIBCXX_BUILDING_LIBCXXABI");
|
||||
try cflags.append("-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER");
|
||||
|
||||
if (target.os.tag == .wasi) {
|
||||
try cflags.append("-fno-exceptions");
|
||||
}
|
||||
|
||||
try cflags.append("-fvisibility=hidden");
|
||||
try cflags.append("-fvisibility-inlines-hidden");
|
||||
|
||||
|
|
@ -388,6 +392,9 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
|
|||
for (libcxxabi_files) |cxxabi_src| {
|
||||
if (!comp.config.any_non_single_threaded and std.mem.startsWith(u8, cxxabi_src, "src/cxa_thread_atexit.cpp"))
|
||||
continue;
|
||||
if (target.os.tag == .wasi and
|
||||
(std.mem.eql(u8, cxxabi_src, "src/cxa_exception.cpp") or std.mem.eql(u8, cxxabi_src, "src/cxa_personality.cpp")))
|
||||
continue;
|
||||
|
||||
var cflags = std.ArrayList([]const u8).init(arena);
|
||||
|
||||
|
|
@ -403,6 +410,10 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
|
|||
try cflags.append("-DHAVE___CXA_THREAD_ATEXIT_IMPL");
|
||||
}
|
||||
|
||||
if (target.os.tag == .wasi) {
|
||||
try cflags.append("-fno-exceptions");
|
||||
}
|
||||
|
||||
try cflags.append("-fvisibility=hidden");
|
||||
try cflags.append("-fvisibility-inlines-hidden");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue