From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7vgq-0003Io-VA for qemu-devel@nongnu.org; Wed, 14 Mar 2012 17:25:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7vgo-0001kP-Jh for qemu-devel@nongnu.org; Wed, 14 Mar 2012 17:25:00 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:34371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7vgo-0001kB-DA for qemu-devel@nongnu.org; Wed, 14 Mar 2012 17:24:58 -0400 Message-ID: <4F610CA6.8030903@weilnetz.de> Date: Wed, 14 Mar 2012 22:24:54 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1331757449-20873-1-git-send-email-stuart.yoder@freescale.com> In-Reply-To: <1331757449-20873-1-git-send-email-stuart.yoder@freescale.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH][v2] configure: change endianness test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stuart Yoder Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, paul@codesourcery.com Am 14.03.2012 21:37, schrieb Stuart Yoder: > From: Stuart Yoder > > 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 > --- > > -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 > -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 > The patch fixes all issues which were addressed in the discussion, therefore Reviewed-by: Stefan Weil Nevertheless the old test which was removed still might be useful and could be re-added later in a modified form: Contrary to Paul's argument QEMU does not only support a fixed set of known host architectures, but also unknown hosts (via TCI). For those, there remains a small chance that they are big endian and that they get the wrong endianness now. TCI is still experimental, so I don't care too much about this small deficit. Regards, Stefan W.