authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-06 20:55:36+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-07 05:32:04+02:00
loge445c0d63e788fba46a41c1241e6b312423b7f21
treeecb812141609c2fd68e4de3fca66ec3346e3cd22
parent81a9bec442caa20dcd1793a4eb06c4fbe59e4d50

zig cc: always enforce -mabi=ieeelongdouble for powerpc

closes https://codeberg.org/ziglang/zig/issues/30976

1 files changed, 13 insertions(+), 0 deletions(-)

src/Compilation.zig+13
......@@ -6639,6 +6639,19 @@ pub fn addCCArgs(
66396639 }
66406640 }
66416641
6642 if (target.cpu.arch.isPowerPC()) {
6643 // We do not -- and probably never will -- support the IBM 128-bit `long double` format.
6644 // LLVM and Clang also do not have complete support for it, producing wrong values in some
6645 // cases. So just enforce IEEE `long double` everywhere - either binary64 or binary128
6646 // depending on what the OS/ABI requires.
6647 try argv.appendSlice(&.{
6648 "-mabi=ieeelongdouble",
6649 // Clang has some truly goofy logic for emitting warnings about the
6650 // "current library" not supporting IEEE `long double`.
6651 "-Wno-unsupported-abi",
6652 });
6653 }
6654
66426655 // We might want to support -mfloat-abi=softfp for Arm and CSKY here in the future.
66436656 if (target_util.clangSupportsFloatAbiArg(target)) {
66446657 const fabi = @tagName(target.abi.float());