[CentOS-virt] Re: [kvm-devel] [RFC] let kvm be compiled with gcc4 and prevent users to shoot themselves in the foot while doing so (was Re: [ kvm-Bugs-1807620 ] KVM's --disable-gcc-check doesn't work)

Sun Oct 7 22:18:27 UTC 2007
Jim Paris <jim at jtan.com>

Carlo Marcelo Arenas Belon wrote:
> And considering also there might be other yet unknown bugs because of gcc4, it
> is most likely better to stick to use gcc-3.x, unless there is really no other
> option.
> 
> For cases where no compat-gcc package is provided (like in OpenSUSE) then the
> following is IMHO the next best approach to force users to get gcc-3.x
> compiler installed from source just to be able to compile kvm.

This will probably become more of a problem over time.  GCC 3 is
slated to be removed from the next Debian release:
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440425
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440430

> PS. please let me know what you think about it and if interested so I can
> provide the 3 patches (or more if more changes are needed) in a [PATCH] 
> series for easy git-am'ing
> 
> +  if test $check_gcc = "no" ; then
> +    if gcc -v 2>&1 | grep -q 'gcc *version *4\.[0-3]\.[0-9]'; then
> +      echo "#define USE_GCC4 1" >> $config_h
> +    fi
> +  fi

Something like

#if __GNUC__ >= 4

in the code would be simpler.

-jim