From c16d4ab9e41be6b5c560d15eaa145ff3a0ffce6c Mon Sep 17 00:00:00 2001 From: David Gonzalez Martin Date: Fri, 2 Jun 2023 16:32:43 -0600 Subject: [PATCH] llvm: stop generating FPU code if there is no FPU Fixes https://github.com/ziglang/zig/issues/14465 For aarch64, LLVM was crashing because Zig commands it to generate FPU code even when there is no FPU present. This commit implements the necessary checks to avoid this undesired situation and aarch64 can be compiled again with no FPU. --- src/codegen/llvm.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index f3fd8ec69e..beb2309455 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -11165,6 +11165,7 @@ fn backendSupportsF16(target: std.Target) bool { .mips64, .mips64el, => false, + .aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), else => true, }; } @@ -11175,6 +11176,7 @@ fn backendSupportsF16(target: std.Target) bool { fn backendSupportsF128(target: std.Target) bool { return switch (target.cpu.arch) { .amdgcn => false, + .aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), else => true, }; }