Qemu is known to not build properly with gcc4.  Despite this being documented 
in several places users frequent still get it wrong.  This is probably the 
second most frequent question (the first, equally dumb problem being
"I can't make ping work with -user-net").

The attached patch adds a configure check for gcc4.

Paul
=== configure
==================================================================
--- configure	(revision 1789)
+++ configure	(local)
@@ -88,6 +88,7 @@
 kernel_path=""
 cocoa="no"
 check_gfx="yes"
+check_gcc="yes"
 
 # OS specific
 targetos=`uname -s`
@@ -200,6 +201,8 @@
   ;;
   --disable-gfx-check) check_gfx="no"
   ;;
+  --disable-gcc-check) check_gcc="no"
+  ;;
   esac
 done
 
@@ -277,6 +280,23 @@
    have_gcc3_options="yes"
 fi
 
+# Check for gcc4
+if test "$check_gcc" = "yes" ; then
+    cat > $TMPC <<EOF
+#if __GNUC__ >= 4
+#error gcc4
+#endif
+int main(){return 0;}
+EOF
+    if ! $cc -o $TMPO $TMPC 2>/dev/null ; then
+        echo "ERROR: \"$cc\" looks like gcc 4.x"
+        echo "QEMU is known to have problems when compiled with gcc 4.x"
+        echo "It is recommended they you use gcc 3.x to build QEMU"
+        echo "To use this compiler anyway, configure with --disable-gcc-check"
+        exit 1;
+    fi
+fi
+
 ##########################################
 # SDL probe
 
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to