public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: [PATCH] Allow for Cross compile of user tools
Date: Tue, 02 Oct 2007 11:48:38 -0500	[thread overview]
Message-ID: <1191343718.5905.14.camel@laptop> (raw)
In-Reply-To: <4701DE24.4030109-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

On Tue, 2007-10-02 at 07:59 +0200, Avi Kivity wrote:
> Jerone Young wrote:
> > This is the first of many patches to begin to make kvm source a lot
> > better for compiling for other architecture support (that is not x86 or
> > x86-64).
> >
> > This patch makes it possible so that someone on an x86 machine can cross
> > compile for an x86-64 machine and vice versa. So now you will have
> > config-$(arch).mak for each architecture, with specific architecture
> > rules. 
> >
> > An example of this is for compiling x86-64 on an x86 machine is:
> > make KERNELDIR=~/tmp/kvm ARCH=x86_64
> >   
> 
> This should be done via ./configure (I dislike ?= intensely).

This is something that could be done via the ./configure script. What
will need to add is ARCH=, CC=, LD= as variables as well. 

I can create a patch for this.


> 
> > This allows for someone with an x86 machine to compile for x86_64. Later
> > patches that I will be submitting will be for ppc and will make a few
> > more changes.
> >
> > What I would like though is comments on how everyone feels about this
> > approach. We are need of something like this to start ading ppc related
> > code.
> >
> >   
> 
> No problem for user/.  I'd like to see this accepted by qemu-devel as well.

Well qemu pretty much has this problem taken care of. In qemu you can
just use the autoconf system. So for our purposes with PPC development
we need to compile the binaries on an x86 machine (as the embedded
boards are of course much slower, then our super x86 machines). So you
just launch configure in qemu with the options:

./configure \
	--cpu=powerpc \
	--cross-prefix=powerpc-440-linux-gnu-

This will compile qemu for the target CPU powerpc and will use cross
compile tools with prefix "powerpc-440-linux-gnu-" that are in our PATH.
So we have for example powerpc-440-linux-gnu-gcc which is used to
compile the proper ppc binary.

All in all these patches whouldn't be needed in qemu because it already
has this problem taken care of. But the test case directory /user do not
have this problem taken care of. It assumes that you will run on the
machine that you are compiling on.

> 


-------------------------------------------------------------------------
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-10-02 16:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-01 18:56 [PATCH] Allow for Cross compile of user tools Jerone Young
2007-10-02  5:59 ` Avi Kivity
     [not found]   ` <4701DE24.4030109-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-02 16:48     ` Jerone Young [this message]

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=1191343718.5905.14.camel@laptop \
    --to=jyoung5-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@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