zig

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

commit e445c0d63e788fba46a41c1241e6b312423b7f21 (tree)
parent 81a9bec442caa20dcd1793a4eb06c4fbe59e4d50
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Wed,  6 May 2026 20:55:36 +0200

zig cc: always enforce -mabi=ieeelongdouble for powerpc

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

Diffstat:
Msrc/Compilation.zig | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

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