From 71a237e764717a69495af531ea0d4f123bec7294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 11 Apr 2025 02:00:21 +0200 Subject: [PATCH] std.zig.system: Force soft_float feature on for MIPS soft float targets. Workaround for: https://github.com/llvm/llvm-project/issues/135283 --- lib/std/zig/system.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 81a3013b34..5ddc3432f9 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -411,6 +411,11 @@ pub fn resolveTargetQuery(query: Target.Query) DetectError!Target { if (result.cpu.arch.isArm() and result.abi.float() == .soft) { result.cpu.features.removeFeature(@intFromEnum(Target.arm.Feature.vfp2)); } + + // https://github.com/llvm/llvm-project/issues/135283 + if (result.cpu.arch.isMIPS() and result.abi.float() == .soft) { + result.cpu.features.addFeature(@intFromEnum(Target.mips.Feature.soft_float)); + } } // It's possible that we detect the native ABI, but fail to detect the OS version or were told