authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-12 00:38:01-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-15 10:48:14-07:00
logef5f8bd7c62f929b5cc210caa816ce4a8c8f8538
treefe683c785f71b7460e6b4e2fccca44f11a7ac1ed
parent98299e7787146e1572cd2038654dbbcf84fa32d1

getExternalExecutor: fix aarch64 windows

std.zig.system.NativeTargetInfo.getExternalExecutor previously would incorrectly communicate that wine could be used to run aarch64-windows binaries on x86_64-linux, and x86_64-windows binaries on aarch64-linux. Neither of these things are true.

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

lib/std/zig/system/NativeTargetInfo.zig+5
...@@ -1090,6 +1090,11 @@ pub fn getExternalExecutor(...@@ -1090,6 +1090,11 @@ pub fn getExternalExecutor(
1090 switch (candidate.target.os.tag) {1090 switch (candidate.target.os.tag) {
1091 .windows => {1091 .windows => {
1092 if (options.allow_wine) {1092 if (options.allow_wine) {
1093 // x86_64 wine does not support emulating aarch64-windows and
1094 // vice versa.
1095 if (candidate.target.cpu.arch != builtin.cpu.arch) {
1096 return bad_result;
1097 }
1093 switch (candidate.target.cpu.arch.ptrBitWidth()) {1098 switch (candidate.target.cpu.arch.ptrBitWidth()) {
1094 32 => return Executor{ .wine = "wine" },1099 32 => return Executor{ .wine = "wine" },
1095 64 => return Executor{ .wine = "wine64" },1100 64 => return Executor{ .wine = "wine64" },