cross compiling kvm
hello,
can someone give me an information regarding the cross compile ability of kvm (especially for qemu)?
Which is the first version of kvm, which is considered to be able to cross compile?
I tried KVM-28, which failed totally to cross-compile and I used KVM-53, which already had better support to cross compile, but still is not perfect (makes some assumptions about the host system, e.g. sdl-config).
With some minor changes in the configure script for qemu I got kvm-53 cross compiled. Unfortunatly kvm-53 doesn't run wit the preemption patches for 2.6.21.6-rt21 but this is another question for later...
Of course, it can be possible, that I do something totally wrong.
This is my configure call:
./configure --arch=i386 --cross-prefix=/opt/crosstool/i686-pentium-linux-gnu/\
gcc-3.4.3-glibc-2.3.3/bin/i686-pentium-linux-gnu- \
--kerneldir=/home/gerdko/thinkiod_work/linux --disable-vnc-tls \
--prefix=/home/gerdko/thinkiod_work/install
you might ask, why I use a cross compiler for x86? Well, I want to use kvm on an embedded device, which doesn't have local gcc installed, so I need to compile everything on another host.
greetings,
gerd
Kontron Modular Computers GmbH
Geschaeftsfuehrer / Managing Directors: Ulrich Gehrmann, Thomas Sabisch Sitz der Gesellschaft / Registered Office: Kaufbeuren, Rechtsform / Legal: GmbH Amtsgericht / Local District Court Kempten, HRB Nr. / Trade Register No. 6195
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
A message that is not in the archive (sent off-list or not yet received): 200711261157.31353.gerd.koenig-2UyDCMiLNfhBDgjK7y7TUQ@public.gmane.org
Quoted 6 lines · Gerd Koenig
hello,
can someone give me an information regarding the cross compile ability of kvm (especially for qemu)?
Which is the first version of kvm, which is considered to be able to cross compile?
It would be one of the newer versions. I started to sending cross compile stuff probably around kvm-47 timeframe (I barely remember). Definitely not kvm-28 though.
Quoted 16 lines
I tried KVM-28, which failed totally to cross-compile and I used KVM-53, which already had better support to cross compile, but still is not perfect (makes some assumptions about the host system, e.g. sdl-config).
With some minor changes in the configure script for qemu I got kvm-53 cross compiled. Unfortunatly kvm-53 doesn't run wit the preemption patches for 2.6.21.6-rt21 but this is another question for later...Of course, it can be possible, that I do something totally wrong.
This is my configure call:
./configure --arch=i386 --cross-prefix=/opt/crosstool/i686-pentium-linux-gnu/\
gcc-3.4.3-glibc-2.3.3/bin/i686-pentium-linux-gnu- \
--kerneldir=/home/gerdko/thinkiod_work/linux --disable-vnc-tls \
--prefix=/home/gerdko/thinkiod_work/install
Quoted 3 lines
you might ask, why I use a cross compiler for x86? Well, I want to use kvm on an embedded device, which doesn't have local gcc installed, so I need to compile everything on another host.
I have found that your going to want to add "--with-patched-kernel" to your command line also.
To solve your SDL issue you probably want to cross compile a version SDL in a directory .. then add to the --qemu-cflags option & --qemu-ldflags. Same whould go for stuff like ZLib.
./configure --arch=i386 --cross-prefix=/opt/crosstool/i686-pentium-linux-gnu/\
gcc-3.4.3-glibc-2.3.3/bin/i686-pentium-linux-gnu- \
--kerneldir=/home/gerdko/thinkiod_work/linux --disable-vnc-tls \
--prefix=/home/gerdko/thinkiod_work/install \
--with-patched-kernel \
--qemu-cflags="--static -I <SDL_DIR>/include -I <zlib_dir>/lib" \
--qemu-ldflags="-L <SDL_DIR>/lib -L <zlib_dir>/include"
Another thing that you need to sneak in is that your going to need is adding "--static" flag into the qemu compilation (which I do in --qemu-cflags in the example).
Cross compiling qemu is a little bit of a pain.due to the external dependencies. But it is possible.
Now just to add some more info to be over verbose. Way back we hacked something together for powerpc and we had to manually compile cross compile qemu doing the following:
export LDFLAGS="-L/home/public/zlib-ppc/lib"
export CFLAGS="-I/home/public/zlib-ppc/include"
./configure \
--target-list=ppcemb-softmmu \
--cpu=powerpc \
--disable-gcc-check \
--disable-sdl \
--disable-gfx-check \
--disable-kqemu \
--cpu=powerpc \
--cross-prefix=powerpc-440-linux-gnu- \
--staticWe didn't use SDL, but we did run into the same problem with zlib. Then we just copied the executable over.
Hope that helps.
Quoted 11 lines
greetings,
gerdKontron Modular Computers GmbH
Geschaeftsfuehrer / Managing Directors: Ulrich Gehrmann, Thomas Sabisch Sitz der Gesellschaft / Registered Office: Kaufbeuren, Rechtsform / Legal: GmbH Amtsgericht / Local District Court Kempten, HRB Nr. / Trade Register No. 6195
Quoted 8 lines
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Hi Jerone,
Quoted 10 lines · Jerone Young
Quoted 4 lines · Gerd Koenig
hello,
Which is the first version of kvm, which is considered to be able to cross compile?
It would be one of the newer versions. I started to sending cross compile stuff probably around kvm-47 timeframe (I barely remember). Definitely not kvm-28 though.
thanks for the info! So I will continue to work with kvm-53. The thing is, that some people say, that it is necessary to use a patched version of KVM by using it with the realtime preemption patches. But this is an issue I will investigate after a successful installation of kvm on our target.
Quoted 9 lines
Quoted 9 lines
Of course, it can be possible, that I do something totally wrong.
This is my configure call:
./configure --arch=i386 --cross-prefix=/opt/crosstool/i686-pentium-linux-gnu/\
gcc-3.4.3-glibc-2.3.3/bin/i686-pentium-linux-gnu- \
--kerneldir=/home/gerdko/thinkiod_work/linux --disable-vnc-tls \
--prefix=/home/gerdko/thinkiod_work/install
Quoted 7 lines
Quoted 3 lines
you might ask, why I use a cross compiler for x86? Well, I want to use kvm on an embedded device, which doesn't have local gcc installed, so I need to compile everything on another host.
I have found that your going to want to add "--with-patched-kernel" to your command line also.
Why is this so? I understood, if I want to compile the kvm package, including the kernel modules, I don't have to use the "--with-patched-kernel". Am I wrong? I'm a bit puzzled at the moment, as it seems, that
the "--with-patched-kernel" switch is incompatible with "--kerneldir" ?? kerneldir is a path to my patched 2.6.21.6-rt21 preemptible-kernel for our target, by the way.
Quoted 5 lines
To solve your SDL issue you probably want to cross compile a version SDL in a directory .. then add to the --qemu-cflags option & --qemu-ldflags. Same whould go for stuff like ZLib.
yes, I did so. And it seems to work.
But there is still a problem with the configure script, as it assumes to search for sdl-config on the development host. A minor problem though and easy to fix...
I could send a patch afterwards, when I found a common solution...
Quoted 10 lines
./configure --arch=i386 --cross-prefix=/opt/crosstool/i686-pentium-linux-gnu/\
gcc-3.4.3-glibc-2.3.3/bin/i686-pentium-linux-gnu- \
--kerneldir=/home/gerdko/thinkiod_work/linux --disable-vnc-tls \
--prefix=/home/gerdko/thinkiod_work/install \
--with-patched-kernel \
--qemu-cflags="--static -I <SDL_DIR>/include -I <zlib_dir>/lib" \
--qemu-ldflags="-L <SDL_DIR>/lib -L <zlib_dir>/include"
Quoted 6 lines
Another thing that you need to sneak in is that your going to need is adding "--static" flag into the qemu compilation (which I do in --qemu-cflags in the example).
Cross compiling qemu is a little bit of a pain.due to the external dependencies. But it is possible.
phew. yes it is ;-)
Quoted 1 line
Hope that helps.
thank you!
greetings,
gerd
Kontron Modular Computers GmbH
Geschaeftsfuehrer / Managing Directors: Ulrich Gehrmann, Thomas Sabisch Sitz der Gesellschaft / Registered Office: Kaufbeuren, Rechtsform / Legal: GmbH Amtsgericht / Local District Court Kempten, HRB Nr. / Trade Register No. 6195
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/