Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Cg4Re-0000wV-FR for qemu-devel@nongnu.org; Sun, 19 Dec 2004 12:02:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Cg4Rb-0000vT-S1 for qemu-devel@nongnu.org; Sun, 19 Dec 2004 12:02:08 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cg4Rb-0000vO-7s for qemu-devel@nongnu.org; Sun, 19 Dec 2004 12:02:07 -0500 Received: from [212.238.201.82] (helo=xi.wantstofly.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cg46f-0004Yu-Fo for qemu-devel@nongnu.org; Sun, 19 Dec 2004 11:40:29 -0500 Date: Sun, 19 Dec 2004 17:40:28 +0100 From: Lennert Buytenhek Message-ID: <20041219164028.GA10631@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] also build big-endian version of qemu-arm Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, This patches causes a big-endian version of qemu-arm (called qemu-armeb) to be built alongside the regular little-endian one. Lightly tested with some simple static big-endian binaries. Also adds a binfmt_misc signature, and adds support for building on armv4b (untested.) cheers, Lennert diff -urN qemu-20041218.orig/configure qemu-20041218.mild/configure --- qemu-20041218.orig/configure 2004-11-14 22:20:23.000000000 +0100 +++ qemu-20041218.mild/configure 2004-12-19 17:00:55.688538798 +0100 @@ -27,11 +27,14 @@ make="make" strip="strip" cpu=`uname -m` -target_list="i386-user i386 i386-softmmu arm-user sparc-user ppc-user ppc-softmmu sparc-softmmu" +target_list="i386-user i386 i386-softmmu arm-user armeb-user sparc-user ppc-user ppc-softmmu sparc-softmmu" case "$cpu" in i386|i486|i586|i686|i86pc|BePC) cpu="i386" ;; + armv4b) + cpu="armv4b" + ;; armv4l) cpu="armv4l" ;; @@ -205,7 +208,7 @@ else # if cross compiling, cannot launch a program, so make a static guess -if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k"; then +if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then bigendian="yes" fi @@ -383,6 +386,9 @@ elif test "$cpu" = "amd64" ; then echo "ARCH=amd64" >> $config_mak echo "#define HOST_AMD64 1" >> $config_h +elif test "$cpu" = "armv4b" ; then + echo "ARCH=arm" >> $config_mak + echo "#define HOST_ARM 1" >> $config_h elif test "$cpu" = "armv4l" ; then echo "ARCH=arm" >> $config_mak echo "#define HOST_ARM 1" >> $config_h @@ -482,6 +488,7 @@ config_h=$target_dir/config.h target_cpu=`echo $target | cut -d '-' -f 1` target_bigendian="no" +[ "$target_cpu" = "armeb" ] && target_bigendian=yes [ "$target_cpu" = "sparc" ] && target_bigendian=yes [ "$target_cpu" = "ppc" ] && target_bigendian=yes target_softmmu="no" @@ -499,6 +506,9 @@ if test "$target" = "arm-user" ; then mkdir -p $target_dir/nwfpe fi +if test "$target" = "armeb-user" ; then + mkdir -p $target_dir/nwfpe +fi if test "$target_user_only" = "no" ; then mkdir -p $target_dir/slirp fi @@ -523,6 +533,10 @@ echo "TARGET_ARCH=arm" >> $config_mak echo "#define TARGET_ARCH \"arm\"" >> $config_h echo "#define TARGET_ARM 1" >> $config_h +elif test "$target_cpu" = "armeb" ; then + echo "TARGET_ARCH=arm" >> $config_mak + echo "#define TARGET_ARCH \"arm\"" >> $config_h + echo "#define TARGET_ARM 1" >> $config_h elif test "$target_cpu" = "sparc" ; then echo "TARGET_ARCH=sparc" >> $config_mak echo "#define TARGET_ARCH \"sparc\"" >> $config_h diff -urN qemu-20041218.orig/.cvsignore qemu-20041218.mild/.cvsignore --- qemu-20041218.orig/.cvsignore 2004-11-16 01:00:04.000000000 +0100 +++ qemu-20041218.mild/.cvsignore 2004-12-19 17:22:14.687021448 +0100 @@ -1,4 +1,5 @@ arm-user +armeb-user config-host.* dyngen i386 diff -urN qemu-20041218.orig/Makefile.target qemu-20041218.mild/Makefile.target --- qemu-20041218.orig/Makefile.target 2004-12-18 01:00:14.000000000 +0100 +++ qemu-20041218.mild/Makefile.target 2004-12-19 17:21:46.510777933 +0100 @@ -13,7 +13,15 @@ HELPER_CFLAGS=$(CFLAGS) DYNGEN=../dyngen$(EXESUF) # user emulator name -QEMU_USER=qemu-$(TARGET_ARCH) +ifeq ($(TARGET_ARCH),arm) + ifeq ($(TARGET_WORDS_BIGENDIAN),yes) + QEMU_USER=qemu-armeb + else + QEMU_USER=qemu-arm + endif +else + QEMU_USER=qemu-$(TARGET_ARCH) +endif # system emulator name ifdef CONFIG_SOFTMMU ifeq ($(TARGET_ARCH), i386) diff -urN qemu-20041218.orig/qemu-binfmt-conf.sh qemu-20041218.mild/qemu-binfmt-conf.sh --- qemu-20041218.orig/qemu-binfmt-conf.sh 2004-03-28 00:58:14.000000000 +0100 +++ qemu-20041218.mild/qemu-binfmt-conf.sh 2004-12-19 17:22:35.053306195 +0100 @@ -25,6 +25,7 @@ fi if [ $cpu != "arm" ] ; then echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register + echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff:/usr/local/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register fi if [ $cpu != "sparc" ] ; then echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff:/usr/local/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register