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