public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Gerd Koenig <gerd.koenig-2UyDCMiLNfhBDgjK7y7TUQ@public.gmane.org>
Cc: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: cross compiling kvm
Date: Mon, 26 Nov 2007 10:03:46 -0600	[thread overview]
Message-ID: <1196093026.16469.29.camel@thinkpad> (raw)
In-Reply-To: <200711261157.31353.gerd.koenig-2UyDCMiLNfhBDgjK7y7TUQ@public.gmane.org>


On Mon, 2007-11-26 at 11:57 +0100, Gerd Koenig wrote:
> 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.

> 
> 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.

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- \
               --static
        
We didn't use SDL, but we did run into the same problem with zlib. Then
we just copied the executable over.

Hope that helps.

> 
> 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/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> 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/

  parent reply	other threads:[~2007-11-26 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 10:57 cross compiling kvm Gerd Koenig
     [not found] ` <200711261157.31353.gerd.koenig-2UyDCMiLNfhBDgjK7y7TUQ@public.gmane.org>
2007-11-26 16:03   ` Jerone Young [this message]
2007-11-27 12:15     ` Gerd Koenig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1196093026.16469.29.camel@thinkpad \
    --to=jyoung5-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=gerd.koenig-2UyDCMiLNfhBDgjK7y7TUQ@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox