Skip to content

Commit 97fa0e3

Browse files
authored
Merge pull request #25456 from alexrp/libcxx-cxx17-removed-functions
`libcxx`: stop defining `_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS`
2 parents 73602f2 + 6870144 commit 97fa0e3

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/libs/libcxx.zig

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,30 @@ const trace = @import("../tracy.zig").trace;
99
const Module = @import("../Package/Module.zig");
1010

1111
const libcxxabi_files = [_][]const u8{
12-
"src/abort_message.cpp",
1312
"src/cxa_aux_runtime.cpp",
1413
"src/cxa_default_handlers.cpp",
1514
"src/cxa_demangle.cpp",
16-
"src/cxa_exception.cpp",
1715
"src/cxa_exception_storage.cpp",
1816
"src/cxa_guard.cpp",
1917
"src/cxa_handlers.cpp",
20-
"src/cxa_noexception.cpp",
21-
"src/cxa_personality.cpp",
22-
"src/cxa_thread_atexit.cpp",
2318
"src/cxa_vector.cpp",
2419
"src/cxa_virtual.cpp",
25-
"src/fallback_malloc.cpp",
26-
"src/private_typeinfo.cpp",
20+
2721
"src/stdlib_exception.cpp",
28-
"src/stdlib_new_delete.cpp",
2922
"src/stdlib_stdexcept.cpp",
3023
"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",
3136
};
3237

3338
const libcxx_base_files = [_][]const u8{
@@ -388,17 +393,20 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
388393
var c_source_files = try std.array_list.Managed(Compilation.CSourceFile).initCapacity(arena, libcxxabi_files.len);
389394

390395
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"))
392397
continue;
393398
if (target.os.tag == .wasi and
394399
(std.mem.eql(u8, cxxabi_src, "src/cxa_exception.cpp") or std.mem.eql(u8, cxxabi_src, "src/cxa_personality.cpp")))
395400
continue;
401+
if (target.os.tag != .wasi and std.mem.eql(u8, cxxabi_src, "src/cxa_noexception.cpp"))
402+
continue;
396403

397404
var cflags = std.array_list.Managed([]const u8).init(arena);
398405

399406
try addCxxArgs(comp, arena, &cflags);
400407

401408
try cflags.append("-DNDEBUG");
409+
try cflags.append("-D_LIBCPP_BUILDING_LIBRARY");
402410
try cflags.append("-D_LIBCXXABI_BUILDING_LIBRARY");
403411
if (!comp.config.any_non_single_threaded) {
404412
try cflags.append("-D_LIBCXXABI_HAS_NO_THREADS");
@@ -548,5 +556,4 @@ pub fn addCxxArgs(
548556
try cflags.append("-D_LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION=0");
549557
}
550558
}
551-
try cflags.append("-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS");
552559
}

0 commit comments

Comments
 (0)