aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-03-10 09:14:18 +0100
committerAlex Rønne Petersen <alex@alexrp.com>2025-04-04 06:08:10 +0200
commit28469636baf65c72e5bde083563ffd7ab1b6c26e (patch)
treebca4da4159e5575f58a46e25bfcd3ba2ebc77545 /src
parent6667e0fbb48501016e61862a89fd3072d5de19b7 (diff)
downloadzig-28469636baf65c72e5bde083563ffd7ab1b6c26e.tar.gz
zig-28469636baf65c72e5bde083563ffd7ab1b6c26e.zip
zig cc: Avoid passing any "CPU" features related to float ABI to Clang.
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index d5a21aef9c..275fe4b1cc 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -5921,8 +5921,10 @@ pub fn addCCArgs(
const is_enabled = target.cpu.features.isEnabled(index);
if (feature.llvm_name) |llvm_name| {
- // We communicate float ABI to Clang through the dedicated options further down.
- if (std.mem.eql(u8, llvm_name, "soft-float")) continue;
+ // We communicate float ABI to Clang through the dedicated options.
+ if (std.mem.startsWith(u8, llvm_name, "soft-float") or
+ std.mem.startsWith(u8, llvm_name, "hard-float"))
+ continue;
argv.appendSliceAssumeCapacity(&[_][]const u8{ "-Xclang", "-target-feature", "-Xclang" });
const plus_or_minus = "-+"[@intFromBool(is_enabled)];