All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stuart Yoder <stuart.yoder@freescale.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, paul@codesourcery.com,
	Stuart Yoder <stuart.yoder@freescale.com>
Subject: [Qemu-devel] [PATCH][v2] configure: change endianness test
Date: Wed, 14 Mar 2012 14:37:29 -0600	[thread overview]
Message-ID: <1331757449-20873-1-git-send-email-stuart.yoder@freescale.com> (raw)

From: Stuart Yoder <stuart.yoder@freescale.com>

Remove the runtime check for endianness, and for platforms
that can be bit or little endian do a compile time check.

This resolves an issue encountered building QEMU
under Yocto which was not setting --cross-prefix.

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---

-v2: removed the dynamic runtime test completely,
     added compile time check for mips

 configure |   33 ++++++++-------------------------
 1 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/configure b/configure
index fe4fc4f..d9c5999 100755
--- a/configure
+++ b/configure
@@ -1269,41 +1269,24 @@ feature_not_found() {
   exit 1;
 }
 
-if test -z "$cross_prefix" ; then
-
-# ---
-# big/little endian test
-cat > $TMPC << EOF
-#include <inttypes.h>
-int main(int argc, char ** argv){
-        volatile uint32_t i=0x01234567;
-        return (*((uint8_t*)(&i))) == 0x67;
-}
-EOF
-
-if compile_prog "" "" ; then
-$TMPE && bigendian="yes"
-else
-echo big/little test failed
-fi
-
-else
-
-# if cross compiling, cannot launch a program, so make a static guess
+##########################################
+# endianness check
 case "$cpu" in
   arm)
-    # ARM can be either way; ask the compiler which one we are
     if check_define __ARMEB__; then
       bigendian=yes
     fi
   ;;
-  hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
+  mips|mips64)
+    if check_define __MIPSEB__; then
+      bigendian=yes
+    fi
+  ;;
+  hppa|m68k|ppc|ppc64|s390|s390x|sparc|sparc64)
     bigendian=yes
   ;;
 esac
 
-fi
-
 ##########################################
 # NPTL probe
 
-- 
1.7.3.4

             reply	other threads:[~2012-03-14 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14 20:37 Stuart Yoder [this message]
2012-03-14 21:24 ` [Qemu-devel] [PATCH][v2] configure: change endianness test Stefan Weil
2012-03-14 21:37   ` Peter Maydell
2012-03-14 21:42     ` Stefan Weil
2012-03-14 21:49   ` Paul Brook

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=1331757449-20873-1-git-send-email-stuart.yoder@freescale.com \
    --to=stuart.yoder@freescale.com \
    --cc=aliguori@us.ibm.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.