From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kn98y-0006hp-KX for qemu-devel@nongnu.org; Tue, 07 Oct 2008 05:46:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kn98u-0006fd-G2 for qemu-devel@nongnu.org; Tue, 07 Oct 2008 05:46:15 -0400 Received: from [199.232.76.173] (port=48735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kn98u-0006fV-3j for qemu-devel@nongnu.org; Tue, 07 Oct 2008 05:46:12 -0400 Received: from mx2.redhat.com ([66.187.237.31]:40736) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kn98t-0007DN-Oj for qemu-devel@nongnu.org; Tue, 07 Oct 2008 05:46:12 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m979kAxu016748 for ; Tue, 7 Oct 2008 05:46:10 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m979k9du025100 for ; Tue, 7 Oct 2008 05:46:10 -0400 Received: from zweiblum.travel.kraxel.org (vpn-4-165.str.redhat.com [10.32.4.165]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m979k81D021329 for ; Tue, 7 Oct 2008 05:46:09 -0400 Message-ID: <48EB2FDF.8030603@redhat.com> Date: Tue, 07 Oct 2008 11:46:07 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050900020105020508050200" Subject: [Qemu-devel] [patch] Add spare checker support to the build system 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. --------------050900020105020508050200 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, This adds support for running the sparse checker during the build process. Left it off by default for now, build becomes very noisy with sparse checking turned on as it has to complain alot (partly even in the system headers!). The qemu code base needs quite some cleanups before we should consider turning it on by default. please apply, Gerd --------------050900020105020508050200 Content-Type: text/plain; name="0038-build-system-sparse-checker-support.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0038-build-system-sparse-checker-support.patch" >>From aa926354ee308d46fdbb92667b6ed6f6f9b11ce7 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 7 Oct 2008 11:22:11 +0200 Subject: [PATCH] build system: sparse checker support. Signed-off-by: Gerd Hoffmann --- configure | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 9c8ed81..5b23b33 100755 --- a/configure +++ b/configure @@ -85,6 +85,7 @@ case "$cpu" in ;; esac gprof="no" +sparse="no" bigendian="no" mingw32="no" EXESUF="" @@ -286,6 +287,10 @@ for opt do ;; --audio-drv-list=*) audio_drv_list="$optarg" ;; + --enable-sparse) sparse="yes" + ;; + --disable-sparse) sparse="no" + ;; --disable-vnc-tls) vnc_tls="no" ;; --disable-slirp) slirp="no" @@ -425,6 +430,7 @@ echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." echo " --make=MAKE use specified make [$make]" echo " --install=INSTALL use specified install [$install]" echo " --static enable static build [$static]" +echo " --disable-sparse disable sparse checker" echo " --disable-werror disable compilation abort on warning" echo " --disable-sdl disable SDL" echo " --enable-cocoa enable COCOA (Mac OS X only)" @@ -536,6 +542,10 @@ EOF fi fi +if test ! -x "$(which cgcc 2>/dev/null)"; then + sparse="no" +fi + # # Solaris specific configure tool chain decisions # @@ -1007,6 +1017,7 @@ echo "host CPU $cpu" echo "host big endian $bigendian" echo "target list $target_list" echo "gprof enabled $gprof" +echo "sparse enabled $sparse" echo "profiler $profiler" echo "static build $static" echo "-Werror enabled $werror" @@ -1156,6 +1167,11 @@ case "$cpu" in exit 1 ;; esac +if test "$sparse" = "yes" ; then + echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak + echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak + echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak +fi if test "$bigendian" = "yes" ; then echo "WORDS_BIGENDIAN=yes" >> $config_mak echo "#define WORDS_BIGENDIAN 1" >> $config_h -- 1.5.5.1 --------------050900020105020508050200--