diff --git a/.gitignore b/.gitignore index 29dfc59..313df63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.2+7.tar.xz +SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.3+7.tar.xz SOURCES/systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz diff --git a/.java-11-openjdk.metadata b/.java-11-openjdk.metadata index c7e0243..3aeb008 100644 --- a/.java-11-openjdk.metadata +++ b/.java-11-openjdk.metadata @@ -1,2 +1,2 @@ -a01def53d91f1d55c27e8609f84891dccfae1ee1 SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.2+7.tar.xz +f1e75a992a0dc64caf418414a93fed8f99fb4e18 SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.3+7.tar.xz cd8bf91753b9eb1401cfc529e78517105fc66011 SOURCES/systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz diff --git a/SOURCES/jdk8210416-rh1632174-compile_fdlibm_with_o2_ffp_contract_off_on_gcc_clang_arches.patch b/SOURCES/jdk8210416-rh1632174-compile_fdlibm_with_o2_ffp_contract_off_on_gcc_clang_arches.patch deleted file mode 100644 index 16eb4da..0000000 --- a/SOURCES/jdk8210416-rh1632174-compile_fdlibm_with_o2_ffp_contract_off_on_gcc_clang_arches.patch +++ /dev/null @@ -1,84 +0,0 @@ -# HG changeset patch -# User sgehwolf -# Date 1536142767 -7200 -# Wed Sep 05 12:19:27 2018 +0200 -# Node ID 7ea57274e55054579d1532e757edb21e67beed83 -# Parent 3ee91722550680c18b977f0e00b1013323b5c9ef -8210416: [linux] Poor StrictMath performance due to non-optimized compilation -Summary: Compile fdlibm with -O2 -ffp-contract=off on gcc/clang arches. -Reviewed-by: aph, erikj, dholmes, darcy - -diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 ---- a/make/autoconf/flags-cflags.m4 -+++ b/make/autoconf/flags-cflags.m4 -@@ -366,6 +366,18 @@ - - FLAGS_SETUP_CFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_]) - -+ COMPILER_FP_CONTRACT_OFF_FLAG="-ffp-contract=off" -+ # Check that the compiler supports -ffp-contract=off flag -+ # Set FDLIBM_CFLAGS to -ffp-contract=off if it does. Empty -+ # otherwise. -+ # These flags are required for GCC-based builds of -+ # fdlibm with optimization without losing precision. -+ # Notably, -ffp-contract=off needs to be added for GCC >= 4.6. -+ FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_FP_CONTRACT_OFF_FLAG}], -+ IF_TRUE: [FDLIBM_CFLAGS=${COMPILER_FP_CONTRACT_OFF_FLAG}], -+ IF_FALSE: [FDLIBM_CFLAGS=""]) -+ AC_SUBST(FDLIBM_CFLAGS) -+ - # Tests are only ever compiled for TARGET - CFLAGS_TESTLIB="$CFLAGS_JDKLIB" - CXXFLAGS_TESTLIB="$CXXFLAGS_JDKLIB" -diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in ---- a/make/autoconf/spec.gmk.in -+++ b/make/autoconf/spec.gmk.in -@@ -444,6 +444,7 @@ - LIBJSIG_HASHSTYLE_LDFLAGS := @LIBJSIG_HASHSTYLE_LDFLAGS@ - LIBJSIG_NOEXECSTACK_LDFLAGS := @LIBJSIG_NOEXECSTACK_LDFLAGS@ - -+FDLIBM_CFLAGS := @FDLIBM_CFLAGS@ - JVM_CFLAGS := @JVM_CFLAGS@ - JVM_LDFLAGS := @JVM_LDFLAGS@ - JVM_ASFLAGS := @JVM_ASFLAGS@ -diff --git a/make/lib/CoreLibraries.gmk b/make/lib/CoreLibraries.gmk ---- a/make/lib/CoreLibraries.gmk -+++ b/make/lib/CoreLibraries.gmk -@@ -39,20 +39,15 @@ - BUILD_LIBFDLIBM_OPTIMIZATION := HIGH - endif - --ifeq ($(OPENJDK_TARGET_OS), linux) -- ifeq ($(OPENJDK_TARGET_CPU), ppc64) -- BUILD_LIBFDLIBM_OPTIMIZATION := HIGH -- else ifeq ($(OPENJDK_TARGET_CPU), ppc64le) -- BUILD_LIBFDLIBM_OPTIMIZATION := HIGH -- else ifeq ($(OPENJDK_TARGET_CPU), s390x) -- BUILD_LIBFDLIBM_OPTIMIZATION := HIGH -- else ifeq ($(OPENJDK_TARGET_CPU), aarch64) -- BUILD_LIBFDLIBM_OPTIMIZATION := HIGH -- endif -+# If FDLIBM_CFLAGS is non-empty we know that we can optimize -+# fdlibm by adding those extra C flags. Currently GCC, -+# and clang only. -+ifneq ($(FDLIBM_CFLAGS), ) -+ BUILD_LIBFDLIBM_OPTIMIZATION := LOW - endif - - LIBFDLIBM_SRC := $(TOPDIR)/src/java.base/share/native/libfdlibm --LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC) -+LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC) $(FDLIBM_CFLAGS) - - ifneq ($(OPENJDK_TARGET_OS), macosx) - $(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM, \ -@@ -64,10 +59,6 @@ - CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \ - CFLAGS_windows_debug := -DLOGGING, \ - CFLAGS_aix := -qfloat=nomaf, \ -- CFLAGS_linux_ppc64 := -ffp-contract=off, \ -- CFLAGS_linux_ppc64le := -ffp-contract=off, \ -- CFLAGS_linux_s390x := -ffp-contract=off, \ -- CFLAGS_linux_aarch64 := -ffp-contract=off, \ - DISABLED_WARNINGS_gcc := sign-compare misleading-indentation array-bounds, \ - DISABLED_WARNINGS_microsoft := 4146 4244 4018, \ - ARFLAGS := $(ARFLAGS), \ diff --git a/SOURCES/jdk8210425-rh1632174-sharedRuntimeTrig_sharedRuntimeTrans_compiled_without_optimization.patch b/SOURCES/jdk8210425-rh1632174-sharedRuntimeTrig_sharedRuntimeTrans_compiled_without_optimization.patch deleted file mode 100644 index 843ae3c..0000000 --- a/SOURCES/jdk8210425-rh1632174-sharedRuntimeTrig_sharedRuntimeTrans_compiled_without_optimization.patch +++ /dev/null @@ -1,48 +0,0 @@ -# HG changeset patch -# User sgehwolf -# Date 1536682731 -7200 -# Tue Sep 11 18:18:51 2018 +0200 -# Node ID 7157249fdd4366d95dd68f3d083ebb0ef84c753b -# Parent 8d86b149e10f0a0896e5fd4d8d407e5fda64a529 -8210425: [x86] sharedRuntimeTrig/sharedRuntimeTrans compiled without optimization -Reviewed-by: duke - -diff --git a/make/hotspot/lib/JvmOverrideFiles.gmk b/make/hotspot/lib/JvmOverrideFiles.gmk ---- a/make/hotspot/lib/JvmOverrideFiles.gmk -+++ b/make/hotspot/lib/JvmOverrideFiles.gmk -@@ -43,20 +43,26 @@ ifeq ($(TOOLCHAIN_TYPE), gcc) - endif - endif - -+LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NONE) -+# If the FDLIBM_CFLAGS variable is non-empty we know -+# that the fdlibm-fork in hotspot can get optimized -+# by using -ffp-contract=off on GCC/Clang platforms. -+ifneq ($(FDLIBM_CFLAGS), ) -+ LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NORM) -+endif -+ - ifeq ($(OPENJDK_TARGET_OS), linux) - BUILD_LIBJVM_ostream.cpp_CXXFLAGS := -D_FILE_OFFSET_BITS=64 - BUILD_LIBJVM_logFileOutput.cpp_CXXFLAGS := -D_FILE_OFFSET_BITS=64 - -- ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86) -- BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := -DNO_PCH $(CXX_O_FLAG_NONE) -- BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := -DNO_PCH $(CXX_O_FLAG_NONE) -+ BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG) -+ BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG) - -- ifeq ($(TOOLCHAIN_TYPE), clang) -- JVM_PRECOMPILED_HEADER_EXCLUDE := \ -- sharedRuntimeTrig.cpp \ -- sharedRuntimeTrans.cpp \ -- # -- endif -+ ifeq ($(TOOLCHAIN_TYPE), clang) -+ JVM_PRECOMPILED_HEADER_EXCLUDE := \ -+ sharedRuntimeTrig.cpp \ -+ sharedRuntimeTrans.cpp \ -+ # - endif - - ifeq ($(OPENJDK_TARGET_CPU), x86) diff --git a/SOURCES/jdk8210647-rh1632174-libsaproc_is_being_compiled_without_optimization.patch b/SOURCES/jdk8210647-rh1632174-libsaproc_is_being_compiled_without_optimization.patch deleted file mode 100644 index a279f8a..0000000 --- a/SOURCES/jdk8210647-rh1632174-libsaproc_is_being_compiled_without_optimization.patch +++ /dev/null @@ -1,21 +0,0 @@ -# HG changeset patch -# User sgehwolf -# Date 1536751862 -7200 -# Wed Sep 12 13:31:02 2018 +0200 -# Node ID f95c6746fe256fe0456e0ea0d2930631ef840286 -# Parent 7157249fdd4366d95dd68f3d083ebb0ef84c753b -8210647: libsaproc is being compiled without optimization -Reviewed-by: duke - -diff --git a/make/lib/Lib-jdk.hotspot.agent.gmk b/make/lib/Lib-jdk.hotspot.agent.gmk ---- a/make/lib/Lib-jdk.hotspot.agent.gmk -+++ b/make/lib/Lib-jdk.hotspot.agent.gmk -@@ -52,7 +52,7 @@ - - $(eval $(call SetupJdkLibrary, BUILD_LIBSA, \ - NAME := saproc, \ -- OPTIMIZATION := NONE, \ -+ OPTIMIZATION := LOW, \ - DISABLED_WARNINGS_microsoft := 4267, \ - DISABLED_WARNINGS_gcc := sign-compare, \ - DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \ diff --git a/SOURCES/jdk8210703-rh1632174-vmStructs_cpp_no_longer_compiled_with_o0 b/SOURCES/jdk8210703-rh1632174-vmStructs_cpp_no_longer_compiled_with_o0 deleted file mode 100644 index 6fc6c07..0000000 --- a/SOURCES/jdk8210703-rh1632174-vmStructs_cpp_no_longer_compiled_with_o0 +++ /dev/null @@ -1,21 +0,0 @@ -# HG changeset patch -# User sgehwolf -# Date 1536829660 -7200 -# Thu Sep 13 11:07:40 2018 +0200 -# Node ID 39ccca116f79139fc4b779f5df83cb32357b9ae9 -# Parent 7512bd28304cf0dc5676247990f1907162c719ca -8210703: vmStructs.cpp compiled with -O0 -Reviewed-by: duke - -diff --git a/make/hotspot/lib/JvmOverrideFiles.gmk b/make/hotspot/lib/JvmOverrideFiles.gmk ---- a/make/hotspot/lib/JvmOverrideFiles.gmk -+++ b/make/hotspot/lib/JvmOverrideFiles.gmk -@@ -30,7 +30,7 @@ - # status for individual files on specific platforms. - - ifeq ($(TOOLCHAIN_TYPE), gcc) -- BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments -O0 -+ BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments - BUILD_LIBJVM_jvmciCompilerToVM.cpp_CXXFLAGS := -fno-var-tracking-assignments - BUILD_LIBJVM_jvmciCompilerToVMInit.cpp_CXXFLAGS := -fno-var-tracking-assignments - BUILD_LIBJVM_assembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized diff --git a/SOURCES/jdk8210761-rh1632174-libjsig_is_being_compiled_without_optimization.patch b/SOURCES/jdk8210761-rh1632174-libjsig_is_being_compiled_without_optimization.patch deleted file mode 100644 index b5a88b0..0000000 --- a/SOURCES/jdk8210761-rh1632174-libjsig_is_being_compiled_without_optimization.patch +++ /dev/null @@ -1,20 +0,0 @@ -# HG changeset patch -# User sgehwolf -# Date 1537541916 -7200 -# Fri Sep 21 16:58:36 2018 +0200 -# Node ID cd8483acfe56ade257685d93323f78e6e13704a0 -# Parent e40fa3a70efdbc22f85c0d30350189f632779831 -8210761: libjsig is being compiled without optimization -Reviewed-by: duke - -diff --git a/make/lib/Lib-java.base.gmk b/make/lib/Lib-java.base.gmk ---- a/make/lib/Lib-java.base.gmk -+++ b/make/lib/Lib-java.base.gmk -@@ -138,6 +138,7 @@ - - $(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \ - NAME := jsig, \ -+ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \ - LDFLAGS := $(LDFLAGS_JDKLIB) \ - $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/SOURCES/rh1566890-CVE_2018_3639-speculative_store_bypass.patch b/SOURCES/rh1566890-CVE_2018_3639-speculative_store_bypass.patch new file mode 100644 index 0000000..bd52828 --- /dev/null +++ b/SOURCES/rh1566890-CVE_2018_3639-speculative_store_bypass.patch @@ -0,0 +1,61 @@ +diff --git openjdk/src/hotspot/os/linux/os_linux.cpp openjdk/src/hotspot/os/linux/os_linux.cpp +--- openjdk/src/hotspot/os/linux/os_linux.cpp ++++ openjdk/src/hotspot/os/linux/os_linux.cpp +@@ -107,6 +107,8 @@ + # include + # include + ++#include ++ + #ifndef _GNU_SOURCE + #define _GNU_SOURCE + #include +@@ -4984,6 +4986,48 @@ + extern void report_error(char* file_name, int line_no, char* title, + char* format, ...); + ++/* Per task speculation control */ ++#ifndef PR_GET_SPECULATION_CTRL ++# define PR_GET_SPECULATION_CTRL 52 ++#endif ++#ifndef PR_SET_SPECULATION_CTRL ++# define PR_SET_SPECULATION_CTRL 53 ++#endif ++/* Speculation control variants */ ++#ifndef PR_SPEC_STORE_BYPASS ++# define PR_SPEC_STORE_BYPASS 0 ++#endif ++/* Return and control values for PR_SET/GET_SPECULATION_CTRL */ ++ ++#ifndef PR_SPEC_NOT_AFFECTED ++# define PR_SPEC_NOT_AFFECTED 0 ++#endif ++#ifndef PR_SPEC_PRCTL ++# define PR_SPEC_PRCTL (1UL << 0) ++#endif ++#ifndef PR_SPEC_ENABLE ++# define PR_SPEC_ENABLE (1UL << 1) ++#endif ++#ifndef PR_SPEC_DISABLE ++# define PR_SPEC_DISABLE (1UL << 2) ++#endif ++#ifndef PR_SPEC_FORCE_DISABLE ++# define PR_SPEC_FORCE_DISABLE (1UL << 3) ++#endif ++#ifndef PR_SPEC_DISABLE_NOEXEC ++# define PR_SPEC_DISABLE_NOEXEC (1UL << 4) ++#endif ++ ++static void set_speculation() __attribute__((constructor)); ++static void set_speculation() { ++ if ( prctl(PR_SET_SPECULATION_CTRL, ++ PR_SPEC_STORE_BYPASS, ++ PR_SPEC_DISABLE_NOEXEC, 0, 0) == 0 ) { ++ return; ++ } ++ prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_DISABLE, 0, 0); ++} ++ + // this is called _before_ most of the global arguments have been parsed + void os::init(void) { + char dummy; // used to get a guess on initial stack address diff --git a/SOURCES/s390-8214206_fix.patch b/SOURCES/s390-8214206_fix.patch new file mode 100644 index 0000000..1d0c686 --- /dev/null +++ b/SOURCES/s390-8214206_fix.patch @@ -0,0 +1,12 @@ +diff --git openjdk.orig/jdk/src/hotspot/share/runtime/os.cpp openjdk/jdk/src/hotspot/share/runtime/os.cpp +--- openjdk.orig/src/hotspot/share/runtime/os.cpp ++++ openjdk/src/hotspot/share/runtime/os.cpp +@@ -1368,7 +1368,7 @@ + } + + void os::set_memory_serialize_page(address page) { +- int count = log2_intptr(sizeof(class JavaThread)) - log2_int(64); ++ int count = log2_intptr((uintptr_t) sizeof(class JavaThread)) - log2_int(64); + _mem_serialize_page = (volatile int32_t *)page; + // We initialize the serialization page shift count here + // We assume a cache line size of 64 bytes diff --git a/SPECS/java-11-openjdk.spec b/SPECS/java-11-openjdk.spec index 89cad59..f886f32 100644 --- a/SPECS/java-11-openjdk.spec +++ b/SPECS/java-11-openjdk.spec @@ -189,7 +189,11 @@ # New Version-String scheme-style defines %global majorver 11 -%global securityver 2 +%global securityver 3 +# buildjdkver is usually same as %%{majorver}, +# but in time of bootstrap of next jdk, it is majorver-1, +# and this it is better to change it here, on single place +%global buildjdkver %{majorver} # Used via new version scheme. JDK 11 was # GA'ed in September 2018 => 18.9 %global vendor_version_string 18.9 @@ -925,7 +929,7 @@ Patch5: pr1983-rh1565658-support_using_the_system_installation_of_nss_with_th ############################################# # -# Shenandaoh specific patches +# Shenandoah specific patches # ############################################# @@ -935,10 +939,10 @@ Patch5: pr1983-rh1565658-support_using_the_system_installation_of_nss_with_th # ############################################# -# 8210416, RHBZ#1632174: [linux] Poor StrictMath performance due to non-optimized compilation -Patch8: jdk8210416-rh1632174-compile_fdlibm_with_o2_ffp_contract_off_on_gcc_clang_arches.patch -# 8210425, RHBZ#1632174: [x86] sharedRuntimeTrig/sharedRuntimeTrans compiled without optimization -Patch9: jdk8210425-rh1632174-sharedRuntimeTrig_sharedRuntimeTrans_compiled_without_optimization.patch +# RH1566890: CVE-2018-3639 +Patch6: rh1566890-CVE_2018_3639-speculative_store_bypass.patch +# S390 ambiguous log2_intptr call +Patch8: s390-8214206_fix.patch ############################################# # @@ -946,19 +950,6 @@ Patch9: jdk8210425-rh1632174-sharedRuntimeTrig_sharedRuntimeTrans_compiled_wi # ############################################# -# 8210647, RHBZ#1632174: libsaproc is being compiled without optimization -Patch10: jdk8210647-rh1632174-libsaproc_is_being_compiled_without_optimization.patch -# 8210761, RHBZ#1632174: libjsig is being compiled without optimization -Patch11: jdk8210761-rh1632174-libjsig_is_being_compiled_without_optimization.patch -# 8210703, RHBZ#1632174: vmStructs.cpp compiled with -O0 -Patch12: jdk8210703-rh1632174-vmStructs_cpp_no_longer_compiled_with_o0 - -############################################# -# -# Patches appearing in 11.0.2 -# -############################################# - BuildRequires: autoconf BuildRequires: automake BuildRequires: alsa-lib-devel @@ -1222,11 +1213,8 @@ pushd %{top_level_dir_name} %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 %patch525 -p1 popd # openjdk @@ -1298,6 +1286,10 @@ export CFLAGS="$CFLAGS -mieee" # Explicitly set the C++ standard as the default has changed on GCC >= 6 EXTRA_CFLAGS="%ourcppflags -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks" EXTRA_CPP_FLAGS="%ourcppflags -std=gnu++98 -fno-delete-null-pointer-checks" +%ifarch %{ix86} +EXTRA_CFLAGS="${EXTRA_CFLAGS} -mstackrealign" +EXTRA_CPP_FLAGS="${EXTRA_CPP_FLAGS} -mstackrealign" +%endif %ifarch %{power64} ppc # fix rpmlint warnings @@ -1455,6 +1447,8 @@ done # Using line number 1 might cause build problems. See: # https://bugzilla.redhat.com/show_bug.cgi?id=1539664 # https://bugzilla.redhat.com/show_bug.cgi?id=1538767 +# Temporarily disabled on s390x as it sporadically crashes with SIGFPE, Arithmetic exception. +%ifnarch s390x gdb -q "$JAVA_HOME/bin/java" < - 1:11.0.3.7-0 +- Add -mstackrealign workaround to build flags to avoid SSE issues on x86 +- Resolves: rhbz#1693468 + +* Mon Apr 08 2019 Andrew Hughes - 1:11.0.3.7-0 +- Update to shenandoah-jdk-11.0.3+7 (April 2019 GA) +- Resolves: rhbz#1693468 + +* Sat Apr 06 2019 Andrew Hughes - 1:11.0.3.6-0 +- Update to shenandoah-jdk-11.0.3+6 (April 2019 EA) +- Drop JDK-8210416/RH1632174 applied upstream. +- Drop JDK-8210425/RH1632174 applied upstream. +- Drop JDK-8210647/RH1632174 applied upstream. +- Drop JDK-8210761/RH1632174 applied upstream. +- Drop JDK-8210703/RH1632174 applied upstream. +- Add cast to resolve s390 ambiguity in call to log2_intptr +- Resolves: rhbz#1693468 + +* Wed Apr 03 2019 Andrew Hughes - 1:11.0.2.7-1 +- Disable gdb check on s390 as it sporadically fails with SIGFPE +- Resolves: rhbz#1693468 + +* Thu Mar 21 2019 Severin Gehwolf - 1:11.0.2.7-1 +- Add patch for RH1566890 +- Resolves: rhbz#1693468 + * Tue Jan 15 2019 Andrew Hughes - 1:11.0.2.7-0 - Update to shenandoah-jdk-11.0.2+7 (January 2019 CPU) - Make tagsuffix optional and comment it out while unused.