zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 8a5899f53c50fc59168ecb80fa804bd9eb653fea (tree)
parent babc4d0ad7abf56d80e85bef6629103340037000
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Thu,  4 Jun 2026 02:18:55 +0200

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.

Diffstat:
Mlib/std/zig/system.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

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