From eb27d6290a4a3b465101ecda3ed334fca6491e85 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 15 Sep 2025 16:56:58 +0200 Subject: [PATCH 1/4] 8360869: jcstress is able to crash jdk8 on aarch64 with jfr on --- common/autoconf/toolchain.m4 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index ba4798e795f..fa4ab26c2ac 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@:>@.*//"` + if test $COMPILER_VERSION_NUMBER_MAJOR -lt 5; then + AC_MSG_ERROR([GCC < 5 is known to be compiling incorrectly on aarch64. See JDK-8360869. Gcc $COMPILER_VERSION_NUMBER_MAJOR.x detected]) + fi + AC_MSG_RESULT([ok ($COMPILER_VERSION_NUMBER_MAJOR.x)]) + fi + fi + # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed # in executable.' USING_BROKEN_SUSE_LD=no From 83309c37a0cdd6f71ee6d06418eb2251246f0211 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 17 Sep 2025 09:02:37 +0200 Subject: [PATCH 2/4] Moved compiler version result to earlier stage --- common/autoconf/toolchain.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index fa4ab26c2ac..27602c29e08 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -850,10 +850,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], 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 is known to be compiling incorrectly on aarch64. See JDK-8360869. Gcc $COMPILER_VERSION_NUMBER_MAJOR.x detected]) + AC_MSG_ERROR([GCC < 5 is known to lead to incorrect compilation on aarch64. See JDK-8360869.]) fi - AC_MSG_RESULT([ok ($COMPILER_VERSION_NUMBER_MAJOR.x)]) fi fi From 93a93489ed097a0eedc9738a902e8d8d896cd120 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 17 Sep 2025 11:16:34 +0200 Subject: [PATCH 3/4] Improved error message --- common/autoconf/toolchain.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 27602c29e08..f27f21a6c91 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -852,7 +852,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], 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 is known to lead to incorrect compilation on aarch64. See JDK-8360869.]) + AC_MSG_ERROR([GCC < 5 may incorrectly compile HotSpot on aarch64. See JDK-8360869.]) fi fi fi From 99ce7cdf880750f8a264f65c6423764b84518df5 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 18 Sep 2025 09:52:02 +0200 Subject: [PATCH 4/4] regenerated generated-configure by self built autoconf 2.69 Skipping about 50 hunks like: @@ -50158,7 +50167,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu /* end confdefs.h. */ int -main (void) +main () { return 0; ; --- common/autoconf/generated-configure.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index ad3f7f232ea..f9c14f3d5a3 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