qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu.


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu.
Date: Thu, 02 Oct 2008 16:08:05 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]