Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AwtPm-0003FC-HK for qemu-devel@nongnu.org; Fri, 27 Feb 2004 20:37:14 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AwtPB-0002QT-NI for qemu-devel@nongnu.org; Fri, 27 Feb 2004 20:37:09 -0500 Received: from [211.29.132.72] (helo=mail018.syd.optusnet.com.au) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AwtP6-0002Mp-8O for qemu-devel@nongnu.org; Fri, 27 Feb 2004 20:36:32 -0500 Received: from barney.bedrock (tooax6-123.dialup.optusnet.com.au [203.164.233.123]) by mail018.syd.optusnet.com.au (8.11.6p2/8.11.6) with ESMTP id i1S1aP523147 for ; Sat, 28 Feb 2004 12:36:25 +1100 Received: from fred.bedrock (fred.bedrock [172.16.31.2]) by barney.bedrock (8.9.3/8.8.7) with ESMTP id LAA28352 for ; Sat, 28 Feb 2004 11:36:14 +1000 From: James Boddington Date: Sat, 28 Feb 2004 11:36:14 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402281136.14662.boddingt@mpx.com.au> Subject: [Qemu-devel] qemu + chroot with non native image Reply-To: boddingt@mpx.com.au, qemu-devel@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Have been having a bit of a play. I used binfmt_misc to register qemu-ppc as the interpreter for ppc binaries. This allows me to run ppc binaries on my athlon with out having to specify qemu-ppc everytime. This seems to be usefull when cross compiling a few packages that create an intermediate step that is built for the target instead of the build host. The binary fails to run and the build process stops. Using binfmt_misc + qemu-XXX allows this step to complete and the build can finish. For example texinfo-4.4 builds a binary part way though the build process and tries to use that binary to process a few files. This binary has been cross compiled and fails to run. Using the above idea I can cross compile this package. Python 2.2.x is another offender. A python binary is built that is then used to build python proper. The 1st python won't run because it is for the wrong arch. Using binfmt_misc + qemu-ppc the build was going fine until qemu-ppc seemed to go into a loop. Qemu-ppc sat just under 100% cpu doing nothing obvious until I killed the process. Another use I have found for this is being able to chroot into a non native filesystem. I cross compile my sparc images (x86 -> sparc) because it is a lot quicker. So being able to chroot into the image is of interest to me. For this exercise I built a toolchain for ppc-unknown-linux-gnu and cross compiled a small image. Placed a static qemu-ppc in opt/bin in the image. I have not tried to see if it can self host yet. MAKEDEV bzip2 egg fileutils gcc gzip linux-headers ncurses sed tar wget bash diffutils file findutils glibc kbd make patch sh-utils texinfo zlib binutils ed filesystem gawk grep libtool mktemp procps shadow textutils /var/tmp/ppc-image, Sat Feb 28 11:19:51 (root@fred) uname -a Linux fred.bedrock 2.4.24 #3 Fri Feb 27 21:41:37 EST 2004 i686 unknown unknown GNU/Linux /var/tmp/ppc-image, Sat Feb 28 11:19:54 (root@fred) chroot . /opt/bin/qemu-ppc /bin/bash /, Sat Feb 28 01:20:03 (root@fred) uname -a Linux fred.bedrock 2.4.24 #3 Fri Feb 27 21:41:37 EST 2004 i686 unknown unknown GNU/Linux /, Sat Feb 28 01:20:08 (root@fred) file /bin/bash /bin/bash: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), stripped /, Sat Feb 28 01:20:15 (root@fred) file /usr/bin/gcc /usr/bin/gcc: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), stripped /, Sat Feb 28 01:20:23 (root@fred) /usr/bin/gcc -v Reading specs from /usr/lib/gcc-lib/ppc-unknown-linux-gnu/3.3.3/specs Configured with: ./configure --prefix=/usr --build=i686-pc-linux-gnu --host=ppc-unknown-linux-gnu --target=ppc-unknown-linux-gnu --disable-nls --enable-shared --enable-threads=posix --enable-languages=c,c++ Thread model: posix gcc version 3.3.3 -- James