authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-05 00:52:57+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-10-05 00:52:57+02:00
log97fa0e3ebd1561d9b4396b428d3ade86cd130d6a
treefff29498ba8d86888f21915113bdbb79098fc522
parent73602f2a13765b5ea3c766c547b2fb088c950ed1
parent6870144a3b153dafdd740686bbbbae2d4489d305
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #25456 from alexrp/libcxx-cxx17-removed-functions

`libcxx`: stop defining `_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS`

1 files changed, 17 insertions(+), 10 deletions(-)

src/libs/libcxx.zig+17-10
...@@ -9,25 +9,30 @@ const trace = @import("../tracy.zig").trace;...@@ -9,25 +9,30 @@ const trace = @import("../tracy.zig").trace;
9const Module = @import("../Package/Module.zig");9const Module = @import("../Package/Module.zig");
1010
11const libcxxabi_files = [_][]const u8{11const 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};
3237
33const libcxx_base_files = [_][]const u8{38const 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);
389394
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 and398 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;
396403
397 var cflags = std.array_list.Managed([]const u8).init(arena);404 var cflags = std.array_list.Managed([]const u8).init(arena);
398405
399 try addCxxArgs(comp, arena, &cflags);406 try addCxxArgs(comp, arena, &cflags);
400407
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}