zig

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

commit 6a21d18adfe9ae4ff7f4beacbd4faed4d04832b8 (tree)
parent 40f5eac79c8491e2e9ac0861e18872d6ba5b3b0b
Author: Des-Nerger <mixerator@rambler.ru>
Date:   Thu,  2 Jan 2025 18:57:19 +1000

`-fwine`: allow 32-bit .exe's be run on backward-compatible 64-bit arches

Closes #22361.

Diffstat:
Mlib/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 @@ -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()) {