From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GwUfM-00058B-Vv for qemu-devel@nongnu.org; Mon, 18 Dec 2006 21:25:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GwUfL-00057T-FR for qemu-devel@nongnu.org; Mon, 18 Dec 2006 21:25:16 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GwUfL-00057N-CU for qemu-devel@nongnu.org; Mon, 18 Dec 2006 21:25:15 -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 1GwUfL-0002vN-6P for qemu-devel@nongnu.org; Mon, 18 Dec 2006 21:25:15 -0500 Received: from [192.168.1.102] (cpe-70-112-17-156.austin.res.rr.com [70.112.17.156]) (authenticated bits=0) by mail.cs.utexas.edu (8.13.8/8.13.8) with ESMTP id kBJ2PBGX012723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 18 Dec 2006 20:25:13 -0600 (CST) Message-ID: <45874D81.1090508@cs.utexas.edu> Date: Mon, 18 Dec 2006 20:25:05 -0600 From: Anthony Liguori MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000307020702040202050209" Subject: [Qemu-devel] [PATCH] Improve gcc 3 checking Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------000307020702040202050209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In Xen, we use a single top level Makefile to build everything. This means we automatically kick off the configure script. It would be nice if QEMU's configure did a better job of finding existing GCC 3.x installs so that the user didn't have to manually specific the location. The attached patch adds a white list to configure to check for various versions of GCC 3.x. The white list so far covers the various versions of GCC in recent versions of OpenSUSE, Fedora, RHEL, and Ubuntu (presumably also Debian). I don't think this patch will impact any of the other platforms but getting some testing first on weird platforms (Solaris and Win32 especially) would be helpful. Regards, Anthony Liguori --------------000307020702040202050209 Content-Type: text/x-patch; name="qemu-gcc-3x.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-gcc-3x.diff" diff -r ca36b7b88df2 configure --- a/configure Mon Dec 18 18:57:19 2006 -0600 +++ b/configure Mon Dec 18 20:18:01 2006 -0600 @@ -22,6 +22,7 @@ static="no" static="no" cross_prefix="" cc="gcc" +gcc3_list="gcc32 gcc33 gcc34 gcc-3.2 gcc-3.3 gcc-3.4" host_cc="gcc" ar="ar" make="make" @@ -311,6 +312,41 @@ 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 check_cc "$cc" ; then + echo "WARNING: \"$cc\" looks like gcc 4.x" + echo "Looking for gcc 3.x" + found_compat_cc="no" + 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!" + 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 +450,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 ########################################## --------------000307020702040202050209--