Build fails on latest MinGW
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I've run across all sorts of problems. The first was simple, warnings treated as errors, and a warning of -fPIC ignored because its generating all code as position independant. Next came the %hhx's everywhere. MinGW is apparently following old MSVC non-C99 compliant systems, and hhx is not defined. Again, warnings as errors killed the build. zlib can never be found, for some reason I have to add a -I /include. %llx is also not recognized on mingw, but MinGW does have inttypes.h, so those could easily be converted to PRIx64's with a regex. asprintf is not included in MinGW, used in srcpos.c only so far, so I added an implementation in my build driectory which I found online. lstat is not part of mingw, and ntfs's links are different anyhow, so I #defined lstat to stat. fnmatch is included in libiberty, so I had to frab fnmatch.h from MinGW's sourceforge and then add the -liberty statement to the makefile.
I get the feeling though, based on the number of warnings I'm seeing flash across as the compiler attempts to go through this that there are going to be more errors to fix. Catching the initial errors was quite tough because for some reason in pixman and dtc the errors couldn't cause compilation to stop, and running make again wouldn't attempt to rebuild the failures. I had to watch it like a hawk and ctrl-c it when I saw an error until I finally got a build!
For reference, my build system looks like:
User@Computer /c/projects/
$ gcc -v
Using built-in specs.
COLLECT_
COLLECT_
Target: mingw32
Configured with: ../gcc-
Thread model: win32
gcc version 4.8.1 (GCC)
I'm not wonderful with making patches, and most of what I've done I've not properly guarded against other OS's either, but if you want, assuming I ever get it to build, I can post the patch of all the changes I made...
Changed in qemu: | |
status: | New → Invalid |
QEMU for MinGW does not use fnmatch. There is also no asprintf in latest QEMU, only in dtc where it does no harm. The build for MinGW does not use -Werror (for good reason). And yes, MinGW is broken and complains about most format string. Just ignore these warnings, it will work nevertheless.
If you want a better build environment for Windows, use MinGW-w64. It also allows 32 and 64 bit builds.
To make it short: the current code works without any patch if you configure QEMU with --enable-debug. There is a known problem with coroutines which will make QEMU fail during file operations if it was compiled with optimisations.
Regards
S. W.