authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-04 02:18:55+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-04 02:18:55+02:00
log8a5899f53c50fc59168ecb80fa804bd9eb653fea
tree99c4f0f99473166983a22483d46a0bfc193f7038
parentbabc4d0ad7abf56d80e85bef6629103340037000
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.zig.system: always use qemu-sparc32plus for 32-bit sparc in getExternalExecutor()

qemu-sparc32plus can run both traditional 32-bit binaries and 32-bit "plus" (32-bit ABI on 64-bit kernel) binaries because it has a wider array of emulated CPU types. By contrast, qemu-sparc simply cannot emulate v9 instructions that appear in 32-bit binaries. This is a problem for us because we set our baseline to v9 even for 32-bit; v8 hardware is borderline archaic and lacks atomic primitives that e.g. glibc requires.

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

lib/std/zig/system.zig+1-1
......@@ -152,7 +152,7 @@ pub fn getExternalExecutor(io: Io, candidate: *const std.Target, options: GetExt
152152 // TODO: Actually check the SuperH version.
153153 .sh => "qemu-sh4",
154154 .sheb => "qemu-sh4eb",
155 .sparc => if (candidate.cpu.has(.sparc, .v8plus)) "qemu-sparc32plus" else "qemu-sparc",
155 .sparc => "qemu-sparc32plus",
156156 .thumb => "qemu-arm",
157157 .thumbeb => "qemu-armeb",
158158 else => "qemu-" ++ @tagName(t),