authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-11-20 06:38:51+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-11-21 12:15:15+01:00
log47df2f9abe204849198084e367312db94aeca405
treea3b7314bb48c3dd3aa29648f3fc61d10b8e3cfc1
parent534370c4dede07c692ced0c5526a5370f233b4d3
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.zig.system.linux: don't arbitrarily limit sparc CPU detection to 64-bit


1 files changed, 1 insertions(+), 7 deletions(-)

lib/std/zig/system/linux.zig+1-7
......@@ -11,7 +11,6 @@ const assert = std.debug.assert;
1111
1212const SparcCpuinfoImpl = struct {
1313 model: ?*const Target.Cpu.Model = null,
14 is_64bit: bool = false,
1514
1615 const cpu_names = .{
1716 .{ "SuperSparc", &Target.sparc.cpu.supersparc },
......@@ -41,17 +40,12 @@ const SparcCpuinfoImpl = struct {
4140 break;
4241 }
4342 }
44 } else if (mem.eql(u8, key, "type")) {
45 self.is_64bit = mem.eql(u8, value, "sun4u") or mem.eql(u8, value, "sun4v");
4643 }
4744
4845 return true;
4946 }
5047
5148 fn finalize(self: *const SparcCpuinfoImpl, arch: Target.Cpu.Arch) ?Target.Cpu {
52 // At the moment we only support 64bit SPARC systems.
53 assert(self.is_64bit);
54
5549 const model = self.model orelse return null;
5650 return Target.Cpu{
5751 .arch = arch,
......@@ -411,7 +405,7 @@ pub fn detectNativeCpuAndFeatures(io: Io) ?Target.Cpu {
411405 const core = @import("arm.zig").aarch64.detectNativeCpuAndFeatures(current_arch, registers);
412406 return core;
413407 },
414 .sparc64 => {
408 .sparc, .sparc64 => {
415409 return SparcCpuinfoParser.parse(current_arch, &file_reader.interface) catch null;
416410 },
417411 .powerpc, .powerpcle, .powerpc64, .powerpc64le => {