From 6a21d18adfe9ae4ff7f4beacbd4faed4d04832b8 Mon Sep 17 00:00:00 2001 From: Des-Nerger Date: Thu, 2 Jan 2025 18:57:19 +1000 Subject: [PATCH] `-fwine`: allow 32-bit .exe's be run on backward-compatible 64-bit arches Closes #22361. --- lib/std/zig/system.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 6d1f44bfa05e..f57bb44d72df 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -130,7 +130,10 @@ pub fn getExternalExecutor( if (options.allow_wine) { // x86_64 wine does not support emulating aarch64-windows and // vice versa. - if (candidate.cpu.arch != builtin.cpu.arch) { + if (candidate.cpu.arch != builtin.cpu.arch and + !(candidate.cpu.arch == .thumb and builtin.cpu.arch == .aarch64) and + !(candidate.cpu.arch == .x86 and builtin.cpu.arch == .x86_64)) + { return bad_result; } switch (candidate.ptrBitWidth()) {