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

Closes #22361.
This commit is contained in:
Des-Nerger 2025-01-02 18:57:19 +10:00 committed by Alex Rønne Petersen
parent 40f5eac79c
commit 6a21d18adf

View File

@ -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()) {