[Mesa-dev] [PATCH 1/5] mesa: bump required GCC version to 4.8.0

Timothy Arceri t_arceri at yahoo.com.au
Wed Sep 7 13:52:39 UTC 2016


On Wed, 2016-09-07 at 19:26 +1000, Jonathan Gray wrote:
> LLVM was imported yes, but the integration of it has only
> started around the same time and it is not enabled by default yet.
> And it was only imported around two days or so ago.
> 

Which means its a good time to start a discussion on what the inclusion means
for Mesa :)

> And LLVM does not support all the architectures OpenBSD builds Mesa
> on.
> 
> Can you point to something specific that needs a newer GCC version?
> Do you want to target c++11 or the like?

We have discussed specific features in the past. At this point its move about
giving developers the freedom to use any new features they wish. And
ultimately the ability to bump the required version again in future.

It seems you are talking about the possibly of never switching to clang for
building Mesa and sticking with gcc 4.2 for years to come. There is also the
issue as I understand it that your gcc 4.2 is not really gcc 4.2, as you say
features have been back ported to support Mesa so its possible that Mesa would
not even build for a normal gcc 4.2 build and our build requirements act more
as a restriction on developers using features rather than enforcing a building
requirement. 

> 
> We have patched the GCC included in the base tree multiple times
> to support Mesa and could possibly do so again if you mention
> specifics.

It is my feeling that we should be bumping the gcc requirements for Mesa based
on the actual gcc project. Freezing the limit at the version of a forked gcc
variant, and using features from higher versions that have been back ported to
that fork seems backwards to me.

To me the current situation seems untenable, besides the issues with having a
minimum version that won't actually build Mesa I don't believe we should be
forced to worry about ancient compilers indefinitely due to the decisions of a
singe distro. In my opinion we should bump the version and let OpenBSD resolve
any issues however it sees fit (patch gcc/mesa, freeze mesa, etc). Others may
feel differently.

> 
> On Wed, Sep 07, 2016 at 02:28:16PM +1000, Timothy Arceri wrote:
> > 
> > The last time this was bumped we settled on 4.2.0 because OpenBSD
> > wasn't shipping anything greater than 4.2.1 (as that was the last
> > GPLv2 licensed version) however they have now imported llvm to
> > there base repo.
> > 
> > As far as I can tell the oldest distro still using a current version
> > of Mesa is Red Hat Enterprise Linux 6 which ships with 4.4.7. However
> > Dave reported that they build Mesa with GCC 4.8.
> > 
> > Cc: Jonathan Gray <jsg at jsg.id.au>
> > ---
> >  configure.ac         | 18 +++---------------
> >  include/c99_compat.h | 17 +++++++----------
> >  2 files changed, 10 insertions(+), 25 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index a413a3a..5128fc4 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -171,7 +171,6 @@ AC_MSG_RESULT([$acv_mesa_CLANG])
> >  dnl If we're using GCC, make sure that it is at least version
> > 4.2.0.  Older
> >  dnl versions are explictly not supported.
> >  GEN_ASM_OFFSETS=no
> > -USE_GNU99=no
> >  if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
> >      AC_MSG_CHECKING([whether gcc version is sufficient])
> >      major=0
> > @@ -183,16 +182,13 @@ if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno;
> > then
> >          GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
> >      fi
> >  
> > -    if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a
> > $GCC_VERSION_MINOR -lt 2 ; then
> > +    if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a
> > $GCC_VERSION_MINOR -lt 8 ; then
> >          AC_MSG_RESULT([no])
> > -        AC_MSG_ERROR([If using GCC, version 4.2.0 or later is required.])
> > +        AC_MSG_ERROR([If using GCC, version 4.8.0 or later is required.])
> >      else
> >          AC_MSG_RESULT([yes])
> >      fi
> >  
> > -    if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a
> > $GCC_VERSION_MINOR -lt 6 ; then
> > -        USE_GNU99=yes
> > -    fi
> >      if test "x$cross_compiling" = xyes; then
> >          GEN_ASM_OFFSETS=yes
> >      fi
> > @@ -269,12 +265,7 @@ AM_CONDITIONAL(HAVE_ANDROID, test "x$android" = xyes)
> >  dnl Add flags for gcc and g++
> >  if test "x$GCC" = xyes; then
> >      CFLAGS="$CFLAGS -Wall"
> > -
> > -    if test "x$USE_GNU99" = xyes; then
> > -	CFLAGS="$CFLAGS -std=gnu99"
> > -    else
> > -	CFLAGS="$CFLAGS -std=c99"
> > -    fi
> > +    CFLAGS="$CFLAGS -std=c99"
> >  
> >      # Enable -Werror=implicit-function-declaration and
> >      # -Werror=missing-prototypes, if available, or otherwise, just
> > @@ -401,9 +392,6 @@ AC_MSG_CHECKING(whether gcc supports -mpower8-vector)
> >  save_CFLAGS=$CFLAGS
> >  CFLAGS="$PWR8_CFLAGS $CFLAGS"
> >  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
> > -#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 &&
> > __GNUC_MINOR__ < 8))
> > -#error "Need GCC >= 4.8 for sane POWER8 support"
> > -#endif
> >  #include <altivec.h>
> >  int main () {
> >      vector unsigned char r;
> > diff --git a/include/c99_compat.h b/include/c99_compat.h
> > index 24e96e0..d76171c 100644
> > --- a/include/c99_compat.h
> > +++ b/include/c99_compat.h
> > @@ -145,8 +145,8 @@ test_c99_compat_h(const void * restrict a,
> >  #  endif
> >  
> >  #  ifdef __GNUC__
> > -#    if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
> > -#      error "GCC version 4.2 or higher required"
> > +#    if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)
> > +#      error "GCC version 4.8 or higher required"
> >  #    endif
> >  
> >       /* https://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Other-Builtins.html
> > */
> > @@ -164,15 +164,12 @@ test_c99_compat_h(const void * restrict a,
> >  #    define HAVE_FUNC_ATTRIBUTE_FORMAT 1
> >  #    define HAVE_FUNC_ATTRIBUTE_PACKED 1
> >  
> > -#    if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
> > -       /* https://gcc.gnu.org/onlinedocs/gcc-4.3.6/gcc/Other-Builtins.htm
> > l */
> > -#      define HAVE___BUILTIN_BSWAP32 1
> > -#      define HAVE___BUILTIN_BSWAP64 1
> > -#    endif
> > +     /* https://gcc.gnu.org/onlinedocs/gcc-4.3.6/gcc/Other-Builtins.html
> > */
> > +#    define HAVE___BUILTIN_BSWAP32 1
> > +#    define HAVE___BUILTIN_BSWAP64 1
> >  
> > -#    if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
> > -#      define HAVE___BUILTIN_UNREACHABLE 1
> > -#    endif
> > +     /* GCC 4.5 */
> > +#    define HAVE___BUILTIN_UNREACHABLE 1
> >  
> >  #  endif /* __GNUC__ */
> >  
> > -- 
> > 2.7.4
> > 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list