QEMU on FreeBSD/amd64 (patches)

Juergen Lock nox at jelal.kn-bremen.de
Fri Apr 15 12:55:57 PDT 2005


On Wed, Apr 13, 2005 at 04:35:26PM -0400, Jung-uk Kim wrote:
> I finally manage to build QEMU snapshot on FreeBSD/amd64 6-CURRENT.  

Nice!

> There's ports/emulators/qemu but it doesn't build on AMD64 for 
> several reasons, i. e., QEMU and FreeBSD are both fast moving targets 
> (esp. src/lib/msun), some long double math functions don't exist on 
> FreeBSD,

 So the replacements in files/patch-aa in the port didnt work for amd64?
(the ones #if defined(_BSD) && defined(USE_X86LDOUBLE))

>  GCC in base system doesn't build QEMU because of several 
> optimization bugs specific to AMD64, etc.
> 
> 1.  Install GCC 3.4 from ports.
> 
> Anything newer than 20050316 should work.  (Theoretically you can use 
> gcc40 newer than 20041127 but not verified.  Actually I am using 
> patched version of src/contrib/gcc. ;-)
> 
> 2.  Install following dependencies from ports:
> 
> 	devel/gmake (of course)
> 	net/samba
> 	devel/sdl12
> 
> I believe samba is optional but sdl12 is not.  It doesn't work without 
> SDL because `-nographic' option is broken.  I believe it is an 
> upstream bug (related to FreeBSD's pty or termios, i. e., fail to get 
> correct term size and segfault) but I couldn't pin-point the culprit 
> yet.  In fact, I didn't bother too much because SDL worked just 
> fine. ;-)

 Samba is needed for the -smb <dir> option (export a local dir to guest),
if you don't use that you can omit samba thats true.

>[...]
> Note 2: qemu-libmath-amd64.diff contains C99 long double math 
> functions taken from glibc-2.3.5 and modified for FreeBSD/amd64:
> 
> http://ftp.gnu.org/gnu/glibc/
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/?cvsroot=glibc
> 
> rintl()		sysdeps/i386/fpu/s_rintl.c
> atan2l()	sysdeps/i386/fpu/e_atan2l.c
> sqrtl()		sysdeps/i386/fpu/e_sqrtl.c
> llrintl()	sysdeps/x86_64/fpu/s_llrintl.S
> lrintl()	sysdeps/x86_64/fpu/s_llrintl.S
> sinl()		sysdeps/x86_64/fpu/s_sinl.S
> cosl()		sysdeps/x86_64/fpu/s_cosl.S
> tanl()		sysdeps/x86_64/fpu/s_tanl.S
> logl()		sysdeps/x86_64/fpu/e_logl.S
> powl()		sysdeps/x86_64/fpu/e_powl.S
> remainderl()	sysdeps/x86_64/fpu/e_remainderl.S
> 
> Just enough to compile QEMU snapshot until we complete C99 
> project. ;-) Similarly you can add other architectures under 
> bsd/${MACHINE_ARCH}.

 So we need different versions of these for i386 hosts?
And how about 4.x i386 hosts?  Obviously the port should still
run on those too.

	Juergen


More information about the freebsd-emulation mailing list