diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index ad3f7f232e..f9c14f3d5a 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -41333,6 +41333,19 @@ $as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;} # This is later checked when setting flags. fi + if test "x$TOOLCHAIN_TYPE" = xgcc; then + if test "x$OPENJDK_TARGET_CPU_ARCH" = "xaarch64" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken aarch64 gcc 4.x" >&5 +$as_echo_n "checking for broken aarch64 gcc 4.x... " >&6; } + COMPILER_VERSION_NUMBER_MAJOR=`$ECHO "$COMPILER_VERSION_NUMBER" | $SED "s/[^0-9].*//"` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $COMPILER_VERSION_NUMBER_MAJOR.x" >&5 +$as_echo "found $COMPILER_VERSION_NUMBER_MAJOR.x" >&6; } + if test $COMPILER_VERSION_NUMBER_MAJOR -lt 5; then + as_fn_error $? "GCC < 5 may incorrectly compile HotSpot on aarch64. See JDK-8360869." "$LINENO" 5 + fi + fi + fi + # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed # in executable.' USING_BROKEN_SUSE_LD=no diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index ba4798e795..f27f21a6c9 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -846,6 +846,17 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], # This is later checked when setting flags. fi + if test "x$TOOLCHAIN_TYPE" = xgcc; then + if test "x$OPENJDK_TARGET_CPU_ARCH" = "xaarch64" ; then + AC_MSG_CHECKING([for broken aarch64 gcc 4.x]) + COMPILER_VERSION_NUMBER_MAJOR=`$ECHO "$COMPILER_VERSION_NUMBER" | $SED "s/@<:@^0-9@:>@.*//"` + AC_MSG_RESULT([found $COMPILER_VERSION_NUMBER_MAJOR.x]) + if test $COMPILER_VERSION_NUMBER_MAJOR -lt 5; then + AC_MSG_ERROR([GCC < 5 may incorrectly compile HotSpot on aarch64. See JDK-8360869.]) + fi + fi + fi + # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed # in executable.' USING_BROKEN_SUSE_LD=no