commit c16d4ab9e41be6b5c560d15eaa145ff3a0ffce6c (tree)
parent 9ee0a706da66e271ce0f79d00566dbe40b57b83e
Author: David Gonzalez Martin <davidgm94.work@protonmail.com>
Date: Fri, 2 Jun 2023 16:32:43 -0600
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.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git 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,
};
}