zig cc: Avoid passing any "CPU" features related to float ABI to Clang.

This commit is contained in:
Alex Rønne Petersen 2025-03-10 09:14:18 +01:00
parent 6667e0fbb4
commit 28469636ba
No known key found for this signature in database

View File

@ -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)];