From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KlOqh-0008Pe-VW for qemu-devel@nongnu.org; Thu, 02 Oct 2008 10:08:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KlOqh-0008Oy-72 for qemu-devel@nongnu.org; Thu, 02 Oct 2008 10:08:11 -0400 Received: from [199.232.76.173] (port=60779 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KlOqh-0008Ov-2F for qemu-devel@nongnu.org; Thu, 02 Oct 2008 10:08:11 -0400 Received: from mx2.redhat.com ([66.187.237.31]:50359) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KlOqg-0001mw-Lr for qemu-devel@nongnu.org; Thu, 02 Oct 2008 10:08:10 -0400 Message-ID: <48E4D5C5.8080107@redhat.com> Date: Thu, 02 Oct 2008 16:08:05 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu. References: <1222870375-13489-1-git-send-email-kraxel@redhat.com> <20081002082137.GA25959@lst.de> <48E4C2B1.7010108@redhat.com> <20081002125526.GA6552@lst.de> <48E4C967.1070407@redhat.com> <20081002131753.GA7838@lst.de> In-Reply-To: <20081002131753.GA7838@lst.de> Content-Type: multipart/mixed; boundary="------------030906070801050507010907" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------030906070801050507010907 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Christoph Hellwig wrote: > cgcc is a drop-in wrapper that calls both gcc and sparse. So you just > set your compiler to cgcc before configure or in the Makefile and then > both sparse and gcc get run. The attached configure patch enabled that in case sparse is installed. Should also get cross-builds right. Only buildsystem stuff for now, no bitwise annotations (yet). Oh joy, I get sparse warnings and errors(!) for the system headers then. Disabled the most noisy stuff for now. Comments? Gerd --------------030906070801050507010907 Content-Type: text/plain; name="qemu-sparse.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-sparse.diff" diff --git a/configure b/configure index 9c8ed81..3f3e0f7 100755 --- a/configure +++ b/configure @@ -85,6 +85,7 @@ case "$cpu" in ;; esac gprof="no" +sparse="yes" bigendian="no" mingw32="no" EXESUF="" @@ -286,6 +287,8 @@ for opt do ;; --audio-drv-list=*) audio_drv_list="$optarg" ;; + --disable-sparse) sparse="no" + ;; --disable-vnc-tls) vnc_tls="no" ;; --disable-slirp) slirp="no" @@ -425,6 +428,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 +540,10 @@ EOF fi fi +if test ! -x "$(which cgcc 2>/dev/null)"; then + sparse="no" +fi + # # Solaris specific configure tool chain decisions # @@ -1007,6 +1015,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 +1165,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 --------------030906070801050507010907--