| ... | @@ -211,6 +211,10 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError! | ... | @@ -211,6 +211,10 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError! |
| 211 | try cflags.append("-DLIBCXX_BUILDING_LIBCXXABI"); | 211 | try cflags.append("-DLIBCXX_BUILDING_LIBCXXABI"); |
| 212 | try cflags.append("-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER"); | 212 | try cflags.append("-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER"); |
| 213 | | 213 | |
| | 214 | if (target.os.tag == .wasi) { |
| | 215 | try cflags.append("-fno-exceptions"); |
| | 216 | } |
| | 217 | |
| 214 | try cflags.append("-fvisibility=hidden"); | 218 | try cflags.append("-fvisibility=hidden"); |
| 215 | try cflags.append("-fvisibility-inlines-hidden"); | 219 | try cflags.append("-fvisibility-inlines-hidden"); |
| 216 | | 220 | |
| ... | @@ -388,6 +392,9 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr | ... | @@ -388,6 +392,9 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr |
| 388 | for (libcxxabi_files) |cxxabi_src| { | 392 | for (libcxxabi_files) |cxxabi_src| { |
| 389 | if (!comp.config.any_non_single_threaded and std.mem.startsWith(u8, cxxabi_src, "src/cxa_thread_atexit.cpp")) | 393 | if (!comp.config.any_non_single_threaded and std.mem.startsWith(u8, cxxabi_src, "src/cxa_thread_atexit.cpp")) |
| 390 | continue; | 394 | continue; |
| | 395 | if (target.os.tag == .wasi and |
| | 396 | (std.mem.eql(u8, cxxabi_src, "src/cxa_exception.cpp") or std.mem.eql(u8, cxxabi_src, "src/cxa_personality.cpp"))) |
| | 397 | continue; |
| 391 | | 398 | |
| 392 | var cflags = std.ArrayList([]const u8).init(arena); | 399 | var cflags = std.ArrayList([]const u8).init(arena); |
| 393 | | 400 | |
| ... | @@ -403,6 +410,10 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr | ... | @@ -403,6 +410,10 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr |
| 403 | try cflags.append("-DHAVE___CXA_THREAD_ATEXIT_IMPL"); | 410 | try cflags.append("-DHAVE___CXA_THREAD_ATEXIT_IMPL"); |
| 404 | } | 411 | } |
| 405 | | 412 | |
| | 413 | if (target.os.tag == .wasi) { |
| | 414 | try cflags.append("-fno-exceptions"); |
| | 415 | } |
| | 416 | |
| 406 | try cflags.append("-fvisibility=hidden"); | 417 | try cflags.append("-fvisibility=hidden"); |
| 407 | try cflags.append("-fvisibility-inlines-hidden"); | 418 | try cflags.append("-fvisibility-inlines-hidden"); |
| 408 | | 419 | |