zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 2116f2e3b2da0a01e119276e46fd3cbf4b35d548 (tree)
parent d3a6236eef400ff0f99c3fe7d85cfda1c687bb82
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Thu,  8 May 2025 21:28:13 +0200

Compilation: Don't pass -mabi to Clang on powerpc64(le)-freebsd.

The driver doesn't support it, and FreeBSD 13+ on PPC64 uses ELFv2 anyway.

Diffstat:
Msrc/Compilation.zig | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -5775,7 +5775,10 @@ pub fn addCCArgs( if (target_util.llvmMachineAbi(target)) |mabi| { // Clang's integrated Arm assembler doesn't support `-mabi` yet... - if (!(target.cpu.arch.isArm() and (ext == .assembly or ext == .assembly_with_cpp))) { + // Clang's FreeBSD driver doesn't support `-mabi` on PPC64 (ELFv2 is used anyway). + if (!(target.cpu.arch.isArm() and (ext == .assembly or ext == .assembly_with_cpp)) and + !(target.cpu.arch.isPowerPC64() and target.os.tag == .freebsd)) + { try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); } }