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