aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-05-09 01:52:26 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-09 01:52:26 -0700
commitbcb534c295d5cc6fd63caa570cc08e6b148a507c (patch)
tree0b17cb1e632d894f50f25e550d5113f232b0e877 /src/Compilation.zig
parentd9b00ee4ba48717ff6b306a6f9419e7b604ac04b (diff)
parent74f52954b9cb40d59d80b839b45bb859146731a7 (diff)
downloadzig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.tar.gz
zig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.zip
Merge branch 'llvm18'
Upgrades the LLVM, Clang, and LLD dependencies to LLVM 18.x Related to #16270
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index fa9331eae5..2497081a5e 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -3590,39 +3590,42 @@ fn processOneJob(comp: *Compilation, job: Job, prog_node: *std.Progress.Node) !v
const named_frame = tracy.namedFrame("libunwind");
defer named_frame.end();
- libunwind.buildStaticLib(comp, prog_node) catch |err| {
- // TODO Surface more error details.
- comp.lockAndSetMiscFailure(
+ libunwind.buildStaticLib(comp, prog_node) catch |err| switch (err) {
+ error.OutOfMemory => return error.OutOfMemory,
+ error.SubCompilationFailed => return, // error reported already
+ else => comp.lockAndSetMiscFailure(
.libunwind,
"unable to build libunwind: {s}",
.{@errorName(err)},
- );
+ ),
};
},
.libcxx => {
const named_frame = tracy.namedFrame("libcxx");
defer named_frame.end();
- libcxx.buildLibCXX(comp, prog_node) catch |err| {
- // TODO Surface more error details.
- comp.lockAndSetMiscFailure(
+ libcxx.buildLibCXX(comp, prog_node) catch |err| switch (err) {
+ error.OutOfMemory => return error.OutOfMemory,
+ error.SubCompilationFailed => return, // error reported already
+ else => comp.lockAndSetMiscFailure(
.libcxx,
"unable to build libcxx: {s}",
.{@errorName(err)},
- );
+ ),
};
},
.libcxxabi => {
const named_frame = tracy.namedFrame("libcxxabi");
defer named_frame.end();
- libcxx.buildLibCXXABI(comp, prog_node) catch |err| {
- // TODO Surface more error details.
- comp.lockAndSetMiscFailure(
+ libcxx.buildLibCXXABI(comp, prog_node) catch |err| switch (err) {
+ error.OutOfMemory => return error.OutOfMemory,
+ error.SubCompilationFailed => return, // error reported already
+ else => comp.lockAndSetMiscFailure(
.libcxxabi,
"unable to build libcxxabi: {s}",
.{@errorName(err)},
- );
+ ),
};
},
.libtsan => {
@@ -5159,6 +5162,8 @@ pub fn addCCArgs(
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));
}
if (comp.config.link_libunwind) {
@@ -5273,7 +5278,7 @@ pub fn addCCArgs(
// version as well as the -mmacosx-version-min argument.
// Zig provides the correct value in both places, so it
// doesn't matter which one gets overridden.
- argv.appendAssumeCapacity("-Wno-overriding-t-option");
+ argv.appendAssumeCapacity("-Wno-overriding-option");
},
.ios, .tvos, .watchos => switch (target.cpu.arch) {
// Pass the proper -m<os>-version-min argument for darwin.