From e445c0d63e788fba46a41c1241e6b312423b7f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 6 May 2026 20:55:36 +0200 Subject: [PATCH] zig cc: always enforce -mabi=ieeelongdouble for powerpc closes https://codeberg.org/ziglang/zig/issues/30976 --- src/Compilation.zig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Compilation.zig b/src/Compilation.zig index 3a70e05f5dde53b1f58911096b233b1c05c9c2b0..d69813fd1120bf1384b4e16cd62dfc3679ac8f6f 100644 --- 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()); -- 2.54.0