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.
This commit is contained in:
Andrew Kelley 2023-03-12 00:38:01 -07:00
parent 98299e7787
commit ef5f8bd7c6

View File

@ -1090,6 +1090,11 @@ pub fn getExternalExecutor(
switch (candidate.target.os.tag) {
.windows => {
if (options.allow_wine) {
// x86_64 wine does not support emulating aarch64-windows and
// vice versa.
if (candidate.target.cpu.arch != builtin.cpu.arch) {
return bad_result;
}
switch (candidate.target.cpu.arch.ptrBitWidth()) {
32 => return Executor{ .wine = "wine" },
64 => return Executor{ .wine = "wine64" },