| ... | ... | @@ -9,25 +9,30 @@ const trace = @import("../tracy.zig").trace; |
| 9 | 9 | const Module = @import("../Package/Module.zig"); |
| 10 | 10 | |
| 11 | 11 | const libcxxabi_files = [_][]const u8{ |
| 12 | | "src/abort_message.cpp", |
| 13 | 12 | "src/cxa_aux_runtime.cpp", |
| 14 | 13 | "src/cxa_default_handlers.cpp", |
| 15 | 14 | "src/cxa_demangle.cpp", |
| 16 | | "src/cxa_exception.cpp", |
| 17 | 15 | "src/cxa_exception_storage.cpp", |
| 18 | 16 | "src/cxa_guard.cpp", |
| 19 | 17 | "src/cxa_handlers.cpp", |
| 20 | | "src/cxa_noexception.cpp", |
| 21 | | "src/cxa_personality.cpp", |
| 22 | | "src/cxa_thread_atexit.cpp", |
| 23 | 18 | "src/cxa_vector.cpp", |
| 24 | 19 | "src/cxa_virtual.cpp", |
| 25 | | "src/fallback_malloc.cpp", |
| 26 | | "src/private_typeinfo.cpp", |
| 20 | |
| 27 | 21 | "src/stdlib_exception.cpp", |
| 28 | | "src/stdlib_new_delete.cpp", |
| 29 | 22 | "src/stdlib_stdexcept.cpp", |
| 30 | 23 | "src/stdlib_typeinfo.cpp", |
| 24 | "src/stdlib_new_delete.cpp", |
| 25 | |
| 26 | "src/abort_message.cpp", |
| 27 | "src/fallback_malloc.cpp", |
| 28 | "src/private_typeinfo.cpp", |
| 29 | |
| 30 | "src/cxa_exception.cpp", |
| 31 | "src/cxa_personality.cpp", |
| 32 | |
| 33 | "src/cxa_noexception.cpp", |
| 34 | |
| 35 | "src/cxa_thread_atexit.cpp", |
| 31 | 36 | }; |
| 32 | 37 | |
| 33 | 38 | const libcxx_base_files = [_][]const u8{ |
| ... | ... | @@ -388,17 +393,20 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr |
| 388 | 393 | var c_source_files = try std.array_list.Managed(Compilation.CSourceFile).initCapacity(arena, libcxxabi_files.len); |
| 389 | 394 | |
| 390 | 395 | for (libcxxabi_files) |cxxabi_src| { |
| 391 | | if (!comp.config.any_non_single_threaded and std.mem.startsWith(u8, cxxabi_src, "src/cxa_thread_atexit.cpp")) |
| 396 | if (!comp.config.any_non_single_threaded and std.mem.eql(u8, cxxabi_src, "src/cxa_thread_atexit.cpp")) |
| 392 | 397 | continue; |
| 393 | 398 | if (target.os.tag == .wasi and |
| 394 | 399 | (std.mem.eql(u8, cxxabi_src, "src/cxa_exception.cpp") or std.mem.eql(u8, cxxabi_src, "src/cxa_personality.cpp"))) |
| 395 | 400 | continue; |
| 401 | if (target.os.tag != .wasi and std.mem.eql(u8, cxxabi_src, "src/cxa_noexception.cpp")) |
| 402 | continue; |
| 396 | 403 | |
| 397 | 404 | var cflags = std.array_list.Managed([]const u8).init(arena); |
| 398 | 405 | |
| 399 | 406 | try addCxxArgs(comp, arena, &cflags); |
| 400 | 407 | |
| 401 | 408 | try cflags.append("-DNDEBUG"); |
| 409 | try cflags.append("-D_LIBCPP_BUILDING_LIBRARY"); |
| 402 | 410 | try cflags.append("-D_LIBCXXABI_BUILDING_LIBRARY"); |
| 403 | 411 | if (!comp.config.any_non_single_threaded) { |
| 404 | 412 | try cflags.append("-D_LIBCXXABI_HAS_NO_THREADS"); |
| ... | ... | @@ -548,5 +556,4 @@ pub fn addCxxArgs( |
| 548 | 556 | try cflags.append("-D_LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION=0"); |
| 549 | 557 | } |
| 550 | 558 | } |
| 551 | | try cflags.append("-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS"); |
| 552 | 559 | } |