Skip to content

Commit db77e46

Browse files
committed
zig cc: Don't pass -mabi for assembly files when targeting arm.
Clang's integrated Arm assembler doesn't understand -mabi yet, so this results in "unused command line argument" warnings when building musl code and glibc stubs, for example.
1 parent 5765736 commit db77e46

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Compilation.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5631,7 +5631,10 @@ pub fn addCCArgs(
56315631
}
56325632

56335633
if (target_util.llvmMachineAbi(target)) |mabi| {
5634-
try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi}));
5634+
// Clang's integrated Arm assembler doesn't support `-mabi` yet...
5635+
if (!(target.cpu.arch.isArm() and (ext == .assembly or ext == .assembly_with_cpp))) {
5636+
try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi}));
5637+
}
56355638
}
56365639

56375640
// We might want to support -mfloat-abi=softfp for Arm and CSKY here in the future.

0 commit comments

Comments
 (0)