From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GwVZx-0007LR-St for qemu-devel@nongnu.org; Mon, 18 Dec 2006 22:23:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GwVZx-0007Ka-4J for qemu-devel@nongnu.org; Mon, 18 Dec 2006 22:23:45 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GwVZw-0007KH-T2 for qemu-devel@nongnu.org; Mon, 18 Dec 2006 22:23:44 -0500 Received: from [128.83.139.10] (helo=mail.cs.utexas.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GwVZw-00061g-LB for qemu-devel@nongnu.org; Mon, 18 Dec 2006 22:23:44 -0500 Message-ID: <45875B34.7080802@cs.utexas.edu> Date: Mon, 18 Dec 2006 21:23:32 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Improve gcc 3 checking References: <45874D81.1090508@cs.utexas.edu> <200612190231.08331.paul@codesourcery.com> <45875558.7020501@cs.utexas.edu> <200612190309.20174.paul@codesourcery.com> In-Reply-To: <200612190309.20174.paul@codesourcery.com> Content-Type: multipart/mixed; boundary="------------010606070002040008050708" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------010606070002040008050708 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Paul Brook wrote: >> If they explicitly specific an invalid --cc=, the checks will get >> triggered (but in the past, we would have bailed). >> > > That's what I'm objecting to. If I do: > > ./configure --cc=gcc4 > > I expect configure to either use gcc4 or fail with an error. Preferably the > latter, but I'm open to persuasion. > > I don't want configure to decide it knows better and use gcc3 anyway. > Okay, it now will throw an error if you specify --cc=gcc4. Regards, Anthony Liguori > Paul > --------------010606070002040008050708 Content-Type: text/x-patch; name="qemu-gcc-3x.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-gcc-3x.diff" diff -r f928121a13c1 configure --- a/configure Mon Dec 18 20:29:34 2006 -0600 +++ b/configure Mon Dec 18 21:20:36 2006 -0600 @@ -22,6 +22,8 @@ static="no" static="no" cross_prefix="" cc="gcc" +gcc3_check="yes" +gcc3_list="gcc-3.4 gcc34 gcc-3.3 gcc33 gcc-3.2 gcc32" host_cc="gcc" ar="ar" make="make" @@ -178,6 +180,7 @@ for opt do --cross-prefix=*) cross_prefix="$optarg" ;; --cc=*) cc="$optarg" + gcc3_check="no" ;; --host-cc=*) host_cc="$optarg" ;; @@ -311,6 +314,45 @@ if test "$mingw32" = "yes" ; then oss="no" if [ "$cpu" = "i386" ] ; then kqemu="yes" + fi +fi + +# Check for gcc4, error if pre-gcc4 +if test "$check_gcc" = "yes" ; then + cat > $TMPC <&/dev/null + return $? + } + + if "$cc" -o $TMPE $TMPC 2>/dev/null ; then + echo "WARNING: \"$cc\" looks like gcc 4.x" + found_compat_cc="no" + if test "$gcc3_check" = "yes" ; then + echo "Looking for gcc 3.x" + for compat_cc in $gcc3_list ; do + if check_cc "$compat_cc" ; then + echo "Found \"$compat_cc\"" + cc="$compat_cc" + found_compat_cc="yes" + break + fi + done + if test "$found_compat_cc" = "no" ; then + echo "gcc 3.x not found!" + fi + fi + if test "$found_compat_cc" = "no" ; then + echo "QEMU is known to have problems when compiled with gcc 4.x" + echo "It is recommended that you use gcc 3.x to build QEMU" + echo "To use this compiler anyway, configure with --disable-gcc-check" + exit 1; + fi fi fi @@ -414,23 +456,6 @@ have_gcc3_options="no" have_gcc3_options="no" if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then have_gcc3_options="yes" -fi - -# Check for gcc4, error if pre-gcc4 -if test "$check_gcc" = "yes" ; then - cat > $TMPC </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 that you use gcc 3.x to build QEMU" - echo "To use this compiler anyway, configure with --disable-gcc-check" - exit 1; - fi fi ########################################## --------------010606070002040008050708--