Am 24.09.2013 17:40, schrieb Paolo Bonzini: > Il 24/09/2013 16:41, Eric Blake ha scritto: > > -mno-cygwin is an obsolete command line option, formerly used for > > cross-compiling from cygwin to mingw. It is NOT used when building > > for cygwin, and these days, building for mingw should use a proper > > cross compiler (available from cygwin.com) rather than the > > -mno-cygwin crutch. To me, this means that there is some cruft in > > the configure file, and that no one has ever really tried to port > > qemu to cygwin yet. > > Yes, QEMU probably was never ported to Cygwin and there is obsolete > cruft to add -mno-cygwin. > > Something like this is needed even if you use the cygwin-to-mingw > cross compiler: > > diff --git a/configure b/configure > index 8f27ab3..bab3aa3 100755 > --- a/configure > +++ b/configure > @@ -344,6 +344,8 @@ elif check_define __sun__ ; then > targetos='SunOS' > elif check_define __HAIKU__ ; then > targetos='Haiku' > +elif check_define __MINGW32__ ; then > + targetos='MINGW32' > else > targetos=`uname -s` > fi > > Stefan, can you look at it? > > Paolo
I'm afraid that you are right: QEMU was never ported to Cygwin. Earlier versions of QEMU could be built in a Cygwin environment using the MinGW compiler which is included in Cygwin. It needed -mno-cygwin. With current QEMU, only MinGW and MinGW-w64 are supported. MinGW-w64 is needed for 64-bit builds of QEMU, but also recommended for 32-bit builds because its include files are better. It's possible to run cross builds with MinGW and MinGW-w64 on all major Linux distributions (that's my standard configuration). Of course it would also be possible to add Cygwin support. There are two variants: 1. Cygwin environment using included MinGWcompiler. I expect only few modifications needed for QEMU, but a lot of work is needed to install the build environment with all libraries needed. The final result should be identical to the one which we get with a MinGW environment. 2. Cygwin environment using the Cygwin compiler with the Linux /POSIXlook and feel. Here I expect lots of code changes, mainly to activate POSIX code for a Windows build. The resulting binary will be slower than the native Windows application from MinGW / MinGW-w64 because of the emulation layer. Both variants would have to support 32 and 64 bit builds. Neither variant 1 nor variant 2 can be used on a Linux host. Would there be an advantage when Cygwin were supported? I think that other things are currently more important for QEMU on Windows, especially support for faster execution with HAXM or some other hypervisor. Maybe we should modify configure to refuse builds in a Cygwin environment and tell the user where more information is available. Regards Stefan