From 39e7af2cc30e5b70b3d1357f763909852894ce8d Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Mon, 18 May 2020 15:08:21 +0100 Subject: [PATCH] Backport JDK-8233880 to fix version detection of GCC 10. Remove compiler flags used to disable GCC optimisations. This is now resolved by -fno-delete-null-pointer-checks and -fno-lifetime-dse being turned on in the upstream build, after GCC >= 6 is detected. --- java-1.8.0-openjdk.spec | 18 +++++++++++++----- jdk8233880-compiler_versioning.patch | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 jdk8233880-compiler_versioning.patch diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 0e443a7..1463587 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -245,7 +245,7 @@ %global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) # eg jdk8u60-b27 -> b27 %global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) -%global rpmrelease 0 +%global rpmrelease 1 # Define milestone (EA for pre-releases, GA ("fcs") for releases) # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, @@ -1191,13 +1191,15 @@ Patch203: jdk8042159-allow_using_system_installed_lcms2.patch ############################################# # -# Patches appearing in 8u222 +# Patches appearing in 8u262 # # This section includes patches which are present # in the listed OpenJDK 8u release and should be # able to be removed once that release is out # and used by this RPM. ############################################# +# JDK-8233880: Support compilers with multi-digit major version numbers +Patch579: jdk8233880-compiler_versioning.patch ############################################# # @@ -1570,6 +1572,7 @@ sh %{SOURCE12} %patch111 %patch112 %patch113 +%patch579 # RPM-only fixes %patch539 @@ -1646,11 +1649,10 @@ export ARCH_DATA_MODEL=64 export CFLAGS="$CFLAGS -mieee" %endif -GCC_10_OPT_DISABLE="-fno-tree-pta -fno-tree-scev-cprop -fno-tree-sink -fno-tree-slp-vectorize -fno-tree-slsr -fno-tree-sra -fno-tree-switch-conversion -fno-tree-tail-merge -fno-tree-ter -fno-tree-vrp -fno-unit-at-a-time -fno-unswitch-loops -fno-vect-cost-model -fno-version-loops-for-strides -fno-tree-coalesce-vars -fno-tree-copy-prop -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-forwprop -fno-tree-fre -fno-tree-loop-distribute-patterns -fno-tree-loop-distribution -fno-tree-loop-vectorize -fno-tree-partial-pre -fno-tree-phiprop -fno-tree-pre" # We use ourcppflags because the OpenJDK build seems to # pass EXTRA_CFLAGS to the HotSpot C++ compiler... -EXTRA_CFLAGS="%ourcppflags -Wno-error -fcommon $GCC_10_OPT_DISABLE" -EXTRA_CPP_FLAGS="%ourcppflags -fcommon $GCC_10_OPT_DISABLE" +EXTRA_CFLAGS="%ourcppflags -Wno-error -fcommon" +EXTRA_CPP_FLAGS="%ourcppflags" %ifarch %{power64} ppc # fix rpmlint warnings @@ -2234,6 +2236,12 @@ require "copy_jdk_configs.lua" %endif %changelog +* Sun May 17 2020 Andrew John Hughes - 1:1.8.0.252.b01-0.1.ea +- Backport JDK-8233880 to fix version detection of GCC 10. +- Remove compiler flags used to disable GCC optimisations. This is now + resolved by -fno-delete-null-pointer-checks and -fno-lifetime-dse being turned + on in the upstream build, after GCC >= 6 is detected. + * Thu May 07 2020 Andrew Hughes - 1:1.8.0.252.b01-0.0.ea - Update to aarch64-shenandoah-jdk8u252-b01. - Switch to EA mode. diff --git a/jdk8233880-compiler_versioning.patch b/jdk8233880-compiler_versioning.patch new file mode 100644 index 0000000..4028285 --- /dev/null +++ b/jdk8233880-compiler_versioning.patch @@ -0,0 +1,22 @@ +# HG changeset patch +# User sgehwolf +# Date 1589215018 -3600 +# Mon May 11 17:36:58 2020 +0100 +# Node ID 39a7914e14a0c73ecc80091724c833b9f0410d47 +# Parent 493a0176587ec5917ab4a64c0760a131e9d0b7b4 +8233880: Support compilers with multi-digit major version numbers +Summary: Also includes JDK-8151841 version changes regressed by JDK-8034788 +Reviewed-by: aph, andrew + +diff --git openjdk.orig/common/autoconf/toolchain.m4 openjdk/common/autoconf/toolchain.m4 +--- openjdk.orig/common/autoconf/toolchain.m4 ++++ openjdk/common/autoconf/toolchain.m4 +@@ -433,7 +433,7 @@ + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/ *Copyright .*//'` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ +- $SED -e 's/^.* \(@<:@1-9@:>@\.@<:@0-9.@:>@*\) .*$/\1/'` ++ $SED -e 's/^.* \(@<:@1-9@:>@@<:@0-9@:>@*\.@<:@0-9.@:>@*\) .*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xclang; then + # clang --version output typically looks like + # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)