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

Timothy Arceri timothy.arceri at collabora.com
Wed Sep 7 04:28:16 UTC 2016


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.html */
-#      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



More information about the mesa-dev mailing list