BetaArchive Logo
Navigation Home Screenshots Image Uploader Server Info FTP Servers Wiki Forum RSS Feed Rules Please Donate
UP: 24d, 7h, 57m | CPU: 49% | MEM: 5871MB of 12227MB used
{The community for beta collectors}

Post new topic Reply to topic  [ 17 posts ] 
Author Message
 PostPost subject: How to compile QEMU on Win64        Posted: Sun Jul 07, 2013 6:24 pm 
Reply with quote
Donator
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
3407

Location
Italy

Favourite OS
Windows, OS/2, DOS
Since the following site URL http://virtuallyfun.superglobalmegacorp.com/?p=3092 no longer provides newer versions of QEMU for Win32 (such as 1.5.x), I decided to put my own guide here (if it's on-topic)

First major step: prepare the MinGW 64-bit environment for the dependency components of QEMU
Requirements
Get the MinGW-w64 package from here:
http://mingw-w64.sourceforge.net/download.php#mingw-builds
And check the downloads, and, in the installer of MinGW 64-bit, use the sjsj exception, use gcc 4.8.1, and win32 thread and rev1.
However, this does not install MSYS by default, so you need to get it separately, from here: http://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/

Install Python 2.7 from here:
http://www.python.org/download/releases/2.7/
Accept the default directory it gives (C:\Python27).
After being installed, make a copy of python.exe as python2.5.exe.

Once gotten, we can start compiling the dependencies.

1)
Get the latest release of libffi from here:
http://www.mirrorservice.org/sites/sourceware.org/pub/libffi/
compile it with:
Code:
./configure --prefix=/c/mingw-builds/mingw64 --build=x86_64-w64-mingw32
make
make install


2)
Get libiconv-1.14 from here:
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
compile it with:
Code:
./configure --prefix=/c/mingw-builds/mingw64 --build=x86_64-w64-mingw32
make
make install


3)
Get the latest release of gettext from here:
http://ftp.gnu.org/gnu/gettext/
compile it with the following options:
Code:
./configure --prefix=/c/mingw-builds/mingw64 --enable-threads=win32 --enable-relocatable --build=x86_64-w64-mingw32
make
make install


Watch out! You need to use these in the shell of MSYS every time you need to compile Glib and Qemu:
Code:
PATH=/c/Python27:/c/Python27/DLLs:$PATH
export PATH


4)
Watch out again! As explained in the official Qemu website, Glib 2.23 and higher in x64 mode won't make Qemu work!.
Get glib for win64 here (x64):
http://www.gtk.org/download/win64.php (grab the sources instead of the dev and bin)
compile it first with:
Code:
export LIBFFI_CFLAGS='-I /c/mingw-builds/mingw64/lib/libffi-3.0.13/include'
export LIBFFI_LIBS=-lffi
export lt_cv_deplibs_check_method="pass_all"
export CFLAGS="-O0 -g -pipe -Wall -mms-bitfields -mthreads"
export CPPFLAGS="-DG_ATOMIC_OP_USE_GCC_BUILTINS=1"
configure -prefix=/c/mingw-builds/mingw64 -with-pcre=internal -disable-static -disable-gtk-doc -enable-silent-rules -build=x86_64-w64-mingw32
make
make install


Fixes for the glib compile failures about libintl.h: Glib can't find the right path to libintl.h, so you need to copy it to the glib-2.26.1 directory and modify configure (the file), search "libintl.h" (with quotes) and replace it with your path of the include directory containing libintl.h (in this case: c:/mingw-builds/mingw64/include/libintl.h)

5)
Grab pkg-config from here:
http://pkgconfig.freedesktop.org/releases/
compile it with:
Code:
export GLIB_CFLAGS="-I /c/mingw-builds/mingw64/include/glib-2.0 -I /c/mingw-builds/mingw64/lib/glib-2.0/include"
export GLIB_LIBS="-lglib-2.0"
configure -prefix=/c/mingw-builds/mingw64 -build=x86_64-w64-mingw32
make
make install


6)
Rebuild Glib with these options instead:
Code:
configure -prefix=/c/mingw-builds/mingw64 -build=x86_64-w64-mingw32
make
make install


7)
Grab SDL from here:
http://www.libsdl.org/download-1.2.php (Select the mingw32 one)
compile it with:
Code:
configure -prefix=/c/mingw-builds/mingw64 -build=x86_64-w64-mingw32
make
make install


8) (Optional for QEMU versions prior to 1.3)
Grab pixman from here:
http://pkgs.fedoraproject.org/repo/pkgs/mingw-pixman/pixman-0.28.0.tar.gz/0554c354aed2d7845180f310a9a15f20/
compile it with:
Code:
configure -prefix=/c/mingw-builds/mingw64 -build=x86_64-w64-mingw32
make
make install


Second and last step, compiling QEMU!
If you want to compile QEMU 1.x, you need to put, every time, the python path to the MSYS shell that is shown above in this tutorial.

Grab the latest git release here:
http://wiki.qemu.org/Main_Page

and start compiling with:

Code:
./configure
make
make install


If anyone's having problems starting QEMU, let me know so I can change this guide.

_________________
http://forum.softhistory.org


Last edited by TheCollector1988 on Mon Jul 08, 2013 10:44 pm, edited 4 times in total.

Top  Profile  WWW
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Sun Jul 07, 2013 6:26 pm 
Reply with quote
Donator
User avatar
Offline

Joined
Thu Oct 25, 2012 8:19 pm

Posts
1783

Location
shell32.dll
Thank you for this easy to understand guide :)

_________________
Windows Defender for great justice! Bugs are an international trading company. I need to defeat the anti-debugging and obfuscation methods. It wasn't for Intel's absurd ability to load in ie6. Why even waste time with people in an envelope?


Top  Profile
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Sun Jul 07, 2013 7:44 pm 
Reply with quote
Donator
Offline

Joined
Sun Feb 11, 2007 4:48 pm

Posts
148

Location
UK
very very nice!!


Top  Profile  WWW  YIM
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Mon Jul 08, 2013 3:58 am 
Reply with quote
FTP Access
User avatar
Offline

Joined
Tue Oct 04, 2011 5:57 am

Posts
553

Location
Singapore

Favourite OS
Windows 10
Do we run the commands using bash?


Top  Profile
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Mon Jul 08, 2013 10:37 am 
Reply with quote
Donator
User avatar
Offline

Joined
Thu Oct 25, 2012 8:19 pm

Posts
1783

Location
shell32.dll
Terra854 wrote:
Do we run the commands using bash?


Yes, everything related to MinGW is done in bash.

_________________
Windows Defender for great justice! Bugs are an international trading company. I need to defeat the anti-debugging and obfuscation methods. It wasn't for Intel's absurd ability to load in ie6. Why even waste time with people in an envelope?


Top  Profile
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Wed Jul 24, 2013 10:24 pm 
Reply with quote
FTP Access
Offline

Joined
Tue Jun 29, 2010 4:47 am

Posts
25

Location
/dev/null

Favourite OS
950C
Thanks for the guide, also the Cirrus patch seems still having some major problems with Windows 3.1...


Top  Profile
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Thu Jul 25, 2013 1:33 am 
Reply with quote
Donator
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
3407

Location
Italy

Favourite OS
Windows, OS/2, DOS
raidenii wrote:
Thanks for the guide, also the Cirrus patch seems still having some major problems with Windows 3.1...


I fixed that with an old patch (it was originally for 0.11, from 2009/2010) that was posted on a Japanese website, I might provide it someday but it will need to be edited to be compatible with 1.5 or 1.6.

_________________
http://forum.softhistory.org


Top  Profile  WWW
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Sat Jul 27, 2013 10:57 pm 
Reply with quote
FTP Access
Offline

Joined
Tue Jun 29, 2010 4:47 am

Posts
25

Location
/dev/null

Favourite OS
950C
TheCollector1988 wrote:
raidenii wrote:
Thanks for the guide, also the Cirrus patch seems still having some major problems with Windows 3.1...


I fixed that with an old patch (it was originally for 0.11, from 2009/2010) that was posted on a Japanese website, I might provide it someday but it will need to be edited to be compatible with 1.5 or 1.6.

I believe you got it from here?
http://bauxite.sakura.ne.jp/software/qemu/


Top  Profile
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Sat Jul 27, 2013 11:05 pm 
Reply with quote
Donator
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
3407

Location
Italy

Favourite OS
Windows, OS/2, DOS
raidenii wrote:
TheCollector1988 wrote:
raidenii wrote:
Thanks for the guide, also the Cirrus patch seems still having some major problems with Windows 3.1...


I fixed that with an old patch (it was originally for 0.11, from 2009/2010) that was posted on a Japanese website, I might provide it someday but it will need to be edited to be compatible with 1.5 or 1.6.

I believe you got it from here?
http://bauxite.sakura.ne.jp/software/qemu/


yep, I got it from there.

_________________
http://forum.softhistory.org


Top  Profile  WWW
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Fri Nov 29, 2013 3:36 pm 
Reply with quote
Donator
Offline

Joined
Sun Feb 11, 2007 4:48 pm

Posts
148

Location
UK
hmm im trying to build a new environment got everything compiled and happy but on doing ./configure for qemu i get...

ERROR: "cc" either does not exist or does not work


Top  Profile  WWW  YIM
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Thu Dec 19, 2013 2:29 pm 
Reply with quote
FTP Access
User avatar
Offline

Joined
Wed Dec 31, 2008 7:29 pm

Posts
1427

Location
SE Asia

Favourite OS
MS-DOS 3.30a & Windows/386!
therock247uk wrote:
hmm im trying to build a new environment got everything compiled and happy but on doing ./configure for qemu i get...

ERROR: "cc" either does not exist or does not work


Code:
export CC=gcc


Although I'm not having much luck with the resulting binary.... and I still have glib2 issues..... :|

I never was that good at debugging this stuff.

Code:
$ gdb i386-softmmu/qemu-system-i386
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from C:\msys\home\User\qemu-1.6.2\i386-softmmu\qemu-system-i386
.exe...done.
(gdb) set args -L pc-bios -m 16
(gdb) r
Starting program: C:\msys\home\User\qemu-1.6.2/i386-softmmu/qemu-system-i386.ex
e -L pc-bios -m 16
[New Thread 4040.0x14c]
[New Thread 4040.0xf10]
[New Thread 4040.0xaa0]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 4040.0xf10]
0x0000000077155371 in ntdll!RtlUnwindEx () from C:\Windows\system32\ntdll.dll
(gdb) t 1
[Switching to thread 1 (Thread 4040.0x14c)]
#0  0x000000007719046a in ntdll!ZwWaitForMultipleObjects ()
   from C:\Windows\system32\ntdll.dll
(gdb) bt
#0  0x000000007719046a in ntdll!ZwWaitForMultipleObjects ()
   from C:\Windows\system32\ntdll.dll
#1  0x000007fefd3813a6 in KERNELBASE!GetCurrentThread ()
   from C:\Windows\system32\KernelBase.dll
#2  0x0000000000000002 in ?? ()
#3  0x0000000000000001 in ?? ()
#4  0x0000000000226fb8 in ?? ()
#5  0x000007fefd3844a6 in SetThreadLocale ()
   from C:\Windows\system32\KernelBase.dll
#6  0x0000000000226fb8 in ?? ()
#7  0x0000000000000000 in ?? ()
(gdb) t 2
[Switching to thread 2 (Thread 4040.0xf10)]
#0  0x0000000077155371 in ntdll!RtlUnwindEx ()
   from C:\Windows\system32\ntdll.dll
(gdb) bt
#0  0x0000000077155371 in ntdll!RtlUnwindEx ()
   from C:\Windows\system32\ntdll.dll
#1  0x0000000004a00000 in ?? ()
#2  0x00000000049ff490 in ?? ()
#3  0x000000000001b84c in ?? ()
#4  0x0000000050000163 in ?? ()
#5  0x000000000000007f in ?? ()
#6  0x00000000003ca200 in ?? ()
#7  0x0000000000000000 in ?? ()
(gdb) t 3
[Switching to thread 3 (Thread 4040.0xaa0)]
#0  0x000000007719046a in ntdll!ZwWaitForMultipleObjects ()
   from C:\Windows\system32\ntdll.dll
(gdb) bt
#0  0x000000007719046a in ntdll!ZwWaitForMultipleObjects ()
   from C:\Windows\system32\ntdll.dll
#1  0x000007fefae3a8af in timeEndPeriod () from C:\Windows\system32\winmm.dll
#2  0x00000000006bc860 in chardevs ()
#3  0x00000000000000a0 in ?? ()
#4  0x000007fefae60400 in waveOutGetID () from C:\Windows\system32\winmm.dll
#5  0x0000000000000000 in ?? ()
(gdb) t 4


waveOutGetID ... I think is causing my crash. Not sure thought. I've also switched to rebuilding with -O1 flags instead of -O2, as I know that used to annoy the win32 build of Qemu in coroutines-win32.c ... But I get the same crash.

I guess all that is left is to try forcing SDL audio "--audio-drv-list=sdl" or switching to the new/slower backend "--enable-tcg-interpreter"

_________________
"Those who don't understand UNIX are condemned to reinvent it, poorly." – Henry Spencer


Top  Profile
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Thu Dec 19, 2013 8:44 pm 
Reply with quote
Donator
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
3407

Location
Italy

Favourite OS
Windows, OS/2, DOS
use -O0 for no optimizations

_________________
http://forum.softhistory.org


Top  Profile  WWW
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Fri Dec 20, 2013 1:52 am 
Reply with quote
FTP Access
User avatar
Offline

Joined
Wed Dec 31, 2008 7:29 pm

Posts
1427

Location
SE Asia

Favourite OS
MS-DOS 3.30a & Windows/386!
TheCollector1988 wrote:
use -O0 for no optimizations


what versions are you using? gcc? glib2?

I'm going to trash all my stuff and rebuild... qemu & glib as O0 and see how that goes.

_________________
"Those who don't understand UNIX are condemned to reinvent it, poorly." – Henry Spencer


Top  Profile
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Fri Dec 20, 2013 2:01 pm 
Reply with quote
Donator
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
3407

Location
Italy

Favourite OS
Windows, OS/2, DOS
louisw3 wrote:
TheCollector1988 wrote:
use -O0 for no optimizations


what versions are you using? gcc? glib2?

I'm going to trash all my stuff and rebuild... qemu & glib as O0 and see how that goes.


gcc 4.8.1 and glib 2.39.0 with MinGW (not MinGW-builds)

_________________
http://forum.softhistory.org


Top  Profile  WWW
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Fri Dec 20, 2013 4:46 pm 
Reply with quote
FTP Access
User avatar
Offline

Joined
Wed Dec 31, 2008 7:29 pm

Posts
1427

Location
SE Asia

Favourite OS
MS-DOS 3.30a & Windows/386!
TheCollector1988 wrote:
louisw3 wrote:
TheCollector1988 wrote:
use -O0 for no optimizations


what versions are you using? gcc? glib2?

I'm going to trash all my stuff and rebuild... qemu & glib as O0 and see how that goes.


gcc 4.8.1 and glib 2.39.0 with MinGW (not MinGW-builds)


Ok I'll try those... on the rebuild glib phase I get a bunch of undefined crap... and of course if it does work, it'll just fail as un spectacularly as always...

can you build qemu 1.7.0? I'm trying a bunch of versions, but as always a known working thing is so much easier to start with before deviating.

_________________
"Those who don't understand UNIX are condemned to reinvent it, poorly." – Henry Spencer


Top  Profile
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Fri Dec 27, 2013 3:03 am 
Reply with quote
FTP Access
Offline

Joined
Sun Sep 08, 2013 8:56 pm

Posts
456
Thanks for this tutorial. I will surely refer to it when I get to download QEMU.

But, really, couldn't they have a separate EXE for noobs?


Top  Profile
 PostPost subject: Re: How to compile QEMU on Win64        Posted: Sun May 04, 2014 12:48 am 
Reply with quote
Offline

Joined
Mon Nov 11, 2013 11:59 pm

Posts
5

Favourite OS
Debian 2.6.32-042stab079.5
DJ Deedahx wrote:
Thanks for this tutorial. I will surely refer to it when I get to download QEMU.

But, really, couldn't they have a separate EXE for noobs?


Isn't this what you're looking for? http://qemu.weilnetz.de/w64/


Top  Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ] 




Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

All views expressed in these forums are those of the author and do not necessarily represent the views of the BetaArchive site owner.

Powered by phpBB® Forum Software © phpBB Group

Copyright © 2006-2018

 

Sitemap | XML | RSS