8199405: Bump lowest supported gcc to 4.8
authorihse
Fri, 09 Mar 2018 19:12:07 +0100
changeset 49200 a19a6228cdb2
parent 49199 986249df86ce
child 49201 e59941f7247d
8199405: Bump lowest supported gcc to 4.8 Reviewed-by: erikj
make/autoconf/flags-cflags.m4
make/autoconf/toolchain.m4
--- a/make/autoconf/flags-cflags.m4	Fri Mar 09 19:10:51 2018 +0100
+++ b/make/autoconf/flags-cflags.m4	Fri Mar 09 19:12:07 2018 +0100
@@ -121,15 +121,6 @@
   fi
 
   AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
-
-  # FIXME: This was never used in the old build. What to do with it?
-  if test "x$TOOLCHAIN_TYPE" = xgcc; then
-    # "-Og" suppported for GCC 4.8 and later
-    CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
-    FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CFLAG_OPTIMIZE_DEBUG_FLAG],
-      IF_TRUE: [HAS_CFLAG_OPTIMIZE_DEBUG=true],
-      IF_FALSE: [HAS_CFLAG_OPTIMIZE_DEBUG=false])
-  fi
 ])
 
 AC_DEFUN([FLAGS_SETUP_WARNINGS],
@@ -163,16 +154,7 @@
       CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
       ;;
     gcc)
-      # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
-      FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
-          IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true],
-          IF_FALSE: [GCC_CAN_DISABLE_WARNINGS=false]
-      )
-      if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then
-        DISABLE_WARNING_PREFIX="-Wno-"
-      else
-        DISABLE_WARNING_PREFIX=
-      fi
+      DISABLE_WARNING_PREFIX="-Wno-"
       CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
       # Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset
       # CFLAGS since any target specific flags will likely not work with the
@@ -183,15 +165,7 @@
       CXX="$BUILD_CXX"
       CFLAGS_OLD="$CFLAGS"
       CFLAGS=""
-      FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
-          IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true],
-          IF_FALSE: [BUILD_CC_CAN_DISABLE_WARNINGS=false]
-      )
-      if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
-        BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
-      else
-        BUILD_CC_DISABLE_WARNING_PREFIX=
-      fi
+      BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
       CC="$CC_OLD"
       CXX="$CXX_OLD"
       CFLAGS="$CFLAGS_OLD"
@@ -227,17 +201,10 @@
       # This is most likely not really correct.
 
       # Add runtime stack smashing and undefined behavior checks.
-      # Not all versions of gcc support -fstack-protector
-      STACK_PROTECTOR_CFLAG="-fstack-protector-all"
-      FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror],
-          IF_FALSE: [STACK_PROTECTOR_CFLAG=""])
+      CFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1"
+      CXXFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1"
 
-      CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
-      CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
-
-      if test "x$STACK_PROTECTOR_CFLAG" != x; then
-        JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS $STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
-      fi
+      JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -fstack-protector-all --param ssp-buffer-size=1"
       ;;
     esac
   fi
@@ -789,12 +756,7 @@
     TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($1))
     $1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
 
-    TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: [4.8], PREFIX: $2,
-        IF_AT_LEAST: [
-          # These flags either do not work or give spurious warnings prior to gcc 4.8.
-          $1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
-        ]
-    )
+    $1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
   fi
 
   # EXPORT to API
--- a/make/autoconf/toolchain.m4	Fri Mar 09 19:10:51 2018 +0100
+++ b/make/autoconf/toolchain.m4	Fri Mar 09 19:12:07 2018 +0100
@@ -52,7 +52,7 @@
 
 # Minimum supported versions, empty means unspecified
 TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
-TOOLCHAIN_MINIMUM_VERSION_gcc="4.7"
+TOOLCHAIN_MINIMUM_VERSION_gcc="4.8"
 TOOLCHAIN_MINIMUM_VERSION_microsoft="16.00.30319.01" # VS2010
 TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13"
 TOOLCHAIN_MINIMUM_VERSION_xlc=""