aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-02-05 10:50:09 +0100
committerAlex Rønne Petersen <alex@alexrp.com>2025-04-04 06:08:09 +0200
commit156ab8750056c3ff440af0937806d8cdb2623816 (patch)
tree26956c58e4d169279885ab94d479f8b9f4285872 /src/Compilation.zig
parent7ab01c9a42fa0262d67d9ff1a0ecde24fb7031e7 (diff)
downloadzig-156ab8750056c3ff440af0937806d8cdb2623816.tar.gz
zig-156ab8750056c3ff440af0937806d8cdb2623816.zip
libcxx: Update to Clang 20.
See: * https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc/77319 * https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701 We're dropping support for C++03 for Zig due to the first change; it would be insane to ship 1018 duplicate header files just for this outdated use case. As a result of the second change, I had to bring in a subset of the headers from llvm-libc since libc++ now depends on these. Hopefully we can continue to get away with not copying the entirety of llvm-libc.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index d7f3ee6dde..d5a21aef9c 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -5776,29 +5776,7 @@ pub fn addCCArgs(
comp.zig_lib_directory.path.?, "libcxxabi", "include",
}));
- if (target.abi.isMusl()) {
- try argv.append("-D_LIBCPP_HAS_MUSL_LIBC");
- }
-
- try argv.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
- try argv.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS");
- try argv.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");
-
- if (!comp.config.any_non_single_threaded) {
- try argv.append("-D_LIBCPP_HAS_NO_THREADS");
- }
-
- // See the comment in libcxx.zig for more details about this.
- try argv.append("-D_LIBCPP_PSTL_BACKEND_SERIAL");
-
- try argv.append(try std.fmt.allocPrint(arena, "-D_LIBCPP_ABI_VERSION={d}", .{
- @intFromEnum(comp.libcxx_abi_version),
- }));
- try argv.append(try std.fmt.allocPrint(arena, "-D_LIBCPP_ABI_NAMESPACE=__{d}", .{
- @intFromEnum(comp.libcxx_abi_version),
- }));
-
- try argv.append(libcxx.hardeningModeFlag(mod.optimize_mode));
+ try libcxx.addCxxArgs(comp, arena, argv);
}
// According to Rich Felker libc headers are supposed to go before C language headers.