| ... | ... | @@ -5484,6 +5484,9 @@ pub fn addCCArgs( |
| 5484 | 5484 | const is_enabled = target.cpu.features.isEnabled(index); |
| 5485 | 5485 | |
| 5486 | 5486 | if (feature.llvm_name) |llvm_name| { |
| 5487 | // We communicate float ABI to Clang through the dedicated options further down. |
| 5488 | if (std.mem.eql(u8, llvm_name, "soft-float")) continue; |
| 5489 | |
| 5487 | 5490 | argv.appendSliceAssumeCapacity(&[_][]const u8{ "-Xclang", "-target-feature", "-Xclang" }); |
| 5488 | 5491 | const plus_or_minus = "-+"[@intFromBool(is_enabled)]; |
| 5489 | 5492 | const arg = try std.fmt.allocPrint(arena, "{c}{s}", .{ plus_or_minus, llvm_name }); |
| ... | ... | @@ -5705,10 +5708,6 @@ pub fn addCCArgs( |
| 5705 | 5708 | if (target.cpu.model.llvm_name) |llvm_name| { |
| 5706 | 5709 | try argv.append(try std.fmt.allocPrint(arena, "-march={s}", .{llvm_name})); |
| 5707 | 5710 | } |
| 5708 | | |
| 5709 | | if (std.Target.mips.featureSetHas(target.cpu.features, .soft_float)) { |
| 5710 | | try argv.append("-msoft-float"); |
| 5711 | | } |
| 5712 | 5711 | }, |
| 5713 | 5712 | else => { |
| 5714 | 5713 | // TODO |
| ... | ... | @@ -5751,6 +5750,21 @@ pub fn addCCArgs( |
| 5751 | 5750 | try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); |
| 5752 | 5751 | } |
| 5753 | 5752 | |
| 5753 | // We might want to support -mfloat-abi=softfp for Arm and CSKY here in the future. |
| 5754 | if (target_util.clangSupportsFloatAbiArg(target)) { |
| 5755 | const fabi = @tagName(target.floatAbi()); |
| 5756 | |
| 5757 | try argv.append(switch (target.cpu.arch) { |
| 5758 | // For whatever reason, Clang doesn't support `-mfloat-abi` for s390x. |
| 5759 | .s390x => try std.fmt.allocPrint(arena, "-m{s}-float", .{fabi}), |
| 5760 | else => try std.fmt.allocPrint(arena, "-mfloat-abi={s}", .{fabi}), |
| 5761 | }); |
| 5762 | } |
| 5763 | |
| 5764 | if (target_util.clangSupportsNoImplicitFloatArg(target) and target.floatAbi() == .soft) { |
| 5765 | try argv.append("-mno-implicit-float"); |
| 5766 | } |
| 5767 | |
| 5754 | 5768 | if (out_dep_path) |p| { |
| 5755 | 5769 | try argv.appendSlice(&[_][]const u8{ "-MD", "-MV", "-MF", p }); |
| 5756 | 5770 | } |