On Sun, Mar 10, 2013 at 2:59 PM, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 10 March 2013 14:36, Leonid Bloch <l...@tx.technion.ac.il> wrote: >> I want to cross compile QEMU itself to run on ARM, but all my searches >> lead me to tutorials for cross compiling other programs for ARM and >> testing them with QEMU, which is not what I need. >> The only relevant link I found was this: >> http://lists.gnu.org/archive/html/qemu-devel/2011-05/msg00099.html >> But this doesn't work for me as well. >> >> I am using Buildroot as my toolchain, and the farthest I got was: >> $ ./configure --cpu=armv7hl --static --cc=arm-linux-cc > > Don't specify --cpu : this is almost always going to break things, > and you should just let configure work it out based on your compiler. > Don't just specify --cc, because we want to run other cross tools > too. Instead, use --cross-prefix=arm-linux-gnueabi- (or whatever > the correct prefix is for your toolchain). > You'll also need to have a cross-build environment with the minimal > set of libraries/includes that QEMU needs to build, including > but not limited to zlib and glib. How to set this up depends on > what your cross compilation setup is; in this case you'll need to > ask the buildroot folks. > > Question for the qemu-devel folks: does anybody have a situation > where they genuinely need to pass --cpu to configure (ie the > autodetection is wrong or insufficient)? [configure does mention > one case, which is when cross-compiling to x86 Darwin and SunOS, > but the latter at least is busted anyway because later on we > do things based on SunOS uname results which there is no way > to override for the cross-compile case.] I'm tempted to suggest > we should drop --cpu entirely...
Checking config files, I'm using --cpu to build for Sparc32 and Sparc64 on Sparc/Linux where the compiler can build either version with -m32/-m64, also to build in i386 chroot in x86_64 host but it looks like here --cpu is redundant. > > -- PMM >