From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtj4P-000330-PF for Qemu-devel@nongnu.org; Wed, 26 Nov 2014 15:20:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xtj4K-0002Ev-A3 for Qemu-devel@nongnu.org; Wed, 26 Nov 2014 15:20:13 -0500 Received: from v220110690675601.yourvserver.net ([37.221.199.173]:41730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtj4K-0002ET-40 for Qemu-devel@nongnu.org; Wed, 26 Nov 2014 15:20:08 -0500 Message-ID: <547635E9.8070909@weilnetz.de> Date: Wed, 26 Nov 2014 21:19:53 +0100 From: Stefan Weil MIME-Version: 1.0 References: <93259ECD-066A-413E-B647-2BB240DBF7EC@livius.net> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] MinGW build List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liviu Ionescu Cc: Peter Maydell , QEMU Developers Am 26.11.2014 um 21:13 schrieb Peter Maydell: > On 26 November 2014 at 19:55, Liviu Ionescu wrote: >> since I had some troubles to build QEMU on Windows, I compiled a page with some instructions: >> >> http://gnuarmeclipse.livius.net/wiki/How_to_build_QEMU#Windows >> >> the purpose was to generate a standalone executable, that requires no libraries. >> >> >> although the procedure is fully functional, I had to apply a small patch, basically: >> >> #ifdef __MINGW32__ >> #if !defined(ffs) >> #define ffs __builtin_ffs >> #endif >> #endif >> >> in several files. > > Hmm. We have a workaround already for a similar thing in > include/sysemu/os-win32.h, > but that works by declaring a prototype rather than using a #define, and it's > guarded by defined(_WIN64). I wonder if some of those workarounds in that file > need to be guarded by more specific checks than just _WIN64... > > Do you have any experience with mingw-w64? When I was doing Windows > (cross-compiled) builds mingw-w64 seemed to be more actively maintained > (even for 32 bit windows targets) than the original mingw project, > and I think there was at least one issue where the fix was basically > "don't try to use mingw, it's just too old, use mingw-w64 instead". > > In any case, thanks very much for writing up the instructions -- we do > get people wanting to know how to build on Windows from time to time, > so it will be useful to be able to point them at instructions. > > You might consider tweaking the instructions to recommend building in > a subdirectory (ie 'mkdir -p build/windows; cd build/windows; > ../../configure; make'). This is good if you're going to be building > more than one configuration, and it also makes it easy to blow away > an old build by removing the whole build tree (distclean is not always > 100% reliable especially if you track head-of-git often). > > -- PMM > I was just writing nearly the same as Peter. So now I can only add one remark: there is also a QEMU Wiki which has some rather old instructions on building for Windows: http://wiki.qemu.org/Hosts/W32. Maybe you could add updated / new instructions there. Thanks Stefan