Skip to contentSkip to conversation

Configure check for gcc4

PATCH In review Paul Brook 3 participants 3 messages Nov 2, 2005

lore
Share & tools
lore

Paul Brook

author
#0 lore raw

PATCH 1/1 Configure check for gcc4

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 +20 -0
@@ -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
 
#1 lore raw

configure line 297

Quoted 9 lines · Paul Brook
configure +7 -0
+    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

Just a little typo:

+ echo "It is recommended that you use gcc 3.x to build QEMU"

#2 lore raw
In reply to Paul Brook

I waited this moment since months.
+1 !

Quoted 6 lines · --- Paul Brook

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.

Kind regards,
Sylvain Petreolle (aka Usurp)
--- --- --- --- --- --- --- --- --- --- --- --- --- Tired of a proprietary Windows on your computer ? Use free ReactOS instead ( http://www.reactos.org )