Il sab 11 set 2021, 10:43 Howard Spoelstra <hsp.cat7@gmail.com> ha scritto:
I wrote those instructions as I obviously could not find a better way to get Qemu to cross-compile using MSYS2 in Windows.

But if you are using MSYS2, why do you need cross compilation and --cross-prefix at all?

When you look at configure, you see that only adding the cross-prefix will not find the MSYS equivalents of some tools:

ar="${AR-${cross_prefix}ar}"
looks for x86_64-w64-mingw32-ar.exe and not (as it is named in MSYS2) x86_64-w64-mingw32-gcc-ar.exe

Yes, if the static linker is gcc-ar (I think that's only needed with link-time optimization) you would need AR=. But if you don't need gcc-ar you don't need to change the AR variable, and if you don't need a cross prefix you can just set AR=gcc-ar.

Paolo
Perhaps it would be better to fix configure for the MSYS2 case so the flags or the renaming are not required?
Best,
Howard