Skip to content

Commit

Permalink
-fwine: allow 32-bit .exe's be run on backward-compatible 64-bit ar…
Browse files Browse the repository at this point in the history
…ches

Closes ziglang#22361.
  • Loading branch information
Des-Nerger committed Jan 7, 2025
1 parent e6879e9 commit 6d765ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/std/zig/system.zig
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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()) {
Expand Down

0 comments on commit 6d765ec

Please sign in to comment.