qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [5364] Avoid (some) ppc cross-compilation problems


From: malc
Subject: [Qemu-devel] [5364] Avoid (some) ppc cross-compilation problems
Date: Tue, 30 Sep 2008 19:44:33 +0000

Revision: 5364
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5364
Author:   malc
Date:     2008-09-30 19:44:32 +0000 (Tue, 30 Sep 2008)

Log Message:
-----------
Avoid (some) ppc cross-compilation problems

[..snip..]

A recent kvm merge with qemu brought code for 64bit power that broke cross
compilation. The issue is caused by configure trying to execute target
architecture binaries where configure is executed.

[..snip..]

The patch is based on Hollis's Blanchard idea.

Modified Paths:
--------------
    trunk/configure

Modified: trunk/configure
===================================================================
--- trunk/configure     2008-09-30 18:18:27 UTC (rev 5363)
+++ trunk/configure     2008-09-30 19:44:32 UTC (rev 5364)
@@ -15,6 +15,7 @@
 TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
 TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
 TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
+TMPI="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i"
 
 # default parameters
 prefix=""
@@ -673,17 +674,8 @@
 
 # ppc specific hostlongbits selection
 if test "$cpu" = "powerpc" ; then
-    cat > $TMPC <<EOF
-int main(void){return sizeof(long);}
-EOF
-
-    if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null; then
-        $TMPE
-        case $? in
-            4) hostlongbits="32";;
-            8) hostlongbits="64";;
-            *) echo "Couldn't determine bits per long value"; exit 1;;
-        esac
+    if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev/null </dev/null; then
+        grep -q __powerpc64__ $TMPI && hostlongbits=64
     else
         echo hostlongbits test failed
         exit 1
@@ -1604,4 +1596,4 @@
     done
 fi
 
-rm -f $TMPO $TMPC $TMPE $TMPS
+rm -f $TMPO $TMPC $TMPE $TMPS $TMPI






reply via email to

[Prev in Thread] Current Thread [Next in Thread]