From 27775f1a9eecc6142834affb524eadd33b9e56b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 4 Aug 2024 11:04:23 +0200 Subject: [PATCH] std.Target: Use v9 as the baseline CPU for sparc32. It is impossible to even build projects like glibc when targeting a generic SPARC v8 CPU; LEON3 is effectively considered the baseline for `sparc-linux-gnu` now, particularly due to it supporting a CASA instruction similar to the one in SPARC v9. However, it's slightly incompatible with SPARC v9 due to having a different ASI tag, so resulting binaries would not be portable to regular SPARC CPUs. So, as the least bad option, make v9 the baseline for sparc32. --- lib/std/Target.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 8d9f596072..f9a6da8ce0 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -1502,7 +1502,7 @@ pub const Cpu = struct { .x86 => &x86.cpu.pentium4, .nvptx, .nvptx64 => &nvptx.cpu.sm_20, .s390x => &s390x.cpu.arch8, - .sparc => &sparc.cpu.v8, + .sparc => &sparc.cpu.v9, // glibc does not work with 'plain' v8. .loongarch64 => &loongarch.cpu.loongarch64, else => generic(arch),