From 5e0dbcbd26a8611c1a08ec7d09d37173f4188e75 Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Tue, 18 Sep 2018 18:10:56 +0300 Subject: [PATCH] Updated to 1.8.0.181-1.b13 --- .abf.yml | 7 +- 8062808-pr3548.patch | 191 +++ 8064786-pr3599.patch | 28 + 8075942-pr3602-rh1582032.patch | 95 ++ 8141570-pr3548.patch | 55 + 8143245-pr3548.patch | 154 ++ 8144566-pr3352.patch | 911 ---------- 8146115-pr3508-rh1463098.patch | 1494 +++++++++++++++++ 8162384-pr3122-rh1358661.patch | 54 - 8165231-rh1437545.patch | 48 - 8165489-pr3589.patch | 123 ++ 8171000-pr3542-rh1402819.patch | 121 ++ 8173941-pr3326.patch | 77 - 8174164-pr3334-rh1417266.patch | 79 - 8174729-pr3336-rh1420518.patch | 122 -- 8175097-pr3334-rh1417266.patch | 100 -- 8184309-pr3596.patch | 21 + 8185723-pr3553.patch | 27 + 8186461-pr3557.patch | 32 + 8188030-pr3459-rh1484079.patch | 21 + 8197429-pr3546-rh1536622.patch | 93 + 8197546-pr3542-rh1402819.patch | 35 + 8197981-pr3548.patch | 32 + 8199936-pr3533-workaround.patch | 65 + 8201509-pr3579.patch | 36 + 8203182-pr3603-rh1568033.patch | 131 ++ 8206406-pr3610-rh1597825.patch | 65 + 8206425-hotspot-remove-debuglink.patch | 73 + ...7-pr3613-hotspot-assembler-debuginfo.patch | 27 + ...234-dont-add-unnecessary-debug-links.patch | 77 + always_assumemp.patch | 12 + java-1.8.0-openjdk-remove-intree-libraries.sh | 11 +- java-1.8.0-openjdk-rh1191652-root.patch | 32 +- java-1.8.0-openjdk.spec | 775 ++++++--- java-atk-wrapper-security.patch | 9 +- nss.cfg => nss.cfg.in | 0 pr1834-rh1022017.patch | 6 +- pr2842-01.patch | 10 +- pr2842-02.patch | 10 +- pr2888.patch | 60 + pr2974-rh1337583.patch | 36 +- pr3479-rh1486025.patch | 67 + pr3519.patch | 19 + pr3539-rh1548475.patch | 116 ++ pr3559.patch | 29 + pr3575-rh1567204.patch | 42 + pr3591.patch | 20 + pr3593-s390-size_t_format_flags.patch | 143 ++ pr3601.patch | 38 + rh1163501.patch | 59 +- rh1367357.patch | 11 - rh1566890_embargoed20180521.patch | 44 + rhbz_1538767_fix_linking.patch | 33 + suse_linuxfilestore.patch | 21 + 54 files changed, 4268 insertions(+), 1729 deletions(-) create mode 100644 8062808-pr3548.patch create mode 100644 8064786-pr3599.patch create mode 100644 8075942-pr3602-rh1582032.patch create mode 100644 8141570-pr3548.patch create mode 100644 8143245-pr3548.patch delete mode 100644 8144566-pr3352.patch create mode 100644 8146115-pr3508-rh1463098.patch delete mode 100644 8162384-pr3122-rh1358661.patch delete mode 100644 8165231-rh1437545.patch create mode 100644 8165489-pr3589.patch create mode 100644 8171000-pr3542-rh1402819.patch delete mode 100644 8173941-pr3326.patch delete mode 100644 8174164-pr3334-rh1417266.patch delete mode 100644 8174729-pr3336-rh1420518.patch delete mode 100644 8175097-pr3334-rh1417266.patch create mode 100644 8184309-pr3596.patch create mode 100644 8185723-pr3553.patch create mode 100644 8186461-pr3557.patch create mode 100644 8188030-pr3459-rh1484079.patch create mode 100644 8197429-pr3546-rh1536622.patch create mode 100644 8197546-pr3542-rh1402819.patch create mode 100644 8197981-pr3548.patch create mode 100644 8199936-pr3533-workaround.patch create mode 100644 8201509-pr3579.patch create mode 100644 8203182-pr3603-rh1568033.patch create mode 100644 8206406-pr3610-rh1597825.patch create mode 100644 8206425-hotspot-remove-debuglink.patch create mode 100644 8207057-pr3613-hotspot-assembler-debuginfo.patch create mode 100644 8207234-dont-add-unnecessary-debug-links.patch create mode 100644 always_assumemp.patch mode change 100644 => 100755 java-1.8.0-openjdk-remove-intree-libraries.sh rename nss.cfg => nss.cfg.in (100%) create mode 100644 pr2888.patch create mode 100644 pr3479-rh1486025.patch create mode 100644 pr3519.patch create mode 100644 pr3539-rh1548475.patch create mode 100644 pr3559.patch create mode 100644 pr3575-rh1567204.patch create mode 100644 pr3591.patch create mode 100644 pr3593-s390-size_t_format_flags.patch create mode 100644 pr3601.patch delete mode 100644 rh1367357.patch create mode 100644 rh1566890_embargoed20180521.patch create mode 100644 rhbz_1538767_fix_linking.patch create mode 100644 suse_linuxfilestore.patch diff --git a/.abf.yml b/.abf.yml index 2d57429..6928595 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,6 +1,9 @@ sources: 9ae547861e9f.tar.bz2: 57ce6ce3034a23c25269d1adbc0d8e7ea57cc9bc - aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u131-b12-shenandoah-merge-2017-04-20.tar.xz: 7d5825555cb570ad5031a8b975c26162aeb23296 aarch64-port-jdk8u-aarch64-jdk8u131-b12.tar.xz: f4528bd61fdf4c077895a6ea4a7a564206bce423 + aarch64-port-jdk8u-aarch64-jdk8u181-b13.tar.xz: 68194807c61d6b6a6bfbda6a9b5cd56a8e63ad8b + aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u131-b12-shenandoah-merge-2017-04-20.tar.xz: 7d5825555cb570ad5031a8b975c26162aeb23296 + aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u181-b13.tar.xz: 174fc5d1c647f3846ca6e1e0ab08e287db5c47cc + ecd5644a5ebe.tar.bz2: d49c58c72f9c1684bfef7e77fcbccda76a5c01e5 systemtap-tapset-3.4.0pre01.tar.xz: efa1d5ce7cc2a4cf2c657d883bfb487432a588c0 - + systemtap-tapset-3.6.0pre02.tar.xz: 93bca27ce5eeeb2bc1f6f3cd4ffe34c3567a3c73 diff --git a/8062808-pr3548.patch b/8062808-pr3548.patch new file mode 100644 index 0000000..e91abd3 --- /dev/null +++ b/8062808-pr3548.patch @@ -0,0 +1,191 @@ +# HG changeset patch +# User stefank +# Date 1525453613 -3600 +# Fri May 04 18:06:53 2018 +0100 +# Node ID 07a1135a327362f157955d470fad5df07cc35164 +# Parent de79964656fc652f2085dac4fe99bcc128b5a3b1 +8062808, PR3548: Turn on the -Wreturn-type warning +Reviewed-by: mgerdin, tschatzl, coleenp, jrose, kbarrett + +diff --git openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make +--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make ++++ openjdk/hotspot/make/linux/makefiles/gcc.make +@@ -210,7 +210,7 @@ + WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body + endif + +-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value ++WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wreturn-type + + ifeq ($(USE_CLANG),) + # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit +diff --git openjdk.orig/hotspot/src/cpu/x86/vm/x86_32.ad openjdk/hotspot/src/cpu/x86/vm/x86_32.ad +--- openjdk.orig/hotspot/src/cpu/x86/vm/x86_32.ad ++++ openjdk/hotspot/src/cpu/x86/vm/x86_32.ad +@@ -1250,6 +1250,7 @@ + + + Unimplemented(); ++ return 0; // Mute compiler + } + + #ifndef PRODUCT +diff --git openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp ++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +@@ -541,6 +541,7 @@ + err.report_and_die(); + + ShouldNotReachHere(); ++ return true; // Mute compiler + } + + void os::Linux::init_thread_fpu_state(void) { +diff --git openjdk.orig/hotspot/src/share/vm/classfile/defaultMethods.cpp openjdk/hotspot/src/share/vm/classfile/defaultMethods.cpp +--- openjdk.orig/hotspot/src/share/vm/classfile/defaultMethods.cpp ++++ openjdk/hotspot/src/share/vm/classfile/defaultMethods.cpp +@@ -506,7 +506,7 @@ + ss.write((const char*)name->bytes(), name->utf8_length()); + ss.write((const char*)signature->bytes(), signature->utf8_length()); + ss.print(" is abstract"); +- return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL); ++ return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD); + } + + Symbol* MethodFamily::generate_conflicts_message(GrowableArray* methods, TRAPS) const { +@@ -521,7 +521,7 @@ + ss.print("."); + ss.write((const char*)name->bytes(), name->utf8_length()); + } +- return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL); ++ return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD); + } + + +diff --git openjdk.orig/hotspot/src/share/vm/classfile/symbolTable.cpp openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp +--- openjdk.orig/hotspot/src/share/vm/classfile/symbolTable.cpp ++++ openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp +@@ -249,7 +249,7 @@ + MutexLocker ml(SymbolTable_lock, THREAD); + + // Otherwise, add to symbol to table +- return the_table()->basic_add(index, (u1*)name, len, hashValue, true, CHECK_NULL); ++ return the_table()->basic_add(index, (u1*)name, len, hashValue, true, THREAD); + } + + Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) { +@@ -288,7 +288,7 @@ + // Grab SymbolTable_lock first. + MutexLocker ml(SymbolTable_lock, THREAD); + +- return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, CHECK_NULL); ++ return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, THREAD); + } + + Symbol* SymbolTable::lookup_only(const char* name, int len, +diff --git openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp +--- openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp ++++ openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp +@@ -229,15 +229,15 @@ + class_name->as_C_string(), + class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string())); + if (FieldType::is_array(class_name)) { +- return resolve_array_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL); ++ return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD); + } else if (FieldType::is_obj(class_name)) { + ResourceMark rm(THREAD); + // Ignore wrapping L and ;. + TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1, + class_name->utf8_length() - 2, CHECK_NULL); +- return resolve_instance_class_or_null(name, class_loader, protection_domain, CHECK_NULL); ++ return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD); + } else { +- return resolve_instance_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL); ++ return resolve_instance_class_or_null(class_name, class_loader, protection_domain, THREAD); + } + } + +diff --git openjdk.orig/hotspot/src/share/vm/memory/heapInspection.hpp openjdk/hotspot/src/share/vm/memory/heapInspection.hpp +--- openjdk.orig/hotspot/src/share/vm/memory/heapInspection.hpp ++++ openjdk/hotspot/src/share/vm/memory/heapInspection.hpp +@@ -367,7 +367,7 @@ + _csv_format(csv_format), _print_help(print_help), + _print_class_stats(print_class_stats), _columns(columns) {} + void heap_inspection(outputStream* st) NOT_SERVICES_RETURN; +- size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN; ++ size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0); + static void find_instances_at_safepoint(Klass* k, GrowableArray* result) NOT_SERVICES_RETURN; + private: + void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL); +diff --git openjdk.orig/hotspot/src/share/vm/memory/metaspaceShared.hpp openjdk/hotspot/src/share/vm/memory/metaspaceShared.hpp +--- openjdk.orig/hotspot/src/share/vm/memory/metaspaceShared.hpp ++++ openjdk/hotspot/src/share/vm/memory/metaspaceShared.hpp +@@ -93,7 +93,7 @@ + static void preload_and_dump(TRAPS) NOT_CDS_RETURN; + static int preload_and_dump(const char * class_list_path, + GrowableArray* class_promote_order, +- TRAPS) NOT_CDS_RETURN; ++ TRAPS) NOT_CDS_RETURN_(0); + + static ReservedSpace* shared_rs() { + CDS_ONLY(return _shared_rs); +diff --git openjdk.orig/hotspot/src/share/vm/oops/constantPool.hpp openjdk/hotspot/src/share/vm/oops/constantPool.hpp +--- openjdk.orig/hotspot/src/share/vm/oops/constantPool.hpp ++++ openjdk/hotspot/src/share/vm/oops/constantPool.hpp +@@ -352,7 +352,7 @@ + + Klass* klass_at(int which, TRAPS) { + constantPoolHandle h_this(THREAD, this); +- return klass_at_impl(h_this, which, CHECK_NULL); ++ return klass_at_impl(h_this, which, THREAD); + } + + Symbol* klass_name_at(int which); // Returns the name, w/o resolving. +diff --git openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp openjdk/hotspot/src/share/vm/prims/jvm.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp ++++ openjdk/hotspot/src/share/vm/prims/jvm.cpp +@@ -4244,7 +4244,7 @@ + JVM_DTraceProvider* providers)) + JVMWrapper("JVM_DTraceActivate"); + return DTraceJSDT::activate( +- version, module_name, providers_count, providers, CHECK_0); ++ version, module_name, providers_count, providers, THREAD); + JVM_END + + JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method)) +diff --git openjdk.orig/hotspot/src/share/vm/runtime/reflection.cpp openjdk/hotspot/src/share/vm/runtime/reflection.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/reflection.cpp ++++ openjdk/hotspot/src/share/vm/runtime/reflection.cpp +@@ -1093,7 +1093,7 @@ + } else { + if (rtype == T_BOOLEAN || rtype == T_BYTE || rtype == T_CHAR || rtype == T_SHORT) + narrow((jvalue*) result.get_value_addr(), rtype, CHECK_NULL); +- return box((jvalue*) result.get_value_addr(), rtype, CHECK_NULL); ++ return box((jvalue*) result.get_value_addr(), rtype, THREAD); + } + } + +diff --git openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp ++++ openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp +@@ -1046,7 +1046,7 @@ + // last java frame on stack (which includes native call frames) + vframeStream vfst(thread, true); // Do not skip and javaCalls + +- return find_callee_info_helper(thread, vfst, bc, callinfo, CHECK_(Handle())); ++ return find_callee_info_helper(thread, vfst, bc, callinfo, THREAD); + } + + +diff --git openjdk.orig/hotspot/src/share/vm/services/memTracker.hpp openjdk/hotspot/src/share/vm/services/memTracker.hpp +--- openjdk.orig/hotspot/src/share/vm/services/memTracker.hpp ++++ openjdk/hotspot/src/share/vm/services/memTracker.hpp +@@ -64,7 +64,7 @@ + const NativeCallStack& stack, MEMFLAGS flag = mtNone) { } + static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { } + static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); } +- static inline Tracker get_virtual_memory_release_tracker() { } ++ static inline Tracker get_virtual_memory_release_tracker() { return Tracker(); } + static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { } + static inline void record_thread_stack(void* addr, size_t size) { } + static inline void release_thread_stack(void* addr, size_t size) { } diff --git a/8064786-pr3599.patch b/8064786-pr3599.patch new file mode 100644 index 0000000..790ee0d --- /dev/null +++ b/8064786-pr3599.patch @@ -0,0 +1,28 @@ +# HG changeset patch +# User goetz +# Date 1415873641 -3600 +# Thu Nov 13 11:14:01 2014 +0100 +# Node ID 1878c4c1d04e1f3c6f67a19d36c35863d6b5f906 +# Parent 533473c67de6ff767710594639033c8e83523fe5 +8064786, PR3599: Fix debug build after 8062808: Turn on the -Wreturn-type warning +Reviewed-by: stefank, tschatzl + +diff --git openjdk.orig/hotspot/src/share/vm/prims/jni.cpp openjdk/hotspot/src/share/vm/prims/jni.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp ++++ openjdk/hotspot/src/share/vm/prims/jni.cpp +@@ -708,6 +708,7 @@ + + THROW_OOP_(JNIHandles::resolve(obj), JNI_OK); + ShouldNotReachHere(); ++ return 0; // Mute compiler. + JNI_END + + #ifndef USDT2 +@@ -734,6 +735,7 @@ + Handle protection_domain (THREAD, k->protection_domain()); + THROW_MSG_LOADER_(name, (char *)message, class_loader, protection_domain, JNI_OK); + ShouldNotReachHere(); ++ return 0; // Mute compiler. + JNI_END + + diff --git a/8075942-pr3602-rh1582032.patch b/8075942-pr3602-rh1582032.patch new file mode 100644 index 0000000..bd2a40e --- /dev/null +++ b/8075942-pr3602-rh1582032.patch @@ -0,0 +1,95 @@ +# HG changeset patch +# User prr +# Date 1429299166 25200 +# Fri Apr 17 12:32:46 2015 -0700 +# Node ID 1f4b038b9550afaf88a70cee4cf9c1422ecd86d6 +# Parent 533117ae5b7587c8d9c0612581682ab984475430 +8075942, PR3602: ArrayIndexOutOfBoundsException in sun.java2d.pisces.Dasher.goTo +Reviewed-by: flar, lbourges + +diff --git openjdk.orig/jdk/src/share/classes/sun/java2d/pisces/Dasher.java openjdk/jdk/src/share/classes/sun/java2d/pisces/Dasher.java +--- openjdk.orig/jdk/src/share/classes/sun/java2d/pisces/Dasher.java ++++ openjdk/jdk/src/share/classes/sun/java2d/pisces/Dasher.java +@@ -146,7 +146,7 @@ + if (dashOn) { + if (starting) { + firstSegmentsBuffer = Helpers.widenArray(firstSegmentsBuffer, +- firstSegidx, type - 2); ++ firstSegidx, type - 2 + 1); + firstSegmentsBuffer[firstSegidx++] = type; + System.arraycopy(pts, off, firstSegmentsBuffer, firstSegidx, type - 2); + firstSegidx += type - 2; +diff --git a/test/javopenjdk.orig/jdk/awt/BasicStroke/DashStrokeTest.java openjdk/jdk/test/java/awt/BasicStroke/DashStrokeTest.java +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/java/awt/BasicStroke/DashStrokeTest.java +@@ -0,0 +1,69 @@ ++/* ++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ * @test ++ * @bug 8075942 ++ * @summary test there is no exception rendering a dashed stroke ++ * @run DashStrokeTest ++ * @run -Dsun.java2d.renderer=sun.java2d.pisces.PiscesRenderingEngine ++ */ ++ ++import java.awt.BasicStroke; ++import java.awt.Color; ++import java.awt.Graphics2D; ++import java.awt.Stroke; ++import java.awt.geom.GeneralPath; ++import java.awt.image.BufferedImage; ++ ++ ++public class DashStrokeTest { ++ ++ public static void main(String[] args) { ++ ++ GeneralPath shape = new GeneralPath(); ++ int[] pointTypes = {0, 0, 1, 1, 0, 1, 1, 0}; ++ double[] xpoints = {428, 420, 400, 400, 400, 400, 420, 733}; ++ double[] ypoints = {180, 180, 180, 160, 30, 10, 10, 10}; ++ shape.moveTo(xpoints[0], ypoints[0]); ++ for (int i = 1; i < pointTypes.length; i++) { ++ if (pointTypes[i] == 1 && i < pointTypes.length - 1) { ++ shape.quadTo(xpoints[i], ypoints[i], ++ xpoints[i + 1], ypoints[i + 1]); ++ } else { ++ shape.lineTo(xpoints[i], ypoints[i]); ++ } ++ } ++ ++ BufferedImage image = new ++ BufferedImage(1000, 1000, BufferedImage.TYPE_INT_ARGB); ++ Graphics2D g2 = image.createGraphics(); ++ ++ Color color = new Color(124, 0, 124, 255); ++ g2.setColor(color); ++ Stroke stroke = new BasicStroke(1.0f, ++ BasicStroke.CAP_BUTT, ++ BasicStroke.JOIN_BEVEL, ++ 10.0f, new float[] {9, 6}, 0.0f); ++ g2.setStroke(stroke); ++ g2.draw(shape); ++ } ++} diff --git a/8141570-pr3548.patch b/8141570-pr3548.patch new file mode 100644 index 0000000..f1e3215 --- /dev/null +++ b/8141570-pr3548.patch @@ -0,0 +1,55 @@ +# HG changeset patch +# User coleenp +# Date 1525713256 -3600 +# Mon May 07 18:14:16 2018 +0100 +# Node ID bcbc64dfb629c5f188bbf59b8f986ad95963ed60 +# Parent 07a1135a327362f157955d470fad5df07cc35164 +8141570, PR3548: Fix Zero interpreter build for --disable-precompiled-headers +Summary: change to include atomic.inline.hpp and allocation.inline.hpp only in .cpp files and some build fixes from Kim to build on ubuntu without devkits +Reviewed-by: kbarrett, sgehwolf, erikj + +diff --git openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make +--- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make ++++ openjdk/hotspot/make/linux/makefiles/zeroshark.make +@@ -1,5 +1,5 @@ + # +-# Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. ++# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + # Copyright 2007, 2008 Red Hat, Inc. + # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + # +@@ -25,8 +25,15 @@ + + # Setup common to Zero (non-Shark) and Shark versions of VM + +-# override this from the main file because some version of llvm do not like -Wundef +-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wunused-function -Wunused-value ++# Some versions of llvm do not like -Wundef ++ifeq ($(USE_CLANG), true) ++ WARNING_FLAGS += -Wno-undef ++endif ++# Suppress some warning flags that are normally turned on for hotspot, ++# because some of the zero code has not been updated accordingly. ++WARNING_FLAGS += -Wno-return-type \ ++ -Wno-format-nonliteral -Wno-format-security \ ++ -Wno-maybe-uninitialized + + # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) +@@ -42,5 +49,3 @@ + ifeq ($(ARCH_DATA_MODEL), 64) + CFLAGS += -D_LP64=1 + endif +- +-OPT_CFLAGS/compactingPermGenGen.o = -O1 +diff --git openjdk.orig/hotspot/src/share/vm/runtime/java.cpp openjdk/hotspot/src/share/vm/runtime/java.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/java.cpp ++++ openjdk/hotspot/src/share/vm/runtime/java.cpp +@@ -45,6 +45,7 @@ + #include "runtime/arguments.hpp" + #include "runtime/biasedLocking.hpp" + #include "runtime/compilationPolicy.hpp" ++#include "runtime/deoptimization.hpp" + #include "runtime/fprofiler.hpp" + #include "runtime/init.hpp" + #include "runtime/interfaceSupport.hpp" diff --git a/8143245-pr3548.patch b/8143245-pr3548.patch new file mode 100644 index 0000000..eccb110 --- /dev/null +++ b/8143245-pr3548.patch @@ -0,0 +1,154 @@ +# HG changeset patch +# User sgehwolf +# Date 1525714161 -3600 +# Mon May 07 18:29:21 2018 +0100 +# Node ID afb31413c73cbc06420fdb447aa90a7a38258904 +# Parent bcbc64dfb629c5f188bbf59b8f986ad95963ed60 +8143245, PR3548: Zero build requires disabled warnings +Reviewed-by: dholmes, coleenp + +diff --git openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make +--- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make ++++ openjdk/hotspot/make/linux/makefiles/zeroshark.make +@@ -1,5 +1,5 @@ + # +-# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. ++# Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + # Copyright 2007, 2008 Red Hat, Inc. + # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + # +@@ -29,11 +29,6 @@ + ifeq ($(USE_CLANG), true) + WARNING_FLAGS += -Wno-undef + endif +-# Suppress some warning flags that are normally turned on for hotspot, +-# because some of the zero code has not been updated accordingly. +-WARNING_FLAGS += -Wno-return-type \ +- -Wno-format-nonliteral -Wno-format-security \ +- -Wno-maybe-uninitialized + + # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) +diff --git openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +--- openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp ++++ openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +@@ -100,7 +100,7 @@ + case T_DOUBLE: + case T_VOID: + return result; +- default : ShouldNotReachHere(); ++ default : ShouldNotReachHere(); return NULL_WORD; + } + } + +diff --git openjdk.orig/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp openjdk/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp +--- openjdk.orig/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp ++++ openjdk/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright 2007, 2008, 2010 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * +@@ -62,7 +62,7 @@ + } + + void InterpreterRuntime::SignatureHandlerGeneratorBase::push(BasicType type) { +- ffi_type *ftype; ++ ffi_type *ftype = NULL; + switch (type) { + case T_VOID: + ftype = &ffi_type_void; +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +@@ -1,6 +1,6 @@ + /* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +- * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. ++ * Copyright 2016 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -61,6 +61,7 @@ + + frame os::get_sender_for_C_frame(frame* fr) { + ShouldNotCallThis(); ++ return frame(NULL, NULL); // silence compile warning. + } + + frame os::current_frame() { +@@ -98,16 +99,19 @@ + + address os::Linux::ucontext_get_pc(ucontext_t* uc) { + ShouldNotCallThis(); ++ return NULL; // silence compile warnings + } + + ExtendedPC os::fetch_frame_from_context(void* ucVoid, + intptr_t** ret_sp, + intptr_t** ret_fp) { + ShouldNotCallThis(); ++ return NULL; // silence compile warnings + } + + frame os::fetch_frame_from_context(void* ucVoid) { + ShouldNotCallThis(); ++ return frame(NULL, NULL); // silence compile warnings + } + + extern "C" JNIEXPORT int +@@ -247,11 +251,16 @@ + } + #endif // !PRODUCT + +- const char *fmt = "caught unhandled signal %d"; + char buf[64]; + +- sprintf(buf, fmt, sig); ++ sprintf(buf, "caught unhandled signal %d", sig); ++ ++// Silence -Wformat-security warning for fatal() ++PRAGMA_DIAG_PUSH ++PRAGMA_FORMAT_NONLITERAL_IGNORED + fatal(buf); ++PRAGMA_DIAG_POP ++ return true; // silence compiler warnings + } + + void os::Linux::init_thread_fpu_state(void) { +@@ -260,6 +269,7 @@ + + int os::Linux::get_fpu_control_word() { + ShouldNotCallThis(); ++ return -1; // silence compile warnings + } + + void os::Linux::set_fpu_control_word(int fpu) { +@@ -408,6 +418,7 @@ + + extern "C" { + int SpinPause() { ++ return -1; // silence compile warnings + } + + +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * +@@ -110,6 +110,7 @@ + void* ucontext, + bool isInJava) { + ShouldNotCallThis(); ++ return false; // silence compile warning + } + + // These routines are only used on cpu architectures that diff --git a/8144566-pr3352.patch b/8144566-pr3352.patch deleted file mode 100644 index 9a2a294..0000000 --- a/8144566-pr3352.patch +++ /dev/null @@ -1,911 +0,0 @@ -# HG changeset patch -# User rpatil -# Date 1474623897 -19800 -# Fri Sep 23 15:14:57 2016 +0530 -# Node ID fb617df8fbac42e962219e45cbd29b15b5ecdc63 -# Parent d41592af9af3790fe5eee30ce686d85cff09c942 -8144566, PR3352: Custom HostnameVerifier disables SNI extension -Reviewed-by: coffeys - -diff --git a/src/share/classes/sun/security/ssl/SSLSocketImpl.java b/src/share/classes/sun/security/ssl/SSLSocketImpl.java ---- openjdk/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java -+++ openjdk/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -220,6 +220,11 @@ - Collections.emptyList(); - Collection sniMatchers = - Collections.emptyList(); -+ // Is the serverNames set to empty with SSLParameters.setServerNames()? -+ private boolean noSniExtension = false; -+ -+ // Is the sniMatchers set to empty with SSLParameters.setSNIMatchers()? -+ private boolean noSniMatcher = false; - - /* - * READ ME * READ ME * READ ME * READ ME * READ ME * READ ME * -@@ -666,6 +671,11 @@ - } - - super.connect(endpoint, timeout); -+ -+ if (host == null || host.length() == 0) { -+ useImplicitHost(false); -+ } -+ - doneConnect(); - } - -@@ -2158,41 +2168,61 @@ - output.r.setVersion(protocolVersion); - } - -+ // -+ // ONLY used by ClientHandshaker for the server hostname during handshaking -+ // - synchronized String getHost() { - // Note that the host may be null or empty for localhost. - if (host == null || host.length() == 0) { -- if (!trustNameService) { -- // If the local name service is not trustworthy, reverse host -- // name resolution should not be performed for endpoint -- // identification. Use the application original specified -- // hostname or IP address instead. -- host = getOriginalHostname(getInetAddress()); -- } else { -- host = getInetAddress().getHostName(); -- } -+ useImplicitHost(true); - } - - return host; - } - - /* -- * Get the original application specified hostname. -+ * Try to set and use the implicit specified hostname - */ -- private static String getOriginalHostname(InetAddress inetAddress) { -- /* -- * Get the original hostname via sun.misc.SharedSecrets. -- */ -+ private synchronized void useImplicitHost(boolean noSniUpdate) { -+ -+ // Note: If the local name service is not trustworthy, reverse -+ // host name resolution should not be performed for endpoint -+ // identification. Use the application original specified -+ // hostname or IP address instead. -+ -+ // Get the original hostname via jdk.internal.misc.SharedSecrets -+ InetAddress inetAddress = getInetAddress(); -+ if (inetAddress == null) { // not connected -+ return; -+ } -+ - JavaNetAccess jna = SharedSecrets.getJavaNetAccess(); - String originalHostname = jna.getOriginalHostName(inetAddress); -+ if ((originalHostname != null) && -+ (originalHostname.length() != 0)) { - -- /* -- * If no application specified hostname, use the IP address. -- */ -- if (originalHostname == null || originalHostname.length() == 0) { -- originalHostname = inetAddress.getHostAddress(); -+ host = originalHostname; -+ if (!noSniUpdate && serverNames.isEmpty() && !noSniExtension) { -+ serverNames = -+ Utilities.addToSNIServerNameList(serverNames, host); -+ -+ if (!roleIsServer && -+ (handshaker != null) && !handshaker.started()) { -+ handshaker.setSNIServerNames(serverNames); -+ } -+ } -+ -+ return; - } - -- return originalHostname; -+ // No explicitly specified hostname, no server name indication. -+ if (!trustNameService) { -+ // The local name service is not trustworthy, use IP address. -+ host = inetAddress.getHostAddress(); -+ } else { -+ // Use the underlying reverse host name resolution service. -+ host = getInetAddress().getHostName(); -+ } - } - - -@@ -2205,6 +2235,10 @@ - this.host = host; - this.serverNames = - Utilities.addToSNIServerNameList(this.serverNames, this.host); -+ -+ if (!roleIsServer && (handshaker != null) && !handshaker.started()) { -+ handshaker.setSNIServerNames(serverNames); -+ } - } - - /** -@@ -2571,8 +2605,21 @@ - // the super implementation does not handle the following parameters - params.setEndpointIdentificationAlgorithm(identificationProtocol); - params.setAlgorithmConstraints(algorithmConstraints); -- params.setSNIMatchers(sniMatchers); -- params.setServerNames(serverNames); -+ -+ if (sniMatchers.isEmpty() && !noSniMatcher) { -+ // 'null' indicates none has been set -+ params.setSNIMatchers(null); -+ } else { -+ params.setSNIMatchers(sniMatchers); -+ } -+ -+ if (serverNames.isEmpty() && !noSniExtension) { -+ // 'null' indicates none has been set -+ params.setServerNames(null); -+ } else { -+ params.setServerNames(serverNames); -+ } -+ - params.setUseCipherSuitesOrder(preferLocalCipherSuites); - - return params; -@@ -2592,11 +2639,13 @@ - - List sniNames = params.getServerNames(); - if (sniNames != null) { -+ noSniExtension = sniNames.isEmpty(); - serverNames = sniNames; - } - - Collection matchers = params.getSNIMatchers(); - if (matchers != null) { -+ noSniMatcher = matchers.isEmpty(); - sniMatchers = matchers; - } - -diff --git a/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java b/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java -new file mode 100644 ---- /dev/null -+++ openjdk/jdk/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java -@@ -0,0 +1,337 @@ -+/* -+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+// -+// SunJSSE does not support dynamic system properties, no way to re-use -+// system properties in samevm/agentvm mode. -+// -+ -+/** -+ * @test -+ * @bug 8144566 -+ * @summary Custom HostnameVerifier disables SNI extension -+ * @run main/othervm BestEffortOnLazyConnected -+ */ -+ -+import java.io.*; -+import java.nio.*; -+import java.nio.channels.*; -+import java.util.*; -+import java.net.*; -+import javax.net.ssl.*; -+ -+public class BestEffortOnLazyConnected { -+ -+ /* -+ * ============================================================= -+ * Set the various variables needed for the tests, then -+ * specify what tests to run on each side. -+ */ -+ -+ /* -+ * Should we run the client or server in a separate thread? -+ * Both sides can throw exceptions, but do you have a preference -+ * as to which side should be the main thread. -+ */ -+ private static final boolean separateServerThread = true; -+ -+ /* -+ * Where do we find the keystores? -+ */ -+ private static final String pathToStores = "../../../../sun/security/ssl/etc"; -+ private static final String keyStoreFile = "keystore"; -+ private static final String trustStoreFile = "truststore"; -+ private static final String passwd = "passphrase"; -+ -+ /* -+ * Is the server ready to serve? -+ */ -+ private static volatile boolean serverReady = false; -+ -+ /* -+ * Turn on SSL debugging? -+ */ -+ private static final boolean debug = false; -+ -+ /* -+ * the fully qualified domain name of localhost -+ */ -+ private static String hostname = null; -+ -+ /* -+ * If the client or server is doing some kind of object creation -+ * that the other side depends on, and that thread prematurely -+ * exits, you may experience a hang. The test harness will -+ * terminate all hung threads after its timeout has expired, -+ * currently 3 minutes by default, but you might try to be -+ * smart about it.... -+ */ -+ -+ /* -+ * Define the server side of the test. -+ * -+ * If the server prematurely exits, serverReady will be set to true -+ * to avoid infinite hangs. -+ */ -+ private void doServerSide() throws Exception { -+ SSLServerSocketFactory sslssf = -+ (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); -+ try (SSLServerSocket sslServerSocket = -+ (SSLServerSocket) sslssf.createServerSocket(serverPort)) { -+ -+ serverPort = sslServerSocket.getLocalPort(); -+ -+ /* -+ * Signal Client, we're ready for his connect. -+ */ -+ serverReady = true; -+ -+ try (SSLSocket sslSocket = (SSLSocket)sslServerSocket.accept()) { -+ InputStream sslIS = sslSocket.getInputStream(); -+ OutputStream sslOS = sslSocket.getOutputStream(); -+ -+ sslIS.read(); -+ sslOS.write(85); -+ sslOS.flush(); -+ -+ ExtendedSSLSession session = -+ (ExtendedSSLSession)sslSocket.getSession(); -+ if (session.getRequestedServerNames().isEmpty()) { -+ throw new Exception("No expected Server Name Indication"); -+ } -+ } -+ } -+ } -+ -+ /* -+ * Define the client side of the test. -+ * -+ * If the server prematurely exits, serverReady will be set to true -+ * to avoid infinite hangs. -+ */ -+ private void doClientSide() throws Exception { -+ -+ /* -+ * Wait for server to get started. -+ */ -+ while (!serverReady) { -+ Thread.sleep(50); -+ } -+ -+ SSLSocketFactory sslsf = -+ (SSLSocketFactory) SSLSocketFactory.getDefault(); -+ -+ try (SSLSocket sslSocket = (SSLSocket)sslsf.createSocket()) { -+ -+ sslSocket.connect(new InetSocketAddress(hostname, serverPort), 0); -+ -+ InputStream sslIS = sslSocket.getInputStream(); -+ OutputStream sslOS = sslSocket.getOutputStream(); -+ -+ sslOS.write(280); -+ sslOS.flush(); -+ sslIS.read(); -+ } -+ } -+ -+ -+ /* -+ * ============================================================= -+ * The remainder is just support stuff -+ */ -+ -+ // use any free port by default -+ private volatile int serverPort = 0; -+ -+ private volatile Exception serverException = null; -+ private volatile Exception clientException = null; -+ -+ public static void main(String[] args) throws Exception { -+ String keyFilename = -+ System.getProperty("test.src", ".") + "/" + pathToStores + -+ "/" + keyStoreFile; -+ String trustFilename = -+ System.getProperty("test.src", ".") + "/" + pathToStores + -+ "/" + trustStoreFile; -+ -+ System.setProperty("javax.net.ssl.keyStore", keyFilename); -+ System.setProperty("javax.net.ssl.keyStorePassword", passwd); -+ System.setProperty("javax.net.ssl.trustStore", trustFilename); -+ System.setProperty("javax.net.ssl.trustStorePassword", passwd); -+ -+ if (debug) { -+ System.setProperty("javax.net.debug", "all"); -+ } -+ -+ try { -+ hostname = InetAddress.getLocalHost().getCanonicalHostName(); -+ } catch (UnknownHostException uhe) { -+ System.out.println( -+ "Ignore the test as the local hostname cannot be determined"); -+ -+ return; -+ } -+ -+ System.out.println( -+ "The fully qualified domain name of the local host is " + -+ hostname); -+ // Ignore the test if the hostname does not sound like a domain name. -+ if ((hostname == null) || hostname.isEmpty() || -+ hostname.startsWith("localhost") || -+ Character.isDigit(hostname.charAt(hostname.length() - 1))) { -+ -+ System.out.println("Ignore the test as the local hostname " + -+ "cannot be determined as fully qualified domain name"); -+ -+ return; -+ } -+ -+ /* -+ * Start the tests. -+ */ -+ new BestEffortOnLazyConnected(); -+ } -+ -+ private Thread clientThread = null; -+ private Thread serverThread = null; -+ -+ /* -+ * Primary constructor, used to drive remainder of the test. -+ * -+ * Fork off the other side, then do your work. -+ */ -+ BestEffortOnLazyConnected() throws Exception { -+ try { -+ if (separateServerThread) { -+ startServer(true); -+ startClient(false); -+ } else { -+ startClient(true); -+ startServer(false); -+ } -+ } catch (Exception e) { -+ // swallow for now. Show later -+ } -+ -+ /* -+ * Wait for other side to close down. -+ */ -+ if (separateServerThread) { -+ serverThread.join(); -+ } else { -+ clientThread.join(); -+ } -+ -+ /* -+ * When we get here, the test is pretty much over. -+ * Which side threw the error? -+ */ -+ Exception local; -+ Exception remote; -+ String whichRemote; -+ -+ if (separateServerThread) { -+ remote = serverException; -+ local = clientException; -+ whichRemote = "server"; -+ } else { -+ remote = clientException; -+ local = serverException; -+ whichRemote = "client"; -+ } -+ -+ /* -+ * If both failed, return the curthread's exception, but also -+ * print the remote side Exception -+ */ -+ if ((local != null) && (remote != null)) { -+ System.out.println(whichRemote + " also threw:"); -+ remote.printStackTrace(); -+ System.out.println(); -+ throw local; -+ } -+ -+ if (remote != null) { -+ throw remote; -+ } -+ -+ if (local != null) { -+ throw local; -+ } -+ } -+ -+ private void startServer(boolean newThread) throws Exception { -+ if (newThread) { -+ serverThread = new Thread() { -+ public void run() { -+ try { -+ doServerSide(); -+ } catch (Exception e) { -+ /* -+ * Our server thread just died. -+ * -+ * Release the client, if not active already... -+ */ -+ System.err.println("Server died..."); -+ serverReady = true; -+ serverException = e; -+ } -+ } -+ }; -+ serverThread.start(); -+ } else { -+ try { -+ doServerSide(); -+ } catch (Exception e) { -+ serverException = e; -+ } finally { -+ serverReady = true; -+ } -+ } -+ } -+ -+ private void startClient(boolean newThread) throws Exception { -+ if (newThread) { -+ clientThread = new Thread() { -+ public void run() { -+ try { -+ doClientSide(); -+ } catch (Exception e) { -+ /* -+ * Our client thread just died. -+ */ -+ System.err.println("Client died..."); -+ clientException = e; -+ } -+ } -+ }; -+ clientThread.start(); -+ } else { -+ try { -+ doClientSide(); -+ } catch (Exception e) { -+ clientException = e; -+ } -+ } -+ } -+} -diff --git a/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java b/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java -new file mode 100644 ---- /dev/null -+++ openjdk/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java -@@ -0,0 +1,390 @@ -+/* -+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+// -+// SunJSSE does not support dynamic system properties, no way to re-use -+// system properties in samevm/agentvm mode. -+// -+ -+/* -+ * @test -+ * @bug 8144566 -+ * @summary Custom HostnameVerifier disables SNI extension -+ * @run main/othervm ImpactOnSNI -+ */ -+ -+import java.io.*; -+import java.net.*; -+import javax.net.ssl.*; -+ -+public class ImpactOnSNI { -+ -+ /* -+ * ============================================================= -+ * Set the various variables needed for the tests, then -+ * specify what tests to run on each side. -+ */ -+ -+ /* -+ * Should we run the client or server in a separate thread? -+ * Both sides can throw exceptions, but do you have a preference -+ * as to which side should be the main thread. -+ */ -+ private static final boolean separateServerThread = true; -+ -+ /* -+ * Where do we find the keystores? -+ */ -+ private static final String pathToStores = -+ "../../../../../../sun/security/ssl/etc"; -+ private static final String keyStoreFile = "keystore"; -+ private static final String trustStoreFile = "truststore"; -+ private static final String passwd = "passphrase"; -+ -+ /* -+ * Is the server ready to serve? -+ */ -+ private static volatile boolean serverReady = false; -+ -+ /* -+ * Is the connection ready to close? -+ */ -+ private static volatile boolean closeReady = false; -+ -+ /* -+ * Turn on SSL debugging? -+ */ -+ private static final boolean debug = false; -+ -+ /* -+ * Message posted -+ */ -+ private static final String postMsg = "HTTP post on a https server"; -+ -+ /* -+ * the fully qualified domain name of localhost -+ */ -+ private static String hostname = null; -+ -+ /* -+ * If the client or server is doing some kind of object creation -+ * that the other side depends on, and that thread prematurely -+ * exits, you may experience a hang. The test harness will -+ * terminate all hung threads after its timeout has expired, -+ * currently 3 minutes by default, but you might try to be -+ * smart about it.... -+ */ -+ -+ /* -+ * Define the server side of the test. -+ * -+ * If the server prematurely exits, serverReady will be set to true -+ * to avoid infinite hangs. -+ */ -+ private void doServerSide() throws Exception { -+ SSLServerSocketFactory sslssf = -+ (SSLServerSocketFactory)SSLServerSocketFactory.getDefault(); -+ try (SSLServerSocket sslServerSocket = -+ (SSLServerSocket)sslssf.createServerSocket(serverPort)) { -+ -+ serverPort = sslServerSocket.getLocalPort(); -+ -+ /* -+ * Signal Client, we're ready for his connect. -+ */ -+ serverReady = true; -+ -+ /* -+ * Accept connections -+ */ -+ try (SSLSocket sslSocket = (SSLSocket)sslServerSocket.accept()) { -+ InputStream sslIS = sslSocket.getInputStream(); -+ OutputStream sslOS = sslSocket.getOutputStream(); -+ BufferedReader br = -+ new BufferedReader(new InputStreamReader(sslIS)); -+ PrintStream ps = new PrintStream(sslOS); -+ -+ // process HTTP POST request from client -+ System.out.println("status line: " + br.readLine()); -+ String msg = null; -+ while ((msg = br.readLine()) != null && msg.length() > 0); -+ -+ msg = br.readLine(); -+ if (msg.equals(postMsg)) { -+ ps.println("HTTP/1.1 200 OK\n\n"); -+ } else { -+ ps.println("HTTP/1.1 500 Not OK\n\n"); -+ } -+ ps.flush(); -+ -+ ExtendedSSLSession session = -+ (ExtendedSSLSession)sslSocket.getSession(); -+ if (session.getRequestedServerNames().isEmpty()) { -+ throw new Exception("No expected Server Name Indication"); -+ } -+ -+ // close the socket -+ while (!closeReady) { -+ Thread.sleep(50); -+ } -+ } -+ } -+ } -+ -+ /* -+ * Define the client side of the test. -+ * -+ * If the server prematurely exits, serverReady will be set to true -+ * to avoid infinite hangs. -+ */ -+ private void doClientSide() throws Exception { -+ /* -+ * Wait for server to get started. -+ */ -+ while (!serverReady) { -+ Thread.sleep(50); -+ } -+ -+ // Send HTTP POST request to server -+ URL url = new URL("https://" + hostname + ":" + serverPort); -+ -+ HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier()); -+ HttpsURLConnection http = (HttpsURLConnection)url.openConnection(); -+ http.setDoOutput(true); -+ -+ http.setRequestMethod("POST"); -+ PrintStream ps = new PrintStream(http.getOutputStream()); -+ try { -+ ps.println(postMsg); -+ ps.flush(); -+ if (http.getResponseCode() != 200) { -+ throw new RuntimeException("test Failed"); -+ } -+ } finally { -+ ps.close(); -+ http.disconnect(); -+ closeReady = true; -+ } -+ } -+ -+ private static class NameVerifier implements HostnameVerifier { -+ public boolean verify(String hostname, SSLSession session) { -+ return true; -+ } -+ } -+ -+ /* -+ * ============================================================= -+ * The remainder is just support stuff -+ */ -+ -+ // use any free port by default -+ private volatile int serverPort = 0; -+ -+ private volatile Exception serverException = null; -+ private volatile Exception clientException = null; -+ -+ public static void main(String[] args) throws Exception { -+ String keyFilename = -+ System.getProperty("test.src", "./") + "/" + pathToStores + -+ "/" + keyStoreFile; -+ String trustFilename = -+ System.getProperty("test.src", "./") + "/" + pathToStores + -+ "/" + trustStoreFile; -+ -+ System.setProperty("javax.net.ssl.keyStore", keyFilename); -+ System.setProperty("javax.net.ssl.keyStorePassword", passwd); -+ System.setProperty("javax.net.ssl.trustStore", trustFilename); -+ System.setProperty("javax.net.ssl.trustStorePassword", passwd); -+ -+ if (debug) { -+ System.setProperty("javax.net.debug", "all"); -+ } -+ -+ try { -+ hostname = InetAddress.getLocalHost().getCanonicalHostName(); -+ } catch (UnknownHostException uhe) { -+ System.out.println( -+ "Ignore the test as the local hostname cannot be determined"); -+ -+ return; -+ } -+ -+ System.out.println( -+ "The fully qualified domain name of the local host is " + -+ hostname); -+ // Ignore the test if the hostname does not sound like a domain name. -+ if ((hostname == null) || hostname.isEmpty() || -+ hostname.startsWith("localhost") || -+ Character.isDigit(hostname.charAt(hostname.length() - 1))) { -+ -+ System.out.println("Ignore the test as the local hostname " + -+ "cannot be determined as fully qualified domain name"); -+ -+ return; -+ } -+ -+ /* -+ * Start the tests. -+ */ -+ new ImpactOnSNI(); -+ } -+ -+ private Thread clientThread = null; -+ private Thread serverThread = null; -+ -+ /* -+ * Primary constructor, used to drive remainder of the test. -+ * -+ * Fork off the other side, then do your work. -+ */ -+ ImpactOnSNI() throws Exception { -+ Exception startException = null; -+ try { -+ if (separateServerThread) { -+ startServer(true); -+ startClient(false); -+ } else { -+ startClient(true); -+ startServer(false); -+ } -+ } catch (Exception e) { -+ startException = e; -+ } -+ -+ /* -+ * Wait for other side to close down. -+ */ -+ if (separateServerThread) { -+ if (serverThread != null) { -+ serverThread.join(); -+ } -+ } else { -+ if (clientThread != null) { -+ clientThread.join(); -+ } -+ } -+ -+ /* -+ * When we get here, the test is pretty much over. -+ * Which side threw the error? -+ */ -+ Exception local; -+ Exception remote; -+ -+ if (separateServerThread) { -+ remote = serverException; -+ local = clientException; -+ } else { -+ remote = clientException; -+ local = serverException; -+ } -+ -+ Exception exception = null; -+ -+ /* -+ * Check various exception conditions. -+ */ -+ if ((local != null) && (remote != null)) { -+ // If both failed, return the curthread's exception. -+ local.initCause(remote); -+ exception = local; -+ } else if (local != null) { -+ exception = local; -+ } else if (remote != null) { -+ exception = remote; -+ } else if (startException != null) { -+ exception = startException; -+ } -+ -+ /* -+ * If there was an exception *AND* a startException, -+ * output it. -+ */ -+ if (exception != null) { -+ if (exception != startException && startException != null) { -+ exception.addSuppressed(startException); -+ } -+ throw exception; -+ } -+ -+ // Fall-through: no exception to throw! -+ } -+ -+ private void startServer(boolean newThread) throws Exception { -+ if (newThread) { -+ serverThread = new Thread() { -+ @Override -+ public void run() { -+ try { -+ doServerSide(); -+ } catch (Exception e) { -+ /* -+ * Our server thread just died. -+ * -+ * Release the client, if not active already... -+ */ -+ System.err.println("Server died..."); -+ serverReady = true; -+ serverException = e; -+ } -+ } -+ }; -+ serverThread.start(); -+ } else { -+ try { -+ doServerSide(); -+ } catch (Exception e) { -+ serverException = e; -+ } finally { -+ serverReady = true; -+ } -+ } -+ } -+ -+ private void startClient(boolean newThread) throws Exception { -+ if (newThread) { -+ clientThread = new Thread() { -+ @Override -+ public void run() { -+ try { -+ doClientSide(); -+ } catch (Exception e) { -+ /* -+ * Our client thread just died. -+ */ -+ System.err.println("Client died..."); -+ clientException = e; -+ } -+ } -+ }; -+ clientThread.start(); -+ } else { -+ try { -+ doClientSide(); -+ } catch (Exception e) { -+ clientException = e; -+ } -+ } -+ } -+} diff --git a/8146115-pr3508-rh1463098.patch b/8146115-pr3508-rh1463098.patch new file mode 100644 index 0000000..a04728b --- /dev/null +++ b/8146115-pr3508-rh1463098.patch @@ -0,0 +1,1494 @@ +# HG changeset patch +# User poonam +# Date 1530903013 0 +# Fri Jul 06 18:50:13 2018 +0000 +# Node ID 2f2d2af6fa5c44e67e0a9987f56392315a1e4b64 +# Parent 95b72537801cc9946c27ad27f07e3f0790a21b08 +8146115, PR3508, RH1463098: Improve docker container detection and resource configuration usage +Reviewed-by: bobv, dbuck + +diff --git openjdk.orig/hotspot/src/os/aix/vm/os_aix.cpp openjdk/hotspot/src/os/aix/vm/os_aix.cpp +--- openjdk.orig/hotspot/src/os/aix/vm/os_aix.cpp ++++ openjdk/hotspot/src/os/aix/vm/os_aix.cpp +@@ -4008,6 +4008,16 @@ + }; + + int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ + int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN); + assert(online_cpus > 0 && online_cpus <= processor_count(), "sanity check"); + return online_cpus; +diff --git openjdk.orig/hotspot/src/os/bsd/vm/os_bsd.cpp openjdk/hotspot/src/os/bsd/vm/os_bsd.cpp +--- openjdk.orig/hotspot/src/os/bsd/vm/os_bsd.cpp ++++ openjdk/hotspot/src/os/bsd/vm/os_bsd.cpp +@@ -3770,6 +3770,16 @@ + }; + + int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ + return _processor_count; + } + +diff --git openjdk.orig/hotspot/src/os/linux/vm/globals_linux.hpp openjdk/hotspot/src/os/linux/vm/globals_linux.hpp +--- openjdk.orig/hotspot/src/os/linux/vm/globals_linux.hpp ++++ openjdk/hotspot/src/os/linux/vm/globals_linux.hpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -49,8 +49,13 @@ + product(bool, UseSHM, false, \ + "Use SYSV shared memory for large pages") \ + \ +- diagnostic(bool, PrintActiveCpus, false, \ +- "Print the number of CPUs detected in os::active_processor_count") ++ product(bool, UseContainerSupport, true, \ ++ "Enable detection and runtime container configuration support") \ ++ \ ++ product(bool, PreferContainerQuotaForCPUCount, true, \ ++ "Calculate the container CPU availability based on the value" \ ++ " of quotas (if set), when true. Otherwise, use the CPU" \ ++ " shares value, provided it is less than quota.") + + // + // Defines Linux-specific default values. The flags are available on all +diff --git openjdk.orig/hotspot/src/os/linux/vm/osContainer_linux.cpp openjdk/hotspot/src/os/linux/vm/osContainer_linux.cpp +new file mode 100644 +--- /dev/null ++++ openjdk/hotspot/src/os/linux/vm/osContainer_linux.cpp +@@ -0,0 +1,680 @@ ++/* ++ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include ++#include ++#include ++#include "utilities/globalDefinitions.hpp" ++#include "memory/allocation.hpp" ++#include "runtime/os.hpp" ++#include "osContainer_linux.hpp" ++ ++#define PER_CPU_SHARES 1024 ++ ++bool OSContainer::_is_initialized = false; ++bool OSContainer::_is_containerized = false; ++julong _unlimited_memory; ++ ++class CgroupSubsystem: CHeapObj { ++ friend class OSContainer; ++ ++ private: ++ /* mountinfo contents */ ++ char *_root; ++ char *_mount_point; ++ ++ /* Constructed subsystem directory */ ++ char *_path; ++ ++ public: ++ CgroupSubsystem(char *root, char *mountpoint) { ++ _root = os::strdup(root); ++ _mount_point = os::strdup(mountpoint); ++ _path = NULL; ++ } ++ ++ /* ++ * Set directory to subsystem specific files based ++ * on the contents of the mountinfo and cgroup files. ++ */ ++ void set_subsystem_path(char *cgroup_path) { ++ char buf[MAXPATHLEN+1]; ++ if (_root != NULL && cgroup_path != NULL) { ++ if (strcmp(_root, "/") == 0) { ++ int buflen; ++ strncpy(buf, _mount_point, MAXPATHLEN); ++ buf[MAXPATHLEN-1] = '\0'; ++ if (strcmp(cgroup_path,"/") != 0) { ++ buflen = strlen(buf); ++ if ((buflen + strlen(cgroup_path)) > (MAXPATHLEN-1)) { ++ return; ++ } ++ strncat(buf, cgroup_path, MAXPATHLEN-buflen); ++ buf[MAXPATHLEN-1] = '\0'; ++ } ++ _path = os::strdup(buf); ++ } else { ++ if (strcmp(_root, cgroup_path) == 0) { ++ strncpy(buf, _mount_point, MAXPATHLEN); ++ buf[MAXPATHLEN-1] = '\0'; ++ _path = os::strdup(buf); ++ } else { ++ char *p = strstr(_root, cgroup_path); ++ if (p != NULL && p == _root) { ++ if (strlen(cgroup_path) > strlen(_root)) { ++ int buflen; ++ strncpy(buf, _mount_point, MAXPATHLEN); ++ buf[MAXPATHLEN-1] = '\0'; ++ buflen = strlen(buf); ++ if ((buflen + strlen(cgroup_path)) > (MAXPATHLEN-1)) { ++ return; ++ } ++ strncat(buf, cgroup_path + strlen(_root), MAXPATHLEN-buflen); ++ buf[MAXPATHLEN-1] = '\0'; ++ _path = os::strdup(buf); ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ char *subsystem_path() { return _path; } ++}; ++ ++CgroupSubsystem* memory = NULL; ++CgroupSubsystem* cpuset = NULL; ++CgroupSubsystem* cpu = NULL; ++CgroupSubsystem* cpuacct = NULL; ++ ++typedef char * cptr; ++ ++PRAGMA_DIAG_PUSH ++PRAGMA_FORMAT_NONLITERAL_IGNORED ++template int subsystem_file_contents(CgroupSubsystem* c, ++ const char *filename, ++ const char *scan_fmt, ++ T returnval) { ++ FILE *fp = NULL; ++ char *p; ++ char file[MAXPATHLEN+1]; ++ char buf[MAXPATHLEN+1]; ++ ++ if (c == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("subsystem_file_contents: CgroupSubsytem* is NULL"); ++ } ++ return OSCONTAINER_ERROR; ++ } ++ if (c->subsystem_path() == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("subsystem_file_contents: subsystem path is NULL"); ++ } ++ return OSCONTAINER_ERROR; ++ } ++ ++ strncpy(file, c->subsystem_path(), MAXPATHLEN); ++ file[MAXPATHLEN-1] = '\0'; ++ int filelen = strlen(file); ++ if ((filelen + strlen(filename)) > (MAXPATHLEN-1)) { ++ if (PrintContainerInfo) { ++ tty->print_cr("File path too long %s, %s", file, filename); ++ } ++ return OSCONTAINER_ERROR; ++ } ++ strncat(file, filename, MAXPATHLEN-filelen); ++ if (PrintContainerInfo) { ++ tty->print_cr("Path to %s is %s", filename, file); ++ } ++ fp = fopen(file, "r"); ++ if (fp != NULL) { ++ p = fgets(buf, MAXPATHLEN, fp); ++ if (p != NULL) { ++ int matched = sscanf(p, scan_fmt, returnval); ++ if (matched == 1) { ++ fclose(fp); ++ return 0; ++ } else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Type %s not found in file %s", scan_fmt, file); ++ } ++ } ++ } else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Empty file %s", file); ++ } ++ } ++ } else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Open of file %s failed, %s", file, strerror(errno)); ++ } ++ } ++ if (fp != NULL) ++ fclose(fp); ++ return OSCONTAINER_ERROR; ++} ++PRAGMA_DIAG_POP ++ ++#define GET_CONTAINER_INFO(return_type, subsystem, filename, \ ++ logstring, scan_fmt, variable) \ ++ return_type variable; \ ++{ \ ++ int err; \ ++ err = subsystem_file_contents(subsystem, \ ++ filename, \ ++ scan_fmt, \ ++ &variable); \ ++ if (err != 0) \ ++ return (return_type) OSCONTAINER_ERROR; \ ++ \ ++ if (PrintContainerInfo) \ ++ tty->print_cr(logstring, variable); \ ++} ++ ++#define GET_CONTAINER_INFO_CPTR(return_type, subsystem, filename, \ ++ logstring, scan_fmt, variable, bufsize) \ ++ char variable[bufsize]; \ ++{ \ ++ int err; \ ++ err = subsystem_file_contents(subsystem, \ ++ filename, \ ++ scan_fmt, \ ++ variable); \ ++ if (err != 0) \ ++ return (return_type) NULL; \ ++ \ ++ if (PrintContainerInfo) \ ++ tty->print_cr(logstring, variable); \ ++} ++ ++/* init ++ * ++ * Initialize the container support and determine if ++ * we are running under cgroup control. ++ */ ++void OSContainer::init() { ++ int mountid; ++ int parentid; ++ int major; ++ int minor; ++ FILE *mntinfo = NULL; ++ FILE *cgroup = NULL; ++ char buf[MAXPATHLEN+1]; ++ char tmproot[MAXPATHLEN+1]; ++ char tmpmount[MAXPATHLEN+1]; ++ char tmpbase[MAXPATHLEN+1]; ++ char *p; ++ jlong mem_limit; ++ ++ assert(!_is_initialized, "Initializing OSContainer more than once"); ++ ++ _is_initialized = true; ++ _is_containerized = false; ++ ++ _unlimited_memory = (LONG_MAX / os::vm_page_size()) * os::vm_page_size(); ++ ++ if (PrintContainerInfo) { ++ tty->print_cr("OSContainer::init: Initializing Container Support"); ++ } ++ if (!UseContainerSupport) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Container Support not enabled"); ++ } ++ return; ++ } ++ ++ /* ++ * Find the cgroup mount point for memory and cpuset ++ * by reading /proc/self/mountinfo ++ * ++ * Example for docker: ++ * 219 214 0:29 /docker/7208cebd00fa5f2e342b1094f7bed87fa25661471a4637118e65f1c995be8a34 /sys/fs/cgroup/memory ro,nosuid,nodev,noexec,relatime - cgroup cgroup rw,memory ++ * ++ * Example for host: ++ * 34 28 0:29 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,memory ++ */ ++ mntinfo = fopen("/proc/self/mountinfo", "r"); ++ if (mntinfo == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Can't open /proc/self/mountinfo, %s", ++ strerror(errno)); ++ } ++ return; ++ } ++ ++ while ( (p = fgets(buf, MAXPATHLEN, mntinfo)) != NULL) { ++ // Look for the filesystem type and see if it's cgroup ++ char fstype[MAXPATHLEN+1]; ++ fstype[0] = '\0'; ++ char *s = strstr(p, " - "); ++ if (s != NULL && ++ sscanf(s, " - %s", fstype) == 1 && ++ strcmp(fstype, "cgroup") == 0) { ++ ++ if (strstr(p, "memory") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ memory = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and memory: %s", p); ++ } ++ } else if (strstr(p, "cpuset") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ cpuset = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and cpuset: %s", p); ++ } ++ } ++ } else if (strstr(p, "cpu,cpuacct") != NULL || strstr(p, "cpuacct,cpu") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ cpu = new CgroupSubsystem(tmproot, tmpmount); ++ cpuacct = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and cpu,cpuacct: %s", p); ++ } ++ } ++ } else if (strstr(p, "cpuacct") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ cpuacct = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and cpuacct: %s", p); ++ } ++ } ++ } else if (strstr(p, "cpu") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ cpu = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and cpu: %s", p); ++ } ++ } ++ } ++ } ++ } ++ ++ fclose(mntinfo); ++ ++ if (memory == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Required cgroup memory subsystem not found"); ++ } ++ return; ++ } ++ if (cpuset == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Required cgroup cpuset subsystem not found"); ++ } ++ return; ++ } ++ if (cpu == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Required cgroup cpu subsystem not found"); ++ } ++ return; ++ } ++ if (cpuacct == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Required cgroup cpuacct subsystem not found"); ++ } ++ return; ++ } ++ ++ /* ++ * Read /proc/self/cgroup and map host mount point to ++ * local one via /proc/self/mountinfo content above ++ * ++ * Docker example: ++ * 5:memory:/docker/6558aed8fc662b194323ceab5b964f69cf36b3e8af877a14b80256e93aecb044 ++ * ++ * Host example: ++ * 5:memory:/user.slice ++ * ++ * Construct a path to the process specific memory and cpuset ++ * cgroup directory. ++ * ++ * For a container running under Docker from memory example above ++ * the paths would be: ++ * ++ * /sys/fs/cgroup/memory ++ * ++ * For a Host from memory example above the path would be: ++ * ++ * /sys/fs/cgroup/memory/user.slice ++ * ++ */ ++ cgroup = fopen("/proc/self/cgroup", "r"); ++ if (cgroup == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Can't open /proc/self/cgroup, %s", ++ strerror(errno)); ++ } ++ return; ++ } ++ ++ while ( (p = fgets(buf, MAXPATHLEN, cgroup)) != NULL) { ++ int cgno; ++ int matched; ++ char *controller; ++ char *base; ++ ++ /* Skip cgroup number */ ++ strsep(&p, ":"); ++ /* Get controller and base */ ++ controller = strsep(&p, ":"); ++ base = strsep(&p, "\n"); ++ ++ if (controller != NULL) { ++ if (strstr(controller, "memory") != NULL) { ++ memory->set_subsystem_path(base); ++ } else if (strstr(controller, "cpuset") != NULL) { ++ cpuset->set_subsystem_path(base); ++ } else if (strstr(controller, "cpu,cpuacct") != NULL || strstr(controller, "cpuacct,cpu") != NULL) { ++ cpu->set_subsystem_path(base); ++ cpuacct->set_subsystem_path(base); ++ } else if (strstr(controller, "cpuacct") != NULL) { ++ cpuacct->set_subsystem_path(base); ++ } else if (strstr(controller, "cpu") != NULL) { ++ cpu->set_subsystem_path(base); ++ } ++ } ++ } ++ ++ fclose(cgroup); ++ ++ // We need to update the amount of physical memory now that ++ // command line arguments have been processed. ++ if ((mem_limit = memory_limit_in_bytes()) > 0) { ++ os::Linux::set_physical_memory(mem_limit); ++ } ++ ++ _is_containerized = true; ++ ++} ++ ++const char * OSContainer::container_type() { ++ if (is_containerized()) { ++ return "cgroupv1"; ++ } else { ++ return NULL; ++ } ++} ++ ++ ++/* memory_limit_in_bytes ++ * ++ * Return the limit of available memory for this process. ++ * ++ * return: ++ * memory limit in bytes or ++ * -1 for unlimited ++ * OSCONTAINER_ERROR for not supported ++ */ ++jlong OSContainer::memory_limit_in_bytes() { ++ GET_CONTAINER_INFO(julong, memory, "/memory.limit_in_bytes", ++ "Memory Limit is: " JULONG_FORMAT, JULONG_FORMAT, memlimit); ++ ++ if (memlimit >= _unlimited_memory) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Memory Limit is: Unlimited"); ++ } ++ return (jlong)-1; ++ } ++ else { ++ return (jlong)memlimit; ++ } ++} ++ ++jlong OSContainer::memory_and_swap_limit_in_bytes() { ++ GET_CONTAINER_INFO(julong, memory, "/memory.memsw.limit_in_bytes", ++ "Memory and Swap Limit is: " JULONG_FORMAT, JULONG_FORMAT, memswlimit); ++ if (memswlimit >= _unlimited_memory) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Memory and Swap Limit is: Unlimited"); ++ } ++ return (jlong)-1; ++ } else { ++ return (jlong)memswlimit; ++ } ++} ++ ++jlong OSContainer::memory_soft_limit_in_bytes() { ++ GET_CONTAINER_INFO(julong, memory, "/memory.soft_limit_in_bytes", ++ "Memory Soft Limit is: " JULONG_FORMAT, JULONG_FORMAT, memsoftlimit); ++ if (memsoftlimit >= _unlimited_memory) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Memory Soft Limit is: Unlimited"); ++ } ++ return (jlong)-1; ++ } else { ++ return (jlong)memsoftlimit; ++ } ++} ++ ++/* memory_usage_in_bytes ++ * ++ * Return the amount of used memory for this process. ++ * ++ * return: ++ * memory usage in bytes or ++ * -1 for unlimited ++ * OSCONTAINER_ERROR for not supported ++ */ ++jlong OSContainer::memory_usage_in_bytes() { ++ GET_CONTAINER_INFO(jlong, memory, "/memory.usage_in_bytes", ++ "Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, memusage); ++ return memusage; ++} ++ ++/* memory_max_usage_in_bytes ++ * ++ * Return the maximum amount of used memory for this process. ++ * ++ * return: ++ * max memory usage in bytes or ++ * OSCONTAINER_ERROR for not supported ++ */ ++jlong OSContainer::memory_max_usage_in_bytes() { ++ GET_CONTAINER_INFO(jlong, memory, "/memory.max_usage_in_bytes", ++ "Maximum Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, memmaxusage); ++ return memmaxusage; ++} ++ ++/* active_processor_count ++ * ++ * Calculate an appropriate number of active processors for the ++ * VM to use based on these three inputs. ++ * ++ * cpu affinity ++ * cgroup cpu quota & cpu period ++ * cgroup cpu shares ++ * ++ * Algorithm: ++ * ++ * Determine the number of available CPUs from sched_getaffinity ++ * ++ * If user specified a quota (quota != -1), calculate the number of ++ * required CPUs by dividing quota by period. ++ * ++ * If shares are in effect (shares != -1), calculate the number ++ * of CPUs required for the shares by dividing the share value ++ * by PER_CPU_SHARES. ++ * ++ * All results of division are rounded up to the next whole number. ++ * ++ * If neither shares or quotas have been specified, return the ++ * number of active processors in the system. ++ * ++ * If both shares and quotas have been specified, the results are ++ * based on the flag PreferContainerQuotaForCPUCount. If true, ++ * return the quota value. If false return the smallest value ++ * between shares or quotas. ++ * ++ * If shares and/or quotas have been specified, the resulting number ++ * returned will never exceed the number of active processors. ++ * ++ * return: ++ * number of CPUs ++ */ ++int OSContainer::active_processor_count() { ++ int quota_count = 0, share_count = 0; ++ int cpu_count, limit_count; ++ int result; ++ ++ cpu_count = limit_count = os::Linux::active_processor_count(); ++ int quota = cpu_quota(); ++ int period = cpu_period(); ++ int share = cpu_shares(); ++ ++ if (quota > -1 && period > 0) { ++ quota_count = ceilf((float)quota / (float)period); ++ if (PrintContainerInfo) { ++ tty->print_cr("CPU Quota count based on quota/period: %d", quota_count); ++ } ++ } ++ if (share > -1) { ++ share_count = ceilf((float)share / (float)PER_CPU_SHARES); ++ if (PrintContainerInfo) { ++ tty->print_cr("CPU Share count based on shares: %d", share_count); ++ } ++ } ++ ++ // If both shares and quotas are setup results depend ++ // on flag PreferContainerQuotaForCPUCount. ++ // If true, limit CPU count to quota ++ // If false, use minimum of shares and quotas ++ if (quota_count !=0 && share_count != 0) { ++ if (PreferContainerQuotaForCPUCount) { ++ limit_count = quota_count; ++ } else { ++ limit_count = MIN2(quota_count, share_count); ++ } ++ } else if (quota_count != 0) { ++ limit_count = quota_count; ++ } else if (share_count != 0) { ++ limit_count = share_count; ++ } ++ ++ result = MIN2(cpu_count, limit_count); ++ if (PrintContainerInfo) { ++ tty->print_cr("OSContainer::active_processor_count: %d", result); ++ } ++ return result; ++} ++ ++char * OSContainer::cpu_cpuset_cpus() { ++ GET_CONTAINER_INFO_CPTR(cptr, cpuset, "/cpuset.cpus", ++ "cpuset.cpus is: %s", "%1023s", cpus, 1024); ++ return os::strdup(cpus); ++} ++ ++char * OSContainer::cpu_cpuset_memory_nodes() { ++ GET_CONTAINER_INFO_CPTR(cptr, cpuset, "/cpuset.mems", ++ "cpuset.mems is: %s", "%1023s", mems, 1024); ++ return os::strdup(mems); ++} ++ ++/* cpu_quota ++ * ++ * Return the number of milliseconds per period ++ * process is guaranteed to run. ++ * ++ * return: ++ * quota time in milliseconds ++ * -1 for no quota ++ * OSCONTAINER_ERROR for not supported ++ */ ++int OSContainer::cpu_quota() { ++ GET_CONTAINER_INFO(int, cpu, "/cpu.cfs_quota_us", ++ "CPU Quota is: %d", "%d", quota); ++ return quota; ++} ++ ++int OSContainer::cpu_period() { ++ GET_CONTAINER_INFO(int, cpu, "/cpu.cfs_period_us", ++ "CPU Period is: %d", "%d", period); ++ return period; ++} ++ ++/* cpu_shares ++ * ++ * Return the amount of cpu shares available to the process ++ * ++ * return: ++ * Share number (typically a number relative to 1024) ++ * (2048 typically expresses 2 CPUs worth of processing) ++ * -1 for no share setup ++ * OSCONTAINER_ERROR for not supported ++ */ ++int OSContainer::cpu_shares() { ++ GET_CONTAINER_INFO(int, cpu, "/cpu.shares", ++ "CPU Shares is: %d", "%d", shares); ++ // Convert 1024 to no shares setup ++ if (shares == 1024) return -1; ++ ++ return shares; ++} ++ +diff --git openjdk.orig/hotspot/src/os/linux/vm/osContainer_linux.hpp openjdk/hotspot/src/os/linux/vm/osContainer_linux.hpp +new file mode 100644 +--- /dev/null ++++ openjdk/hotspot/src/os/linux/vm/osContainer_linux.hpp +@@ -0,0 +1,68 @@ ++/* ++ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef OS_LINUX_VM_OSCONTAINER_LINUX_HPP ++#define OS_LINUX_VM_OSCONTAINER_LINUX_HPP ++ ++#include "utilities/globalDefinitions.hpp" ++#include "utilities/macros.hpp" ++#include "memory/allocation.hpp" ++ ++#define OSCONTAINER_ERROR (-2) ++ ++class OSContainer: AllStatic { ++ ++ private: ++ static bool _is_initialized; ++ static bool _is_containerized; ++ ++ public: ++ static void init(); ++ static inline bool is_containerized(); ++ static const char * container_type(); ++ ++ static jlong memory_limit_in_bytes(); ++ static jlong memory_and_swap_limit_in_bytes(); ++ static jlong memory_soft_limit_in_bytes(); ++ static jlong memory_usage_in_bytes(); ++ static jlong memory_max_usage_in_bytes(); ++ ++ static int active_processor_count(); ++ ++ static char * cpu_cpuset_cpus(); ++ static char * cpu_cpuset_memory_nodes(); ++ ++ static int cpu_quota(); ++ static int cpu_period(); ++ ++ static int cpu_shares(); ++ ++}; ++ ++inline bool OSContainer::is_containerized() { ++ assert(_is_initialized, "OSContainer not initialized"); ++ return _is_containerized; ++} ++ ++#endif // OS_LINUX_VM_OSCONTAINER_LINUX_HPP +diff --git openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp +--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp +@@ -37,6 +37,7 @@ + #include "mutex_linux.inline.hpp" + #include "oops/oop.inline.hpp" + #include "os_share_linux.hpp" ++#include "osContainer_linux.hpp" + #include "prims/jniFastGetField.hpp" + #include "prims/jvm.h" + #include "prims/jvm_misc.hpp" +@@ -179,13 +180,62 @@ + julong os::Linux::available_memory() { + // values in struct sysinfo are "unsigned long" + struct sysinfo si; ++ julong avail_mem; ++ ++ if (OSContainer::is_containerized()) { ++ jlong mem_limit, mem_usage; ++ if ((mem_limit = OSContainer::memory_limit_in_bytes()) < 1) { ++ if (PrintContainerInfo) { ++ tty->print_cr("container memory limit %s: " JLONG_FORMAT ", using host value", ++ mem_limit == OSCONTAINER_ERROR ? "failed" : "unlimited", mem_limit); ++ } ++ } ++ ++ if (mem_limit > 0 && (mem_usage = OSContainer::memory_usage_in_bytes()) < 1) { ++ if (PrintContainerInfo) { ++ tty->print_cr("container memory usage failed: " JLONG_FORMAT ", using host value", mem_usage); ++ } ++ } ++ ++ if (mem_limit > 0 && mem_usage > 0 ) { ++ avail_mem = mem_limit > mem_usage ? (julong)mem_limit - (julong)mem_usage : 0; ++ if (PrintContainerInfo) { ++ tty->print_cr("available container memory: " JULONG_FORMAT, avail_mem); ++ } ++ return avail_mem; ++ } ++ } ++ + sysinfo(&si); +- +- return (julong)si.freeram * si.mem_unit; ++ avail_mem = (julong)si.freeram * si.mem_unit; ++ if (Verbose) { ++ tty->print_cr("available memory: " JULONG_FORMAT, avail_mem); ++ } ++ return avail_mem; + } + + julong os::physical_memory() { +- return Linux::physical_memory(); ++ jlong phys_mem = 0; ++ if (OSContainer::is_containerized()) { ++ jlong mem_limit; ++ if ((mem_limit = OSContainer::memory_limit_in_bytes()) > 0) { ++ if (PrintContainerInfo) { ++ tty->print_cr("total container memory: " JLONG_FORMAT, mem_limit); ++ } ++ return mem_limit; ++ } ++ ++ if (PrintContainerInfo) { ++ tty->print_cr("container memory limit %s: " JLONG_FORMAT ", using host value", ++ mem_limit == OSCONTAINER_ERROR ? "failed" : "unlimited", mem_limit); ++ } ++ } ++ ++ phys_mem = Linux::physical_memory(); ++ if (Verbose) { ++ tty->print_cr("total system memory: " JLONG_FORMAT, phys_mem); ++ } ++ return phys_mem; + } + + //////////////////////////////////////////////////////////////////////////////// +@@ -2129,6 +2179,8 @@ + os::Posix::print_load_average(st); + + os::Linux::print_full_memory_info(st); ++ ++ os::Linux::print_container_info(st); + } + + // Try to identify popular distros. +@@ -2194,6 +2246,57 @@ + st->cr(); + } + ++void os::Linux::print_container_info(outputStream* st) { ++if (!OSContainer::is_containerized()) { ++ return; ++ } ++ ++ st->print("container (cgroup) information:\n"); ++ ++ const char *p_ct = OSContainer::container_type(); ++ st->print("container_type: %s\n", p_ct != NULL ? p_ct : "failed"); ++ ++ char *p = OSContainer::cpu_cpuset_cpus(); ++ st->print("cpu_cpuset_cpus: %s\n", p != NULL ? p : "failed"); ++ free(p); ++ ++ p = OSContainer::cpu_cpuset_memory_nodes(); ++ st->print("cpu_memory_nodes: %s\n", p != NULL ? p : "failed"); ++ free(p); ++ ++ int i = OSContainer::active_processor_count(); ++ if (i > 0) { ++ st->print("active_processor_count: %d\n", i); ++ } else { ++ st->print("active_processor_count: failed\n"); ++ } ++ ++ i = OSContainer::cpu_quota(); ++ st->print("cpu_quota: %d\n", i); ++ ++ i = OSContainer::cpu_period(); ++ st->print("cpu_period: %d\n", i); ++ ++ i = OSContainer::cpu_shares(); ++ st->print("cpu_shares: %d\n", i); ++ ++ jlong j = OSContainer::memory_limit_in_bytes(); ++ st->print("memory_limit_in_bytes: " JLONG_FORMAT "\n", j); ++ ++ j = OSContainer::memory_and_swap_limit_in_bytes(); ++ st->print("memory_and_swap_limit_in_bytes: " JLONG_FORMAT "\n", j); ++ ++ j = OSContainer::memory_soft_limit_in_bytes(); ++ st->print("memory_soft_limit_in_bytes: " JLONG_FORMAT "\n", j); ++ ++ j = OSContainer::OSContainer::memory_usage_in_bytes(); ++ st->print("memory_usage_in_bytes: " JLONG_FORMAT "\n", j); ++ ++ j = OSContainer::OSContainer::memory_max_usage_in_bytes(); ++ st->print("memory_max_usage_in_bytes: " JLONG_FORMAT "\n", j); ++ st->cr(); ++} ++ + void os::print_memory_info(outputStream* st) { + + st->print("Memory:"); +@@ -4966,6 +5069,10 @@ + } + } + ++void os::pd_init_container_support() { ++ OSContainer::init(); ++} ++ + // this is called _after_ the global arguments have been parsed + jint os::init_2(void) + { +@@ -5146,7 +5253,7 @@ + // sched_getaffinity gives an accurate answer as it accounts for cpusets. + // If anything goes wrong we fallback to returning the number of online + // processors - which can be greater than the number available to the process. +-int os::active_processor_count() { ++int os::Linux::active_processor_count() { + cpu_set_t cpus; // can represent at most 1024 (CPU_SETSIZE) processors + int cpus_size = sizeof(cpu_set_t); + int cpu_count = 0; +@@ -5164,10 +5271,48 @@ + "which may exceed available processors", strerror(errno), cpu_count); + } + +- assert(cpu_count > 0 && cpu_count <= processor_count(), "sanity check"); ++ assert(cpu_count > 0 && cpu_count <= os::processor_count(), "sanity check"); + return cpu_count; + } + ++// Determine the active processor count from one of ++// three different sources: ++// ++// 1. User option -XX:ActiveProcessorCount ++// 2. kernel os calls (sched_getaffinity or sysconf(_SC_NPROCESSORS_ONLN) ++// 3. extracted from cgroup cpu subsystem (shares and quotas) ++// ++// Option 1, if specified, will always override. ++// If the cgroup subsystem is active and configured, we ++// will return the min of the cgroup and option 2 results. ++// This is required since tools, such as numactl, that ++// alter cpu affinity do not update cgroup subsystem ++// cpuset configuration files. ++int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ ++ int active_cpus; ++ if (OSContainer::is_containerized()) { ++ active_cpus = OSContainer::active_processor_count(); ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: determined by OSContainer: %d", ++ active_cpus); ++ } ++ } else { ++ active_cpus = os::Linux::active_processor_count(); ++ } ++ ++ return active_cpus; ++} ++ + void os::set_native_thread_name(const char *name) { + // Not yet implemented. + return; +diff --git openjdk.orig/hotspot/src/os/linux/vm/os_linux.hpp openjdk/hotspot/src/os/linux/vm/os_linux.hpp +--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.hpp ++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp +@@ -35,6 +35,7 @@ + + class Linux { + friend class os; ++ friend class OSContainer; + friend class TestReserveMemorySpecial; + + // For signal-chaining +@@ -79,6 +80,9 @@ + + static julong available_memory(); + static julong physical_memory() { return _physical_memory; } ++ static void set_physical_memory(julong phys_mem) { _physical_memory = phys_mem; } ++ static int active_processor_count(); ++ + static void initialize_system_info(); + + static int commit_memory_impl(char* addr, size_t bytes, bool exec); +@@ -116,6 +120,7 @@ + static bool release_memory_special_huge_tlbfs(char* base, size_t bytes); + + static void print_full_memory_info(outputStream* st); ++ static void print_container_info(outputStream* st); + static void print_distro_info(outputStream* st); + static void print_libversion_info(outputStream* st); + +diff --git openjdk.orig/hotspot/src/os/solaris/vm/os_solaris.cpp openjdk/hotspot/src/os/solaris/vm/os_solaris.cpp +--- openjdk.orig/hotspot/src/os/solaris/vm/os_solaris.cpp ++++ openjdk/hotspot/src/os/solaris/vm/os_solaris.cpp +@@ -357,6 +357,16 @@ + } + + int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (Verbose) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ + int online_cpus = sysconf(_SC_NPROCESSORS_ONLN); + pid_t pid = getpid(); + psetid_t pset = PS_NONE; +diff --git openjdk.orig/hotspot/src/os/windows/vm/os_windows.cpp openjdk/hotspot/src/os/windows/vm/os_windows.cpp +--- openjdk.orig/hotspot/src/os/windows/vm/os_windows.cpp ++++ openjdk/hotspot/src/os/windows/vm/os_windows.cpp +@@ -716,6 +716,16 @@ + #endif + + int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ + DWORD_PTR lpProcessAffinityMask = 0; + DWORD_PTR lpSystemAffinityMask = 0; + int proc_count = processor_count(); +diff --git openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp ++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -1801,20 +1801,34 @@ + } + } + ++ // Convert Fraction to Precentage values ++ if (FLAG_IS_DEFAULT(MaxRAMPercentage) && ++ !FLAG_IS_DEFAULT(MaxRAMFraction)) ++ MaxRAMPercentage = 100.0 / MaxRAMFraction; ++ ++ if (FLAG_IS_DEFAULT(MinRAMPercentage) && ++ !FLAG_IS_DEFAULT(MinRAMFraction)) ++ MinRAMPercentage = 100.0 / MinRAMFraction; ++ ++ if (FLAG_IS_DEFAULT(InitialRAMPercentage) && ++ !FLAG_IS_DEFAULT(InitialRAMFraction)) ++ InitialRAMPercentage = 100.0 / InitialRAMFraction; ++ + // If the maximum heap size has not been set with -Xmx, + // then set it as fraction of the size of physical memory, + // respecting the maximum and minimum sizes of the heap. + if (FLAG_IS_DEFAULT(MaxHeapSize)) { +- julong reasonable_max = phys_mem / MaxRAMFraction; +- +- if (phys_mem <= MaxHeapSize * MinRAMFraction) { ++ julong reasonable_max = (julong)((phys_mem * MaxRAMPercentage) / 100); ++ const julong reasonable_min = (julong)((phys_mem * MinRAMPercentage) / 100); ++ if (reasonable_min < MaxHeapSize) { + // Small physical memory, so use a minimum fraction of it for the heap +- reasonable_max = phys_mem / MinRAMFraction; ++ reasonable_max = reasonable_min; + } else { + // Not-small physical memory, so require a heap at least + // as large as MaxHeapSize + reasonable_max = MAX2(reasonable_max, (julong)MaxHeapSize); + } ++ + if (!FLAG_IS_DEFAULT(ErgoHeapSizeLimit) && ErgoHeapSizeLimit != 0) { + // Limit the heap size to ErgoHeapSizeLimit + reasonable_max = MIN2(reasonable_max, (julong)ErgoHeapSizeLimit); +@@ -1856,7 +1870,7 @@ + reasonable_minimum = limit_by_allocatable_memory(reasonable_minimum); + + if (InitialHeapSize == 0) { +- julong reasonable_initial = phys_mem / InitialRAMFraction; ++ julong reasonable_initial = (julong)((phys_mem * InitialRAMPercentage) / 100); + + reasonable_initial = MAX3(reasonable_initial, reasonable_minimum, (julong)min_heap_size()); + reasonable_initial = MIN2(reasonable_initial, (julong)MaxHeapSize); +@@ -1881,6 +1895,94 @@ + } + } + ++// This option inspects the machine and attempts to set various ++// parameters to be optimal for long-running, memory allocation ++// intensive jobs. It is intended for machines with large ++// amounts of cpu and memory. ++jint Arguments::set_aggressive_heap_flags() { ++ // initHeapSize is needed since _initial_heap_size is 4 bytes on a 32 bit ++ // VM, but we may not be able to represent the total physical memory ++ // available (like having 8gb of memory on a box but using a 32bit VM). ++ // Thus, we need to make sure we're using a julong for intermediate ++ // calculations. ++ julong initHeapSize; ++ julong total_memory = os::physical_memory(); ++ ++ if (total_memory < (julong) 256 * M) { ++ jio_fprintf(defaultStream::error_stream(), ++ "You need at least 256mb of memory to use -XX:+AggressiveHeap\n"); ++ vm_exit(1); ++ } ++ ++ // The heap size is half of available memory, or (at most) ++ // all of possible memory less 160mb (leaving room for the OS ++ // when using ISM). This is the maximum; because adaptive sizing ++ // is turned on below, the actual space used may be smaller. ++ ++ initHeapSize = MIN2(total_memory / (julong) 2, ++ total_memory - (julong) 160 * M); ++ ++ initHeapSize = limit_by_allocatable_memory(initHeapSize); ++ ++ if (FLAG_IS_DEFAULT(MaxHeapSize)) { ++ FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize); ++ FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize); ++ // Currently the minimum size and the initial heap sizes are the same. ++ set_min_heap_size(initHeapSize); ++ } ++ if (FLAG_IS_DEFAULT(NewSize)) { ++ // Make the young generation 3/8ths of the total heap. ++ FLAG_SET_CMDLINE(uintx, NewSize, ++ ((julong) MaxHeapSize / (julong) 8) * (julong) 3); ++ FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize); ++ } ++ ++#ifndef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD. ++ FLAG_SET_DEFAULT(UseLargePages, true); ++#endif ++ ++ // Increase some data structure sizes for efficiency ++ FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize); ++ FLAG_SET_CMDLINE(bool, ResizeTLAB, false); ++ FLAG_SET_CMDLINE(uintx, TLABSize, 256 * K); ++ ++ // See the OldPLABSize comment below, but replace 'after promotion' ++ // with 'after copying'. YoungPLABSize is the size of the survivor ++ // space per-gc-thread buffers. The default is 4kw. ++ FLAG_SET_CMDLINE(uintx, YoungPLABSize, 256 * K); // Note: this is in words ++ ++ // OldPLABSize is the size of the buffers in the old gen that ++ // UseParallelGC uses to promote live data that doesn't fit in the ++ // survivor spaces. At any given time, there's one for each gc thread. ++ // The default size is 1kw. These buffers are rarely used, since the ++ // survivor spaces are usually big enough. For specjbb, however, there ++ // are occasions when there's lots of live data in the young gen ++ // and we end up promoting some of it. We don't have a definite ++ // explanation for why bumping OldPLABSize helps, but the theory ++ // is that a bigger PLAB results in retaining something like the ++ // original allocation order after promotion, which improves mutator ++ // locality. A minor effect may be that larger PLABs reduce the ++ // number of PLAB allocation events during gc. The value of 8kw ++ // was arrived at by experimenting with specjbb. ++ FLAG_SET_CMDLINE(uintx, OldPLABSize, 8 * K); // Note: this is in words ++ ++ // Enable parallel GC and adaptive generation sizing ++ FLAG_SET_CMDLINE(bool, UseParallelGC, true); ++ ++ // Encourage steady state memory management ++ FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100); ++ ++ // This appears to improve mutator locality ++ FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false); ++ ++ // Get around early Solaris scheduling bug ++ // (affinity vs other jobs on system) ++ // but disallow DR and offlining (5008695). ++ FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true); ++ ++ return JNI_OK; ++} ++ + // This must be called after ergonomics because we want bytecode rewriting + // if the server compiler is used, or if UseSharedSpaces is disabled. + void Arguments::set_bytecode_flags() { +@@ -2644,6 +2746,14 @@ + return result; + } + ++ // We need to ensure processor and memory resources have been properly ++ // configured - which may rely on arguments we just processed - before ++ // doing the final argument processing. Any argument processing that ++ // needs to know about processor and memory resources must occur after ++ // this point. ++ ++ os::init_container_support(); ++ + // Do final processing now that all arguments have been parsed + result = finalize_vm_init_args(&scp, scp_assembly_required); + if (result != JNI_OK) { +@@ -3117,94 +3227,6 @@ + _exit_hook = CAST_TO_FN_PTR(exit_hook_t, option->extraInfo); + } else if (match_option(option, "abort", &tail)) { + _abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo); +- // -XX:+AggressiveHeap +- } else if (match_option(option, "-XX:+AggressiveHeap", &tail)) { +- +- // This option inspects the machine and attempts to set various +- // parameters to be optimal for long-running, memory allocation +- // intensive jobs. It is intended for machines with large +- // amounts of cpu and memory. +- +- // initHeapSize is needed since _initial_heap_size is 4 bytes on a 32 bit +- // VM, but we may not be able to represent the total physical memory +- // available (like having 8gb of memory on a box but using a 32bit VM). +- // Thus, we need to make sure we're using a julong for intermediate +- // calculations. +- julong initHeapSize; +- julong total_memory = os::physical_memory(); +- +- if (total_memory < (julong)256*M) { +- jio_fprintf(defaultStream::error_stream(), +- "You need at least 256mb of memory to use -XX:+AggressiveHeap\n"); +- vm_exit(1); +- } +- +- // The heap size is half of available memory, or (at most) +- // all of possible memory less 160mb (leaving room for the OS +- // when using ISM). This is the maximum; because adaptive sizing +- // is turned on below, the actual space used may be smaller. +- +- initHeapSize = MIN2(total_memory / (julong)2, +- total_memory - (julong)160*M); +- +- initHeapSize = limit_by_allocatable_memory(initHeapSize); +- +- if (FLAG_IS_DEFAULT(MaxHeapSize)) { +- FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize); +- FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize); +- // Currently the minimum size and the initial heap sizes are the same. +- set_min_heap_size(initHeapSize); +- } +- if (FLAG_IS_DEFAULT(NewSize)) { +- // Make the young generation 3/8ths of the total heap. +- FLAG_SET_CMDLINE(uintx, NewSize, +- ((julong)MaxHeapSize / (julong)8) * (julong)3); +- FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize); +- } +- +-#ifndef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD. +- FLAG_SET_DEFAULT(UseLargePages, true); +-#endif +- +- // Increase some data structure sizes for efficiency +- FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize); +- FLAG_SET_CMDLINE(bool, ResizeTLAB, false); +- FLAG_SET_CMDLINE(uintx, TLABSize, 256*K); +- +- // See the OldPLABSize comment below, but replace 'after promotion' +- // with 'after copying'. YoungPLABSize is the size of the survivor +- // space per-gc-thread buffers. The default is 4kw. +- FLAG_SET_CMDLINE(uintx, YoungPLABSize, 256*K); // Note: this is in words +- +- // OldPLABSize is the size of the buffers in the old gen that +- // UseParallelGC uses to promote live data that doesn't fit in the +- // survivor spaces. At any given time, there's one for each gc thread. +- // The default size is 1kw. These buffers are rarely used, since the +- // survivor spaces are usually big enough. For specjbb, however, there +- // are occasions when there's lots of live data in the young gen +- // and we end up promoting some of it. We don't have a definite +- // explanation for why bumping OldPLABSize helps, but the theory +- // is that a bigger PLAB results in retaining something like the +- // original allocation order after promotion, which improves mutator +- // locality. A minor effect may be that larger PLABs reduce the +- // number of PLAB allocation events during gc. The value of 8kw +- // was arrived at by experimenting with specjbb. +- FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K); // Note: this is in words +- +- // Enable parallel GC and adaptive generation sizing +- FLAG_SET_CMDLINE(bool, UseParallelGC, true); +- +- // Encourage steady state memory management +- FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100); +- +- // This appears to improve mutator locality +- FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false); +- +- // Get around early Solaris scheduling bug +- // (affinity vs other jobs on system) +- // but disallow DR and offlining (5008695). +- FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true); +- + } else if (match_option(option, "-XX:+NeverTenure", &tail)) { + // The last option must always win. + FLAG_SET_CMDLINE(bool, AlwaysTenure, false); +@@ -3605,6 +3627,15 @@ + return JNI_ERR; + } + ++ // This must be done after all arguments have been processed ++ // and the container support has been initialized since AggressiveHeap ++ // relies on the amount of total memory available. ++ if (AggressiveHeap) { ++ jint result = set_aggressive_heap_flags(); ++ if (result != JNI_OK) { ++ return result; ++ } ++ } + // This must be done after all arguments have been processed. + // java_compiler() true means set to "NONE" or empty. + if (java_compiler() && !xdebug_mode()) { +diff --git openjdk.orig/hotspot/src/share/vm/runtime/arguments.hpp openjdk/hotspot/src/share/vm/runtime/arguments.hpp +--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.hpp ++++ openjdk/hotspot/src/share/vm/runtime/arguments.hpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -365,6 +365,8 @@ + // Aggressive optimization flags. + static void set_aggressive_opts_flags(); + ++ static jint set_aggressive_heap_flags(); ++ + // Argument parsing + static void do_pd_flag_adjustments(); + static bool parse_argument(const char* arg, Flag::Flags origin); +diff --git openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp +--- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp ++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp +@@ -2076,13 +2076,23 @@ + product_pd(uint64_t, MaxRAM, \ + "Real memory size (in bytes) used to set maximum heap size") \ + \ ++ product(bool, AggressiveHeap, false, \ ++ "Optimize heap options for long-running memory intensive apps") \ ++ \ + product(uintx, ErgoHeapSizeLimit, 0, \ + "Maximum ergonomically set heap size (in bytes); zero means use " \ +- "MaxRAM / MaxRAMFraction") \ ++ "MaxRAM * MaxRAMPercentage / 100") \ + \ + experimental(bool, UseCGroupMemoryLimitForHeap, false, \ + "Use CGroup memory limit as physical memory limit for heap " \ +- "sizing") \ ++ "sizing" \ ++ "Deprecated, replaced by container support") \ ++ \ ++ diagnostic(bool, PrintContainerInfo, false, \ ++ "Print container related information") \ ++ \ ++ diagnostic(bool, PrintActiveCpus, false, \ ++ "Print the number of CPUs detected in os::active_processor_count") \ + \ + product(uintx, MaxRAMFraction, 4, \ + "Maximum fraction (1/n) of real memory used for maximum heap " \ +@@ -2099,6 +2109,19 @@ + product(uintx, InitialRAMFraction, 64, \ + "Fraction (1/n) of real memory used for initial heap size") \ + \ ++ product(double, MaxRAMPercentage, 25.0, \ ++ "Maximum percentage of real memory used for maximum heap size") \ ++ \ ++ product(double, MinRAMPercentage, 50.0, \ ++ "Minimum percentage of real memory used for maximum heap" \ ++ "size on systems with small physical memory size") \ ++ \ ++ product(double, InitialRAMPercentage, 1.5625, \ ++ "Percentage of real memory used for initial heap size") \ ++ \ ++ product(intx, ActiveProcessorCount, -1, \ ++ "Specify the CPU count the VM should use and report as active") \ ++ \ + develop(uintx, MaxVirtMemFraction, 2, \ + "Maximum fraction (1/n) of virtual memory used for ergonomically "\ + "determining maximum heap size") \ +diff --git openjdk.orig/hotspot/src/share/vm/runtime/os.hpp openjdk/hotspot/src/share/vm/runtime/os.hpp +--- openjdk.orig/hotspot/src/share/vm/runtime/os.hpp ++++ openjdk/hotspot/src/share/vm/runtime/os.hpp +@@ -152,8 +152,16 @@ + static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned); + + static void initialize_initial_active_processor_count(); ++ ++ LINUX_ONLY(static void pd_init_container_support();) ++ + public: + static void init(void); // Called before command line parsing ++ ++ static void init_container_support() { // Called during command line parsing. ++ LINUX_ONLY(pd_init_container_support();) ++ } ++ + static void init_before_ergo(void); // Called after command line parsing + // before VM ergonomics processing. + static jint init_2(void); // Called after command line parsing +diff --git openjdk.orig/hotspot/src/share/vm/runtime/thread.cpp openjdk/hotspot/src/share/vm/runtime/thread.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/thread.cpp ++++ openjdk/hotspot/src/share/vm/runtime/thread.cpp +@@ -3332,6 +3332,7 @@ + Arguments::init_version_specific_system_properties(); + + // Parse arguments ++ // Note: this internally calls os::init_container_support() + jint parse_result = Arguments::parse(args); + if (parse_result != JNI_OK) return parse_result; + diff --git a/8162384-pr3122-rh1358661.patch b/8162384-pr3122-rh1358661.patch deleted file mode 100644 index ff38413..0000000 --- a/8162384-pr3122-rh1358661.patch +++ /dev/null @@ -1,54 +0,0 @@ -# HG changeset patch -# User roland -# Date 1469615613 -7200 -# Wed Jul 27 12:33:33 2016 +0200 -# Node ID fd29eff8b797daa41a68394ced7fe80c9e8c96e9 -# Parent ee9bffb3bd390b2ad805c7b59d7d2ab8a68a4367 -8162384, PR3122: Performance regression: bimorphic inlining may be bypassed by type speculation -Summary: when speculation fails at a call fallback to profile data at the call site -Reviewed-by: kvn - -diff -r ee9bffb3bd39 -r fd29eff8b797 src/share/vm/opto/doCall.cpp ---- openjdk/hotspot/src/share/vm/opto/doCall.cpp Mon Aug 01 16:33:54 2016 +0100 -+++ openjdk/hotspot/src/share/vm/opto/doCall.cpp Wed Jul 27 12:33:33 2016 +0200 -@@ -205,16 +205,22 @@ - - int morphism = profile.morphism(); - if (speculative_receiver_type != NULL) { -- // We have a speculative type, we should be able to resolve -- // the call. We do that before looking at the profiling at -- // this invoke because it may lead to bimorphic inlining which -- // a speculative type should help us avoid. -- receiver_method = callee->resolve_invoke(jvms->method()->holder(), -- speculative_receiver_type); -- if (receiver_method == NULL) { -+ if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) { -+ // We have a speculative type, we should be able to resolve -+ // the call. We do that before looking at the profiling at -+ // this invoke because it may lead to bimorphic inlining which -+ // a speculative type should help us avoid. -+ receiver_method = callee->resolve_invoke(jvms->method()->holder(), -+ speculative_receiver_type); -+ if (receiver_method == NULL) { -+ speculative_receiver_type = NULL; -+ } else { -+ morphism = 1; -+ } -+ } else { -+ // speculation failed before. Use profiling at the call -+ // (could allow bimorphic inlining for instance). - speculative_receiver_type = NULL; -- } else { -- morphism = 1; - } - } - if (receiver_method == NULL && -@@ -252,7 +258,7 @@ - Deoptimization::Reason_bimorphic : - (speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check); - if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && -- !too_many_traps(jvms->method(), jvms->bci(), reason) -+ !too_many_traps(caller, bci, reason) - ) { - // Generate uncommon trap for class check failure path - // in case of monomorphic or bimorphic virtual call site. diff --git a/8165231-rh1437545.patch b/8165231-rh1437545.patch deleted file mode 100644 index e0d5be7..0000000 --- a/8165231-rh1437545.patch +++ /dev/null @@ -1,48 +0,0 @@ -# HG changeset patch -# User horii -# Date 1473905514 14400 -# Wed Sep 14 22:11:54 2016 -0400 -# Node ID 8d16f74380a78eb76cb33183a64440316393903e -# Parent be698ac288484ab140715ee29ed9335e6ea8a33b -8165231: java.nio.Bits.unaligned() doesn't return true on ppc -Reviewed-by: simonis, coffeys - -diff --git a/src/share/classes/java/nio/Bits.java b/src/share/classes/java/nio/Bits.java ---- openjdk/jdk/src/share/classes/java/nio/Bits.java -+++ openjdk/jdk/src/share/classes/java/nio/Bits.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -614,7 +614,8 @@ - String arch = AccessController.doPrivileged( - new sun.security.action.GetPropertyAction("os.arch")); - unaligned = arch.equals("i386") || arch.equals("x86") -- || arch.equals("amd64") || arch.equals("x86_64"); -+ || arch.equals("amd64") || arch.equals("x86_64") -+ || arch.equals("ppc64") || arch.equals("ppc64le"); - unalignedKnown = true; - return unaligned; - } -diff --git a/src/share/classes/sun/security/provider/ByteArrayAccess.java b/src/share/classes/sun/security/provider/ByteArrayAccess.java ---- openjdk/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java -+++ openjdk/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -94,7 +94,7 @@ - String arch = java.security.AccessController.doPrivileged - (new sun.security.action.GetPropertyAction("os.arch", "")); - return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64") -- || arch.equals("x86_64"); -+ || arch.equals("x86_64") || arch.equals("ppc64") || arch.equals("ppc64le"); - } - - /** diff --git a/8165489-pr3589.patch b/8165489-pr3589.patch new file mode 100644 index 0000000..1674dec --- /dev/null +++ b/8165489-pr3589.patch @@ -0,0 +1,123 @@ +# HG changeset patch +# User mdoerr +# Date 1473159687 -7200 +# Tue Sep 06 13:01:27 2016 +0200 +# Node ID 7f6e1069a5719c8908b53774d3560ce851c7cd70 +# Parent b8fc1e640c4c7f38ca94131279cb67c4d3de6961 +8165489, PR3589: Missing G1 barrier in Unsafe_GetObjectVolatile +Summary: Add missing barrier, sharing code with Unsafe_GetObject. +Reviewed-by: kbarrett, mgerdin, pliden, tschatzl + +diff --git openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp openjdk/hotspot/src/share/vm/prims/unsafe.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp ++++ openjdk/hotspot/src/share/vm/prims/unsafe.cpp +@@ -199,37 +199,40 @@ + + // Get/SetObject must be special-cased, since it works with handles. + ++// We could be accessing the referent field in a reference ++// object. If G1 is enabled then we need to register non-null ++// referent with the SATB barrier. ++ ++#if INCLUDE_ALL_GCS ++static bool is_java_lang_ref_Reference_access(oop o, jlong offset) { ++ if (offset == java_lang_ref_Reference::referent_offset && o != NULL) { ++ Klass* k = o->klass(); ++ if (InstanceKlass::cast(k)->reference_type() != REF_NONE) { ++ assert(InstanceKlass::cast(k)->is_subclass_of(SystemDictionary::Reference_klass()), "sanity"); ++ return true; ++ } ++ } ++ return false; ++} ++#endif ++ ++static void ensure_satb_referent_alive(oop o, jlong offset, oop v) { ++#if INCLUDE_ALL_GCS ++ if (UseG1GC && v != NULL && is_java_lang_ref_Reference_access(o, offset)) { ++ G1SATBCardTableModRefBS::enqueue(v); ++ } ++#endif ++} ++ + // The xxx140 variants for backward compatibility do not allow a full-width offset. + UNSAFE_ENTRY(jobject, Unsafe_GetObject140(JNIEnv *env, jobject unsafe, jobject obj, jint offset)) + UnsafeWrapper("Unsafe_GetObject"); + if (obj == NULL) THROW_0(vmSymbols::java_lang_NullPointerException()); + GET_OOP_FIELD(obj, offset, v) +- jobject ret = JNIHandles::make_local(env, v); +-#if INCLUDE_ALL_GCS +- // We could be accessing the referent field in a reference +- // object. If G1 is enabled then we need to register a non-null +- // referent with the SATB barrier. +- if (UseG1GC) { +- bool needs_barrier = false; + +- if (ret != NULL) { +- if (offset == java_lang_ref_Reference::referent_offset) { +- oop o = JNIHandles::resolve_non_null(obj); +- Klass* k = o->klass(); +- if (InstanceKlass::cast(k)->reference_type() != REF_NONE) { +- assert(InstanceKlass::cast(k)->is_subclass_of(SystemDictionary::Reference_klass()), "sanity"); +- needs_barrier = true; +- } +- } +- } ++ ensure_satb_referent_alive(p, offset, v); + +- if (needs_barrier) { +- oop referent = JNIHandles::resolve(ret); +- G1SATBCardTableModRefBS::enqueue(referent); +- } +- } +-#endif // INCLUDE_ALL_GCS +- return ret; ++ return JNIHandles::make_local(env, v); + UNSAFE_END + + UNSAFE_ENTRY(void, Unsafe_SetObject140(JNIEnv *env, jobject unsafe, jobject obj, jint offset, jobject x_h)) +@@ -262,32 +265,10 @@ + UNSAFE_ENTRY(jobject, Unsafe_GetObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset)) + UnsafeWrapper("Unsafe_GetObject"); + GET_OOP_FIELD(obj, offset, v) +- jobject ret = JNIHandles::make_local(env, v); +-#if INCLUDE_ALL_GCS +- // We could be accessing the referent field in a reference +- // object. If G1 is enabled then we need to register non-null +- // referent with the SATB barrier. +- if (UseG1GC) { +- bool needs_barrier = false; + +- if (ret != NULL) { +- if (offset == java_lang_ref_Reference::referent_offset && obj != NULL) { +- oop o = JNIHandles::resolve(obj); +- Klass* k = o->klass(); +- if (InstanceKlass::cast(k)->reference_type() != REF_NONE) { +- assert(InstanceKlass::cast(k)->is_subclass_of(SystemDictionary::Reference_klass()), "sanity"); +- needs_barrier = true; +- } +- } +- } ++ ensure_satb_referent_alive(p, offset, v); + +- if (needs_barrier) { +- oop referent = JNIHandles::resolve(ret); +- G1SATBCardTableModRefBS::enqueue(referent); +- } +- } +-#endif // INCLUDE_ALL_GCS +- return ret; ++ return JNIHandles::make_local(env, v); + UNSAFE_END + + UNSAFE_ENTRY(void, Unsafe_SetObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) +@@ -312,6 +293,9 @@ + } else { + (void)const_cast(v = *(volatile oop*) addr); + } ++ ++ ensure_satb_referent_alive(p, offset, v); ++ + OrderAccess::acquire(); + return JNIHandles::make_local(env, v); + UNSAFE_END diff --git a/8171000-pr3542-rh1402819.patch b/8171000-pr3542-rh1402819.patch new file mode 100644 index 0000000..d831aa9 --- /dev/null +++ b/8171000-pr3542-rh1402819.patch @@ -0,0 +1,121 @@ +# HG changeset patch +# User kaddepalli +# Date 1517818481 -19800 +# Mon Feb 05 13:44:41 2018 +0530 +# Node ID b77308735540644d4710244e3c88865067f2905a +# Parent 39bfc94b1f4265b645c2970a58389acc779dafe9 +8171000, PR3542, RH1402819: Robot.createScreenCapture() crashes in wayland mode +Reviewed-by: serb, mhalder + +diff --git openjdk.orig/jdk/src/solaris/native/sun/awt/multiVis.c openjdk/jdk/src/solaris/native/sun/awt/multiVis.c +--- openjdk.orig/jdk/src/solaris/native/sun/awt/multiVis.c ++++ openjdk/jdk/src/solaris/native/sun/awt/multiVis.c +@@ -394,77 +394,48 @@ + XRectangle bbox; /* bounding box of grabbed area */ + list_ptr regions;/* list of regions to read from */ + { +- image_region_type *reg; +- int32_t dst_x, dst_y; /* where in pixmap to write (UL) */ +- int32_t diff; +- +- XImage *reg_image,*ximage ; +- int32_t srcRect_x,srcRect_y,srcRect_width,srcRect_height ; +- int32_t rem ; +- int32_t bytes_per_line; +- int32_t bitmap_unit; +- +- bitmap_unit = sizeof (long); +- if (format == ZPixmap) +- bytes_per_line = width*depth/8; +- else +- bytes_per_line = width/8; +- +- +- /* Find out how many more bytes are required for padding so that +- ** bytes per scan line will be multiples of bitmap_unit bits */ +- if (format == ZPixmap) { +- rem = (bytes_per_line*8)%bitmap_unit; +- if (rem) +- bytes_per_line += (rem/8 + 1); +- } ++ XImage *ximage ; + + ximage = XCreateImage(disp,fakeVis,(uint32_t) depth,format,0,NULL, + (uint32_t)width,(uint32_t)height,8,0); + +- bytes_per_line = ximage->bytes_per_line; +- +- if (format == ZPixmap) +- ximage->data = malloc(height*bytes_per_line); +- else +- ximage->data = malloc(height*bytes_per_line*depth); +- ++ ximage->data = calloc(ximage->bytes_per_line*height*((format==ZPixmap)? 1 : depth), sizeof(char)); + ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/ + +- for (reg = (image_region_type *) first_in_list( regions); reg; ++ for (image_region_type* reg = (image_region_type *) first_in_list( regions); reg; + reg = (image_region_type *) next_in_list( regions)) + { +- int32_t rect; +- struct my_XRegion *vis_reg; +- vis_reg = (struct my_XRegion *)(reg->visible_region); +- for (rect = 0; +- rect < vis_reg->numRects; +- rect++) ++ struct my_XRegion *vis_reg = (struct my_XRegion *)(reg->visible_region); ++ for (int32_t rect = 0; rect < vis_reg->numRects; rect++) + { +- /** ------------------------------------------------------------------------ +- Intersect bbox with visible part of region giving src rect & output +- location. Width is the min right side minus the max left side. +- Similar for height. Offset src rect so x,y are relative to +- origin of win, not the root-relative visible rect of win. +- ------------------------------------------------------------------------ **/ +- srcRect_width = MIN( vis_reg->rects[rect].x2, bbox.width + bbox.x) +- - MAX( vis_reg->rects[rect].x1, bbox.x); ++ /** ------------------------------------------------------------------------ ++ Intersect bbox with visible part of region giving src rect & output ++ location. Width is the min right side minus the max left side. ++ Similar for height. Offset src rect so x,y are relative to ++ origin of win, not the root-relative visible rect of win. ++ ------------------------------------------------------------------------ **/ ++ int32_t srcRect_width = MIN( vis_reg->rects[rect].x2, bbox.width + bbox.x) ++ - MAX( vis_reg->rects[rect].x1, bbox.x); ++ ++ int32_t srcRect_height = MIN( vis_reg->rects[rect].y2, bbox.height + bbox.y) ++ - MAX( vis_reg->rects[rect].y1, bbox.y); + +- srcRect_height = MIN( vis_reg->rects[rect].y2, bbox.height + bbox.y) +- - MAX( vis_reg->rects[rect].y1, bbox.y); ++ int32_t diff = bbox.x - vis_reg->rects[rect].x1; ++ int32_t srcRect_x = MAX( 0, diff) + (vis_reg->rects[rect].x1 - reg->x_rootrel - reg->border); ++ int32_t dst_x = MAX( 0, -diff) ; + +- diff = bbox.x - vis_reg->rects[rect].x1; +- srcRect_x = MAX( 0, diff) + (vis_reg->rects[rect].x1 - reg->x_rootrel - reg->border); +- dst_x = MAX( 0, -diff) ; +- diff = bbox.y - vis_reg->rects[rect].y1; +- srcRect_y = MAX( 0, diff) + (vis_reg->rects[rect].y1 - reg->y_rootrel - reg->border); +- dst_y = MAX( 0, -diff) ; +- reg_image = XGetImage(disp,reg->win,srcRect_x,srcRect_y, +- (uint32_t) srcRect_width, (uint32_t) srcRect_height,AllPlanes,format) ; +- TransferImage(disp,reg_image,srcRect_width, +- srcRect_height,reg,ximage,dst_x,dst_y) ; +- XDestroyImage(reg_image); +- } ++ diff = bbox.y - vis_reg->rects[rect].y1; ++ int32_t srcRect_y = MAX( 0, diff) + (vis_reg->rects[rect].y1 - reg->y_rootrel - reg->border); ++ int32_t dst_y = MAX( 0, -diff) ; ++ XImage* reg_image = XGetImage(disp,reg->win,srcRect_x,srcRect_y, ++ (uint32_t) srcRect_width, (uint32_t) srcRect_height,AllPlanes,format) ; ++ ++ if (reg_image) { ++ TransferImage(disp,reg_image,srcRect_width, ++ srcRect_height,reg,ximage,dst_x,dst_y) ; ++ XDestroyImage(reg_image); ++ } ++ } + } + return ximage ; + } diff --git a/8173941-pr3326.patch b/8173941-pr3326.patch deleted file mode 100644 index 50e74f6..0000000 --- a/8173941-pr3326.patch +++ /dev/null @@ -1,77 +0,0 @@ -# HG changeset patch -# User ysuenaga -# Date 1487123491 18000 -# Tue Feb 14 20:51:31 2017 -0500 -# Node ID 15922b2f31db4857ec84efdf533c41b19e68030b -# Parent 652fe741b8f2bfdacba66d772cc89fe7ec6dea66 -8173941, PR3326: SA does not work if executable is DSO -Reviewed-by: aph, dsamersoff - -diff --git a/agent/src/os/linux/elfmacros.h b/agent/src/os/linux/elfmacros.h ---- openjdk/hotspot/agent/src/os/linux/elfmacros.h -+++ openjdk/hotspot/agent/src/os/linux/elfmacros.h -@@ -33,6 +33,7 @@ - #define ELF_NHDR Elf64_Nhdr - #define ELF_DYN Elf64_Dyn - #define ELF_ADDR Elf64_Addr -+#define ELF_AUXV Elf64_auxv_t - - #define ELF_ST_TYPE ELF64_ST_TYPE - -@@ -45,6 +46,7 @@ - #define ELF_NHDR Elf32_Nhdr - #define ELF_DYN Elf32_Dyn - #define ELF_ADDR Elf32_Addr -+#define ELF_AUXV Elf32_auxv_t - - #define ELF_ST_TYPE ELF32_ST_TYPE - -diff --git a/agent/src/os/linux/ps_core.c b/agent/src/os/linux/ps_core.c ---- openjdk/hotspot/agent/src/os/linux/ps_core.c -+++ openjdk/hotspot/agent/src/os/linux/ps_core.c -@@ -642,6 +642,18 @@ - if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { - return false; - } -+ } else if (notep->n_type == NT_AUXV) { -+ // Get first segment from entry point -+ ELF_AUXV *auxv = (ELF_AUXV *)descdata; -+ while (auxv->a_type != AT_NULL) { -+ if (auxv->a_type == AT_ENTRY) { -+ // Set entry point address to address of dynamic section. -+ // We will adjust it in read_exec_segments(). -+ ph->core->dynamic_addr = auxv->a_un.a_val; -+ break; -+ } -+ auxv++; -+ } - } - p = descdata + ROUNDUP(notep->n_descsz, 4); - } -@@ -826,7 +838,13 @@ - - // from PT_DYNAMIC we want to read address of first link_map addr - case PT_DYNAMIC: { -- ph->core->dynamic_addr = exec_php->p_vaddr; -+ if (exec_ehdr->e_type == ET_EXEC) { -+ ph->core->dynamic_addr = exec_php->p_vaddr; -+ } else { // ET_DYN -+ // dynamic_addr has entry point of executable. -+ // Thus we should substract it. -+ ph->core->dynamic_addr += exec_php->p_vaddr - exec_ehdr->e_entry; -+ } - print_debug("address of _DYNAMIC is 0x%lx\n", ph->core->dynamic_addr); - break; - } -@@ -1024,8 +1042,9 @@ - goto err; - } - -- if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { -- print_debug("executable file is not a valid ELF ET_EXEC file\n"); -+ if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || -+ ((exec_ehdr.e_type != ET_EXEC) && (exec_ehdr.e_type != ET_DYN))) { -+ print_debug("executable file is not a valid ELF file\n"); - goto err; - } - diff --git a/8174164-pr3334-rh1417266.patch b/8174164-pr3334-rh1417266.patch deleted file mode 100644 index 494883f..0000000 --- a/8174164-pr3334-rh1417266.patch +++ /dev/null @@ -1,79 +0,0 @@ -# HG changeset patch -# User roland -# Date 1487208397 28800 -# Wed Feb 15 17:26:37 2017 -0800 -# Node ID a9cbaff50d3d7e3a1d2dbdc0121c470142b87270 -# Parent 15922b2f31db4857ec84efdf533c41b19e68030b -8174164, PR3334, RH1417266: SafePointNode::_replaced_nodes breaks with irreducible loops -Reviewed-by: kvn - -diff --git a/src/share/vm/opto/callnode.hpp b/src/share/vm/opto/callnode.hpp ---- openjdk/hotspot/src/share/vm/opto/callnode.hpp -+++ openjdk/hotspot/src/share/vm/opto/callnode.hpp -@@ -449,8 +449,8 @@ - void delete_replaced_nodes() { - _replaced_nodes.reset(); - } -- void apply_replaced_nodes() { -- _replaced_nodes.apply(this); -+ void apply_replaced_nodes(uint idx) { -+ _replaced_nodes.apply(this, idx); - } - void merge_replaced_nodes_with(SafePointNode* sfpt) { - _replaced_nodes.merge_with(sfpt->_replaced_nodes); -diff --git a/src/share/vm/opto/parse1.cpp b/src/share/vm/opto/parse1.cpp ---- openjdk/hotspot/src/share/vm/opto/parse1.cpp -+++ openjdk/hotspot/src/share/vm/opto/parse1.cpp -@@ -1048,7 +1048,7 @@ - kit.make_dtrace_method_exit(method()); - } - if (_replaced_nodes_for_exceptions) { -- kit.map()->apply_replaced_nodes(); -+ kit.map()->apply_replaced_nodes(_new_idx); - } - // Done with exception-path processing. - ex_map = kit.make_exception_state(ex_oop); -@@ -1069,7 +1069,7 @@ - _exits.add_exception_state(ex_map); - } - } -- _exits.map()->apply_replaced_nodes(); -+ _exits.map()->apply_replaced_nodes(_new_idx); - } - - //-----------------------------create_entry_map------------------------------- -diff --git a/src/share/vm/opto/replacednodes.cpp b/src/share/vm/opto/replacednodes.cpp ---- openjdk/hotspot/src/share/vm/opto/replacednodes.cpp -+++ openjdk/hotspot/src/share/vm/opto/replacednodes.cpp -@@ -91,13 +91,17 @@ - } - - // Perfom node replacement (used when returning to caller) --void ReplacedNodes::apply(Node* n) { -+void ReplacedNodes::apply(Node* n, uint idx) { - if (is_empty()) { - return; - } - for (int i = 0; i < _replaced_nodes->length(); i++) { - ReplacedNode replaced = _replaced_nodes->at(i); -- n->replace_edge(replaced.initial(), replaced.improved()); -+ // Only apply if improved node was created in a callee to avoid -+ // issues with irreducible loops in the caller -+ if (replaced.improved()->_idx >= idx) { -+ n->replace_edge(replaced.initial(), replaced.improved()); -+ } - } - } - -diff --git a/src/share/vm/opto/replacednodes.hpp b/src/share/vm/opto/replacednodes.hpp ---- openjdk/hotspot/src/share/vm/opto/replacednodes.hpp -+++ openjdk/hotspot/src/share/vm/opto/replacednodes.hpp -@@ -71,7 +71,7 @@ - void record(Node* initial, Node* improved); - void transfer_from(const ReplacedNodes& other, uint idx); - void reset(); -- void apply(Node* n); -+ void apply(Node* n, uint idx); - void merge_with(const ReplacedNodes& other); - bool is_empty() const; - void dump(outputStream *st) const; diff --git a/8174729-pr3336-rh1420518.patch b/8174729-pr3336-rh1420518.patch deleted file mode 100644 index 3d67850..0000000 --- a/8174729-pr3336-rh1420518.patch +++ /dev/null @@ -1,122 +0,0 @@ -# HG changeset patch -# User adinn -# Date 1487931564 0 -# Fri Feb 24 10:19:24 2017 +0000 -# Node ID d41592af9af3790fe5eee30ce686d85cff09c942 -# Parent 1ac9b0f1bf17fc5935bfa8250550eabc2ffb6785 -8174729, PR3336, RH1420518: Race Condition in java.lang.reflect.WeakCache -Summary: Race can occur between Proxy.getProxyClass and Proxy.isProxyClass -Reviewed-by: mchung - -diff --git a/src/share/classes/java/lang/reflect/WeakCache.java b/src/share/classes/java/lang/reflect/WeakCache.java ---- openjdk/jdk/src/share/classes/java/lang/reflect/WeakCache.java -+++ openjdk/jdk/src/share/classes/java/lang/reflect/WeakCache.java -@@ -239,11 +239,11 @@ - // wrap value with CacheValue (WeakReference) - CacheValue cacheValue = new CacheValue<>(value); - -+ // put into reverseMap -+ reverseMap.put(cacheValue, Boolean.TRUE); -+ - // try replacing us with CacheValue (this should always succeed) -- if (valuesMap.replace(subKey, this, cacheValue)) { -- // put also in reverseMap -- reverseMap.put(cacheValue, Boolean.TRUE); -- } else { -+ if (!valuesMap.replace(subKey, this, cacheValue)) { - throw new AssertionError("Should not reach here"); - } - -diff --git a/test/java/lang/reflect/Proxy/ProxyRace.java b/test/java/lang/reflect/Proxy/ProxyRace.java -new file mode 100644 ---- /dev/null -+++ openjdk/jdk/test/java/lang/reflect/Proxy/ProxyRace.java -@@ -0,0 +1,88 @@ -+/* -+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+import java.lang.reflect.Proxy; -+import java.util.concurrent.ExecutorService; -+import java.util.concurrent.Executors; -+import java.util.concurrent.Phaser; -+import java.util.concurrent.TimeUnit; -+import java.util.concurrent.atomic.AtomicInteger; -+ -+/** -+ * @test -+ * @bug 8174729 -+ * @summary Proxy.getProxyClass() / Proxy.isProxyClass() race detector -+ * @run main ProxyRace -+ * @author plevart -+ */ -+ -+public class ProxyRace { -+ -+ static final int threads = 8; -+ -+ static volatile ClassLoader classLoader; -+ static volatile boolean terminate; -+ static final AtomicInteger racesDetected = new AtomicInteger(); -+ -+ public static void main(String[] args) throws Exception { -+ -+ Phaser phaser = new Phaser(threads) { -+ @Override -+ protected boolean onAdvance(int phase, int registeredParties) { -+ // install new ClassLoader on each advance -+ classLoader = new CL(); -+ return terminate; -+ } -+ }; -+ -+ ExecutorService exe = Executors.newFixedThreadPool(threads); -+ -+ for (int i = 0; i < threads; i++) { -+ exe.execute(() -> { -+ while (phaser.arriveAndAwaitAdvance() >= 0) { -+ Class proxyClass = Proxy.getProxyClass(classLoader, Runnable.class); -+ if (!Proxy.isProxyClass(proxyClass)) { -+ racesDetected.incrementAndGet(); -+ } -+ } -+ }); -+ } -+ -+ Thread.sleep(5000L); -+ -+ terminate = true; -+ exe.shutdown(); -+ exe.awaitTermination(5L, TimeUnit.SECONDS); -+ -+ System.out.println(racesDetected.get() + " races detected"); -+ if (racesDetected.get() != 0) { -+ throw new RuntimeException(racesDetected.get() + " races detected"); -+ } -+ } -+ -+ static class CL extends ClassLoader { -+ public CL() { -+ super(ClassLoader.getSystemClassLoader()); -+ } -+ } -+} diff --git a/8175097-pr3334-rh1417266.patch b/8175097-pr3334-rh1417266.patch deleted file mode 100644 index e80dd11..0000000 --- a/8175097-pr3334-rh1417266.patch +++ /dev/null @@ -1,100 +0,0 @@ -# HG changeset patch -# User roland -# Date 1487286884 28800 -# Thu Feb 16 15:14:44 2017 -0800 -# Node ID 1b4eb44fbfcd0fceb485d89d91eb893d99f5864b -# Parent a9cbaff50d3d7e3a1d2dbdc0121c470142b87270 -8175097, PR3334, RH1417266: [TESTBUG] 8174164 fix missed the test -Reviewed-by: kvn - -diff --git a/test/compiler/c2/TestReplacedNodesOSR.java b/test/compiler/c2/TestReplacedNodesOSR.java -new file mode 100644 ---- /dev/null -+++ openjdk/hotspot/test/compiler/c2/TestReplacedNodesOSR.java -@@ -0,0 +1,86 @@ -+/* -+ * Copyright (c) 2017, Red Hat, Inc. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/** -+ * @test -+ * @bug 8174164 -+ * @summary SafePointNode::_replaced_nodes breaks with irreducible loops -+ * @run main/othervm -XX:-BackgroundCompilation TestReplacedNodesOSR -+ * -+ */ -+ -+public class TestReplacedNodesOSR { -+ -+ static Object dummy; -+ -+ static interface I { -+ } -+ -+ static class A implements I { -+ } -+ -+ static final class MyException extends Exception { -+ } -+ -+ static final A obj = new A(); -+ static I static_field() { return obj; } -+ -+ // When OSR compiled, this method has an irreducible loop -+ static void test(int v, MyException e) { -+ int i = 0; -+ for (;;) { -+ if (i == 1000) { -+ break; -+ } -+ try { -+ if ((i%2) == 0) { -+ int j = 0; -+ for (;;) { -+ j++; -+ if (i+j != v) { -+ if (j == 1000) { -+ break; -+ } -+ } else { -+ A a = (A)static_field(); -+ // replaced node recorded here -+ throw e; -+ } -+ } -+ } -+ } catch(MyException ex) { -+ } -+ i++; -+ // replaced node applied on return of the method -+ // replaced node used here -+ dummy = static_field(); -+ } -+ } -+ -+ -+ static public void main(String[] args) { -+ for (int i = 0; i < 1000; i++) { -+ test(1100, new MyException()); -+ } -+ } -+} diff --git a/8184309-pr3596.patch b/8184309-pr3596.patch new file mode 100644 index 0000000..00b6125 --- /dev/null +++ b/8184309-pr3596.patch @@ -0,0 +1,21 @@ +# HG changeset patch +# User ysuenaga +# Date 1527498573 -3600 +# Mon May 28 10:09:33 2018 +0100 +# Node ID ef176cb429c49d1c330d9575938f66b04e3fb730 +# Parent 6915dc9ae18cce5625d3a3fc74b37da70a5b4215 +8184309, PR3596: Build warnings from GCC 7.1 on Fedora 26 +Reviewed-by: kbarrett, vlivanov + +diff --git openjdk.orig/hotspot/src/share/vm/code/dependencies.cpp openjdk/hotspot/src/share/vm/code/dependencies.cpp +--- openjdk.orig/hotspot/src/share/vm/code/dependencies.cpp ++++ openjdk/hotspot/src/share/vm/code/dependencies.cpp +@@ -525,7 +525,7 @@ + xtty->object("x", arg.metadata_value()); + } + } else { +- char xn[10]; sprintf(xn, "x%d", j); ++ char xn[12]; sprintf(xn, "x%d", j); + if (arg.is_oop()) { + xtty->object(xn, arg.oop_value()); + } else { diff --git a/8185723-pr3553.patch b/8185723-pr3553.patch new file mode 100644 index 0000000..f8ee50a --- /dev/null +++ b/8185723-pr3553.patch @@ -0,0 +1,27 @@ +# HG changeset patch +# User aph +# Date 1501690960 -3600 +# Wed Aug 02 17:22:40 2017 +0100 +# Node ID 91ab2eac9856ec86c16c0bedd32e0b87974ead6f +# Parent 4e2adbc3d2b512f6b2bf318d2db60f4d1903f8c7 +8185723, PR3553: Zero: segfaults on Power PC 32-bit +Reviewed-by: roland + +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +@@ -38,10 +38,10 @@ + static void atomic_copy64(volatile void *src, volatile void *dst) { + #if defined(PPC32) + double tmp; +- asm volatile ("lfd %0, 0(%1)\n" +- "stfd %0, 0(%2)\n" +- : "=f"(tmp) +- : "b"(src), "b"(dst)); ++ asm volatile ("lfd %0, %2\n" ++ "stfd %0, %1\n" ++ : "=&f"(tmp), "=Q"(*(volatile double*)dst) ++ : "Q"(*(volatile double*)src)); + #elif defined(S390) && !defined(_LP64) + double tmp; + asm volatile ("ld %0, 0(%1)\n" diff --git a/8186461-pr3557.patch b/8186461-pr3557.patch new file mode 100644 index 0000000..cc8020c --- /dev/null +++ b/8186461-pr3557.patch @@ -0,0 +1,32 @@ +# HG changeset patch +# User glaubitz +# Date 1524889690 -3600 +# Sat Apr 28 05:28:10 2018 +0100 +# Node ID be1379a186ba527b32c93a83e04c9600735fe44b +# Parent 91ab2eac9856ec86c16c0bedd32e0b87974ead6f +8186461, PR3557: Zero's atomic_copy64() should use SPE instructions on linux-powerpcspe +Reviewed-by: aph + +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +@@ -36,12 +36,18 @@ + + // Atomically copy 64 bits of data + static void atomic_copy64(volatile void *src, volatile void *dst) { +-#if defined(PPC32) ++#if defined(PPC32) && !defined(__SPE__) + double tmp; + asm volatile ("lfd %0, %2\n" + "stfd %0, %1\n" + : "=&f"(tmp), "=Q"(*(volatile double*)dst) + : "Q"(*(volatile double*)src)); ++#elif defined(PPC32) && defined(__SPE__) ++ long tmp; ++ asm volatile ("evldd %0, %2\n" ++ "evstdd %0, %1\n" ++ : "=&r"(tmp), "=Q"(*(volatile long*)dst) ++ : "Q"(*(volatile long*)src)); + #elif defined(S390) && !defined(_LP64) + double tmp; + asm volatile ("ld %0, 0(%1)\n" diff --git a/8188030-pr3459-rh1484079.patch b/8188030-pr3459-rh1484079.patch new file mode 100644 index 0000000..8564c81 --- /dev/null +++ b/8188030-pr3459-rh1484079.patch @@ -0,0 +1,21 @@ +# HG changeset patch +# User neugens +# Date 1507735508 -3600 +# Wed Oct 11 16:25:08 2017 +0100 +# Node ID 5b91bf11d0f41a6124ffb0fcd8870507b50bd734 +# Parent 7b1a2f967cd8e950fe7dc47d716af13d36239a38 +8188030, PR3459, RH1484079: AWT java apps fail to start when some minimal fonts are present +Summary: Handle CFF fonts +Reviewed-by: andrew, prr + +diff --git a/src/solaris/native/sun/awt/fontpath.c b/src/solaris/native/sun/awt/fontpath.c +--- openjdk/jdk/src/solaris/native/sun/awt/fontpath.c ++++ openjdk/jdk/src/solaris/native/sun/awt/fontpath.c +@@ -1233,6 +1233,7 @@ + && (strcmp((char*)fontformat, "TrueType") != 0) + #if defined(__linux__) || defined(_AIX) + && (strcmp((char*)fontformat, "Type 1") != 0) ++ && (strcmp((char*)fontformat, "CFF") != 0) + #endif + ) { + continue; diff --git a/8197429-pr3546-rh1536622.patch b/8197429-pr3546-rh1536622.patch new file mode 100644 index 0000000..fc60cd3 --- /dev/null +++ b/8197429-pr3546-rh1536622.patch @@ -0,0 +1,93 @@ +diff -r eecfc14e66ee src/os/linux/vm/os_linux.cpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp Mon Jan 22 16:25:24 2018 +0000 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp Wed Feb 21 13:52:31 2018 +0000 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -674,6 +674,10 @@ + } + } + ++void os::Linux::expand_stack_to(address bottom) { ++ _expand_stack_to(bottom); ++} ++ + bool os::Linux::manually_expand_stack(JavaThread * t, address addr) { + assert(t!=NULL, "just checking"); + assert(t->osthread()->expanding_stack(), "expand should be set"); +diff -r eecfc14e66ee src/os/linux/vm/os_linux.hpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.hpp Mon Jan 22 16:25:24 2018 +0000 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp Wed Feb 21 13:52:31 2018 +0000 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -245,6 +245,8 @@ + static int safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime); + + private: ++ static void expand_stack_to(address bottom); ++ + typedef int (*sched_getcpu_func_t)(void); + typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen); + typedef int (*numa_max_node_func_t)(void); +diff -r eecfc14e66ee src/os_cpu/linux_x86/vm/os_linux_x86.cpp +--- openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Mon Jan 22 16:25:24 2018 +0000 ++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Wed Feb 21 13:52:31 2018 +0000 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -892,6 +892,25 @@ + void os::workaround_expand_exec_shield_cs_limit() { + #if defined(IA32) + size_t page_size = os::vm_page_size(); ++ ++ /* ++ * JDK-8197429 ++ * ++ * Expand the stack mapping to the end of the initial stack before ++ * attempting to install the codebuf. This is needed because newer ++ * Linux kernels impose a distance of a megabyte between stack ++ * memory and other memory regions. If we try to install the ++ * codebuf before expanding the stack the installation will appear ++ * to succeed but we'll get a segfault later if we expand the stack ++ * in Java code. ++ * ++ */ ++ if (os::Linux::is_initial_thread()) { ++ address limit = Linux::initial_thread_stack_bottom(); ++ limit += (StackYellowPages + StackRedPages) * page_size; ++ os::Linux::expand_stack_to(limit); ++ } ++ + /* + * Take the highest VA the OS will give us and exec + * +@@ -910,6 +929,16 @@ + char* hint = (char*) (Linux::initial_thread_stack_bottom() - + ((StackYellowPages + StackRedPages + 1) * page_size)); + char* codebuf = os::attempt_reserve_memory_at(page_size, hint); ++ ++ if (codebuf == NULL) { ++ // JDK-8197429: There may be a stack gap of one megabyte between ++ // the limit of the stack and the nearest memory region: this is a ++ // Linux kernel workaround for CVE-2017-1000364. If we failed to ++ // map our codebuf, try again at an address one megabyte lower. ++ hint -= 1 * M; ++ codebuf = os::attempt_reserve_memory_at(page_size, hint); ++ } ++ + if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) { + return; // No matter, we tried, best effort. + } diff --git a/8197546-pr3542-rh1402819.patch b/8197546-pr3542-rh1402819.patch new file mode 100644 index 0000000..ba712ad --- /dev/null +++ b/8197546-pr3542-rh1402819.patch @@ -0,0 +1,35 @@ +# HG changeset patch +# User prr +# Date 1518454604 28800 +# Mon Feb 12 08:56:44 2018 -0800 +# Node ID 556adf3a76aa81bf3918d7d46554dae7cc1d5c5c +# Parent b77308735540644d4710244e3c88865067f2905a +8197546: Fix for 8171000 breaks Solaris + Linux builds +Reviewed-by: serb, jdv + +diff --git openjdk.orig/jdk/src/solaris/native/sun/awt/multiVis.c openjdk/jdk/src/solaris/native/sun/awt/multiVis.c +--- openjdk.orig/jdk/src/solaris/native/sun/awt/multiVis.c ++++ openjdk/jdk/src/solaris/native/sun/awt/multiVis.c +@@ -395,6 +395,8 @@ + list_ptr regions;/* list of regions to read from */ + { + XImage *ximage ; ++ image_region_type* reg; ++ int32_t rect; + + ximage = XCreateImage(disp,fakeVis,(uint32_t) depth,format,0,NULL, + (uint32_t)width,(uint32_t)height,8,0); +@@ -402,11 +404,11 @@ + ximage->data = calloc(ximage->bytes_per_line*height*((format==ZPixmap)? 1 : depth), sizeof(char)); + ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/ + +- for (image_region_type* reg = (image_region_type *) first_in_list( regions); reg; ++ for (reg = (image_region_type *) first_in_list( regions); reg; + reg = (image_region_type *) next_in_list( regions)) + { + struct my_XRegion *vis_reg = (struct my_XRegion *)(reg->visible_region); +- for (int32_t rect = 0; rect < vis_reg->numRects; rect++) ++ for (rect = 0; rect < vis_reg->numRects; rect++) + { + /** ------------------------------------------------------------------------ + Intersect bbox with visible part of region giving src rect & output diff --git a/8197981-pr3548.patch b/8197981-pr3548.patch new file mode 100644 index 0000000..5f6d9ce --- /dev/null +++ b/8197981-pr3548.patch @@ -0,0 +1,32 @@ +# HG changeset patch +# User andrew +# Date 1518667645 0 +# Thu Feb 15 04:07:25 2018 +0000 +# Node ID 1d35411eb7bdf16191e220ffe3b1dc4d5d0c6041 +# Parent 999983606f5c61b093c6f6316a7b26c4cd4ca79e +8197981, PR3548: Missing return statement in __sync_val_compare_and_swap_8 +Summary: Fix issue discovered by -Wreturn-type on systems without LP64. +Reviewed-by: aph + +diff --git openjdk.orig/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp openjdk/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp +--- openjdk.orig/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp ++++ openjdk/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp +@@ -457,6 +457,7 @@ + long long unsigned int oldval, + long long unsigned int newval) { + ShouldNotCallThis(); ++ return 0; + } + }; + #endif // !_LP64 +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +@@ -498,6 +498,7 @@ + long long unsigned int oldval, + long long unsigned int newval) { + ShouldNotCallThis(); ++ return 0; + } + }; + #endif // !_LP64 diff --git a/8199936-pr3533-workaround.patch b/8199936-pr3533-workaround.patch new file mode 100644 index 0000000..900e0c3 --- /dev/null +++ b/8199936-pr3533-workaround.patch @@ -0,0 +1,65 @@ +# HG changeset patch +# User andrew +# Date 1526122977 -3600 +# Sat May 12 12:02:57 2018 +0100 +# Node ID 00ccc73498628a51a45301322e64ce2ad06e49be +# Parent aecf9f48f7b5c6148b62713a6b746301435b57cc +PR3533: HotSpot generates code with unaligned stack, crashes on SSE operations +Summary: Enable -mstackrealign on x86 Linux as well as x86 Mac OS X + +diff --git openjdk.orig///common/autoconf/hotspot-spec.gmk.in openjdk///common/autoconf/hotspot-spec.gmk.in +--- openjdk.orig///common/autoconf/hotspot-spec.gmk.in ++++ openjdk///common/autoconf/hotspot-spec.gmk.in +@@ -110,7 +110,8 @@ + RC:=@HOTSPOT_RC@ + + EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \ +- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) ++ $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) \ ++ $(REALIGN_CFLAG) + EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@ + EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@ + +diff --git openjdk.orig///common/autoconf/spec.gmk.in openjdk///common/autoconf/spec.gmk.in +--- openjdk.orig///common/autoconf/spec.gmk.in ++++ openjdk///common/autoconf/spec.gmk.in +@@ -333,6 +333,7 @@ + + NO_DELETE_NULL_POINTER_CHECKS_CFLAG=@NO_DELETE_NULL_POINTER_CHECKS_CFLAG@ + NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@ ++REALIGN_CFLAG=@REALIGN_CFLAG@ + CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@ + + CXX:=@FIXPATH@ @CCACHE@ @CXX@ +diff --git openjdk.orig///common/autoconf/toolchain.m4 openjdk///common/autoconf/toolchain.m4 +--- openjdk.orig///common/autoconf/toolchain.m4 ++++ openjdk///common/autoconf/toolchain.m4 +@@ -796,20 +796,16 @@ + # + # NOTE: check for -mstackrealign needs to be below potential addition of -m32 + # +- if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then ++ if test "x$OPENJDK_TARGET_CPU" = xx86 && test "x$OPENJDK_TARGET_OS" = xmacosx -o \ ++ "x$OPENJDK_TARGET_OS" = xlinux; then + # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned. +- # While waiting for a better solution, the current workaround is to use -mstackrealign. +- CFLAGS="$CFLAGS -mstackrealign" +- AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign]) +- AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], +- [ +- AC_MSG_RESULT([yes]) +- ], +- [ +- AC_MSG_RESULT([no]) +- AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) +- ] ++ # While waiting for a better solution, the current workaround is to use -mstackrealign ++ # This is also required on Linux systems which use libraries compiled with SSE instructions ++ REALIGN_CFLAG="-mstackrealign" ++ TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$REALIGN_CFLAG -Werror], [], ++ AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) + ) ++ AC_SUBST([REALIGN_CFLAG]) + fi + + C_FLAG_DEPS="-MMD -MF" diff --git a/8201509-pr3579.patch b/8201509-pr3579.patch new file mode 100644 index 0000000..132c225 --- /dev/null +++ b/8201509-pr3579.patch @@ -0,0 +1,36 @@ +# HG changeset patch +# User mbalao +# Date 1525317412 -3600 +# Thu May 03 04:16:52 2018 +0100 +# Node ID de79964656fc652f2085dac4fe99bcc128b5a3b1 +# Parent ffd5260fe5adcb26f87a14f1aaaf3e1a075d712a +8201509, PR3579: Zero: S390 31bit atomic_copy64 inline assembler is wrong +Summary: The inline assembler for the S390 (S390 and not _LP64) has src and dst reversed thereby corrupting data +Reviewed-by: shade + +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +@@ -1,6 +1,6 @@ + /* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. +- * Copyright 2007, 2008, 2010 Red Hat, Inc. ++ * Copyright 2007, 2008, 2010, 2018, Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -50,10 +50,10 @@ + : "Q"(*(volatile long*)src)); + #elif defined(S390) && !defined(_LP64) + double tmp; +- asm volatile ("ld %0, 0(%1)\n" +- "std %0, 0(%2)\n" +- : "=r"(tmp) +- : "a"(src), "a"(dst)); ++ asm volatile ("ld %0, %2\n" ++ "std %0, %1\n" ++ : "=&f"(tmp), "=Q"(*(volatile double*)dst) ++ : "Q"(*(volatile double*)src)); + #elif defined(__ARM_ARCH_7A__) + jlong tmp; + asm volatile ("ldrexd %0, [%1]\n" diff --git a/8203182-pr3603-rh1568033.patch b/8203182-pr3603-rh1568033.patch new file mode 100644 index 0000000..031a60c --- /dev/null +++ b/8203182-pr3603-rh1568033.patch @@ -0,0 +1,131 @@ +# HG changeset patch +# User igerasim +# Date 1528992969 25200 +# Thu Jun 14 09:16:09 2018 -0700 +# Node ID d9b0b4bd2526818afa73b60da77403245554caa8 +# Parent 1f4b038b9550afaf88a70cee4cf9c1422ecd86d6 +8203182, PR3603: Release session if initialization of SunPKCS11 Signature fails +Summary: Ensure session is properly released in P11Signature class +Reviewed-by: valeriep +Contributed-by: Martin Balao + +diff --git openjdk.orig/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java openjdk/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java +--- openjdk.orig/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java ++++ openjdk/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java +@@ -309,47 +309,51 @@ + session = token.killSession(session); + return; + } +- // "cancel" operation by finishing it +- // XXX make sure all this always works correctly +- if (mode == M_SIGN) { +- try { +- if (type == T_UPDATE) { +- token.p11.C_SignFinal(session.id(), 0); +- } else { +- byte[] digest; +- if (type == T_DIGEST) { +- digest = md.digest(); +- } else { // T_RAW +- digest = buffer; ++ try { ++ // "cancel" operation by finishing it ++ // XXX make sure all this always works correctly ++ if (mode == M_SIGN) { ++ try { ++ if (type == T_UPDATE) { ++ token.p11.C_SignFinal(session.id(), 0); ++ } else { ++ byte[] digest; ++ if (type == T_DIGEST) { ++ digest = md.digest(); ++ } else { // T_RAW ++ digest = buffer; ++ } ++ token.p11.C_Sign(session.id(), digest); + } +- token.p11.C_Sign(session.id(), digest); ++ } catch (PKCS11Exception e) { ++ throw new ProviderException("cancel failed", e); + } +- } catch (PKCS11Exception e) { +- throw new ProviderException("cancel failed", e); ++ } else { // M_VERIFY ++ try { ++ byte[] signature; ++ if (keyAlgorithm.equals("DSA")) { ++ signature = new byte[40]; ++ } else { ++ signature = new byte[(p11Key.length() + 7) >> 3]; ++ } ++ if (type == T_UPDATE) { ++ token.p11.C_VerifyFinal(session.id(), signature); ++ } else { ++ byte[] digest; ++ if (type == T_DIGEST) { ++ digest = md.digest(); ++ } else { // T_RAW ++ digest = buffer; ++ } ++ token.p11.C_Verify(session.id(), digest, signature); ++ } ++ } catch (PKCS11Exception e) { ++ // will fail since the signature is incorrect ++ // XXX check error code ++ } + } +- } else { // M_VERIFY +- try { +- byte[] signature; +- if (keyAlgorithm.equals("DSA")) { +- signature = new byte[40]; +- } else { +- signature = new byte[(p11Key.length() + 7) >> 3]; +- } +- if (type == T_UPDATE) { +- token.p11.C_VerifyFinal(session.id(), signature); +- } else { +- byte[] digest; +- if (type == T_DIGEST) { +- digest = md.digest(); +- } else { // T_RAW +- digest = buffer; +- } +- token.p11.C_Verify(session.id(), digest, signature); +- } +- } catch (PKCS11Exception e) { +- // will fail since the signature is incorrect +- // XXX check error code +- } ++ } finally { ++ session = token.releaseSession(session); + } + } + +@@ -368,6 +372,8 @@ + } + initialized = true; + } catch (PKCS11Exception e) { ++ // release session when initialization failed ++ session = token.releaseSession(session); + throw new ProviderException("Initialization failed", e); + } + if (bytesProcessed != 0) { +@@ -529,6 +535,8 @@ + } + bytesProcessed += len; + } catch (PKCS11Exception e) { ++ initialized = false; ++ session = token.releaseSession(session); + throw new ProviderException(e); + } + break; +@@ -576,6 +584,8 @@ + bytesProcessed += len; + byteBuffer.position(ofs + len); + } catch (PKCS11Exception e) { ++ initialized = false; ++ session = token.releaseSession(session); + throw new ProviderException("Update failed", e); + } + break; diff --git a/8206406-pr3610-rh1597825.patch b/8206406-pr3610-rh1597825.patch new file mode 100644 index 0000000..0f38126 --- /dev/null +++ b/8206406-pr3610-rh1597825.patch @@ -0,0 +1,65 @@ +# HG changeset patch +# User aph +# Date 1531146945 -3600 +# Mon Jul 09 15:35:45 2018 +0100 +# Node ID 95b72537801cc9946c27ad27f07e3f0790a21b08 +# Parent f6341f4635dacb56678264d29a88cd052b74036b +8206406, PR3610, RH1597825: StubCodeDesc constructor publishes partially-constructed objects on StubCodeDesc::_list +Reviewed-by: dholmes + +diff --git openjdk.orig/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp openjdk/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp ++++ openjdk/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp +@@ -34,12 +34,12 @@ + + // Implementation of StubCodeDesc + +-StubCodeDesc* StubCodeDesc::_list = NULL; +-int StubCodeDesc::_count = 0; ++StubCodeDesc* volatile StubCodeDesc::_list = NULL; ++int StubCodeDesc::_count = 0; + + + StubCodeDesc* StubCodeDesc::desc_for(address pc) { +- StubCodeDesc* p = _list; ++ StubCodeDesc* p = (StubCodeDesc*)OrderAccess::load_ptr_acquire(&_list); + while (p != NULL && !p->contains(pc)) p = p->_next; + // p == NULL || p->contains(pc) + return p; +@@ -47,7 +47,7 @@ + + + StubCodeDesc* StubCodeDesc::desc_for_index(int index) { +- StubCodeDesc* p = _list; ++ StubCodeDesc* p = (StubCodeDesc*)OrderAccess::load_ptr_acquire(&_list); + while (p != NULL && p->index() != index) p = p->_next; + return p; + } +diff --git openjdk.orig/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp openjdk/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp +--- openjdk.orig/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp ++++ openjdk/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp +@@ -38,7 +38,7 @@ + + class StubCodeDesc: public CHeapObj { + protected: +- static StubCodeDesc* _list; // the list of all descriptors ++ static StubCodeDesc* volatile _list; // the list of all descriptors + static int _count; // length of list + + StubCodeDesc* _next; // the next element in the linked list +@@ -69,13 +69,13 @@ + + StubCodeDesc(const char* group, const char* name, address begin) { + assert(name != NULL, "no name specified"); +- _next = _list; ++ _next = (StubCodeDesc*)OrderAccess::load_ptr_acquire(&_list); + _group = group; + _name = name; + _index = ++_count; // (never zero) + _begin = begin; + _end = NULL; +- _list = this; ++ OrderAccess::release_store_ptr(&_list, this); + }; + + const char* group() const { return _group; } diff --git a/8206425-hotspot-remove-debuglink.patch b/8206425-hotspot-remove-debuglink.patch new file mode 100644 index 0000000..adbf1f0 --- /dev/null +++ b/8206425-hotspot-remove-debuglink.patch @@ -0,0 +1,73 @@ +# HG changeset patch +# User sgehwolf +# Date 1530808022 -7200 +# Thu Jul 05 18:27:02 2018 +0200 +# Node ID 5ba59d58d976db456c4455640111e8107b8d80e8 +# Parent ad057f2e3211cd18bc56550d8a2c400d92ec35b1 +8206425: .gnu_debuglink sections added unconditionally when no debuginfo is stripped +Summary: Only add .gnu_debuglink sections when there is some stripping done. +Reviewed-by: erikj, dholmes + +diff --git openjdk.orig/hotspot/make/linux/makefiles/jsig.make openjdk/hotspot/make/linux/makefiles/jsig.make +--- openjdk.orig/hotspot/make/linux/makefiles/jsig.make ++++ openjdk/hotspot/make/linux/makefiles/jsig.make +@@ -57,14 +57,15 @@ + $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $< -ldl + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) ++ ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ +- ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) ++ $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ + $(QUIETLY) $(STRIP) -g $@ ++ endif + # implied else here is no stripping at all +- endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) +diff --git openjdk.orig/hotspot/make/linux/makefiles/saproc.make openjdk/hotspot/make/linux/makefiles/saproc.make +--- openjdk.orig/hotspot/make/linux/makefiles/saproc.make ++++ openjdk/hotspot/make/linux/makefiles/saproc.make +@@ -100,14 +100,15 @@ + -lthread_db + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) ++ ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ +- ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) ++ $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ + $(QUIETLY) $(STRIP) -g $@ ++ endif + # implied else here is no stripping at all +- endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) +diff --git openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make +--- openjdk.orig/hotspot/make/linux/makefiles/vm.make ++++ openjdk/hotspot/make/linux/makefiles/vm.make +@@ -358,14 +358,15 @@ + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO) ++ ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ +- ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) ++ $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ + $(QUIETLY) $(STRIP) -g $@ ++ endif + # implied else here is no stripping at all +- endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) diff --git a/8207057-pr3613-hotspot-assembler-debuginfo.patch b/8207057-pr3613-hotspot-assembler-debuginfo.patch new file mode 100644 index 0000000..61f493d --- /dev/null +++ b/8207057-pr3613-hotspot-assembler-debuginfo.patch @@ -0,0 +1,27 @@ +Make the assembler generate whatever debuginfo it can +--- openjdk/hotspot/make/linux/makefiles/rules.make ++++ openjdk/hotspot/make/linux/makefiles/rules.make +@@ -34,7 +34,7 @@ + CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS) + CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS) + +-AS.S = $(AS) $(ASFLAGS) ++AS.S = $(AS) -g $(ASFLAGS) + + COMPILE.CC = $(CC_COMPILE) -c + GENASM.CC = $(CC_COMPILE) -S +@@ -161,12 +161,12 @@ + %.o: %.s + @echo Assembling $< + $(QUIETLY) $(REMOVE_TARGET) +- $(QUIETLY) $(AS.S) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) ++ $(QUIETLY) $(AS.S) -g $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) + + %.o: %.S + @echo Assembling $< + $(QUIETLY) $(REMOVE_TARGET) +- $(COMPILE.CC) -o $@ $< $(COMPILE_DONE) ++ $(COMPILE.CC) -g -o $@ $< $(COMPILE_DONE) + + %.s: %.cpp + @echo Generating assembly for $< diff --git a/8207234-dont-add-unnecessary-debug-links.patch b/8207234-dont-add-unnecessary-debug-links.patch new file mode 100644 index 0000000..9c29e6b --- /dev/null +++ b/8207234-dont-add-unnecessary-debug-links.patch @@ -0,0 +1,77 @@ +--- openjdk/make/common/NativeCompilation.gmk ++++ openjdk/make/common/NativeCompilation.gmk +@@ -437,29 +437,6 @@ + + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows +- ifeq ($(OPENJDK_TARGET_OS), solaris) +- # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. +- # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from +- # empty section headers until a fixed $(OBJCOPY) is available. +- # An empty section header has sh_addr == 0 and sh_size == 0. +- # This problem has only been seen on Solaris X64, but we call this tool +- # on all Solaris builds just in case. +- # +- # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. +- # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. +- $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \ +- $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) +- $(RM) $$@ +- $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< +- $(OBJCOPY) --only-keep-debug $$< $$@ +- $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< +- else # not solaris +- $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) +- $(RM) $$@ +- $(OBJCOPY) --only-keep-debug $$< $$@ +- $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< +- endif # Touch to not retrigger rule on rebuild +- $(TOUCH) $$@ + endif # !windows + endif # !macosx + +@@ -483,7 +460,6 @@ + $1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \ + $$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files +- $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo + endif + endif + endif +@@ -522,28 +498,8 @@ + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows + ifeq ($(OPENJDK_TARGET_OS), solaris) +- # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. +- # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from +- # empty section headers until a fixed $(OBJCOPY) is available. +- # An empty section header has sh_addr == 0 and sh_size == 0. +- # This problem has only been seen on Solaris X64, but we call this tool +- # on all Solaris builds just in case. +- # +- # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. +- # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. +- $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \ +- $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) +- $(RM) $$@ +- $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< +- $(OBJCOPY) --only-keep-debug $$< $$@ +- $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< + else # not solaris +- $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) +- $(RM) $$@ +- $(OBJCOPY) --only-keep-debug $$< $$@ +- $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< + endif +- $(TOUCH) $$@ + endif # !windows + endif # !macosx + +@@ -567,7 +523,6 @@ + $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \ + $$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files +- $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo + endif + endif + endif diff --git a/always_assumemp.patch b/always_assumemp.patch new file mode 100644 index 0000000..b0a874d --- /dev/null +++ b/always_assumemp.patch @@ -0,0 +1,12 @@ +diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp +--- openjdk/hotspot/src/share/vm/runtime/globals.hpp ++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp +@@ -530,7 +530,7 @@ + lp64_product(intx, ObjectAlignmentInBytes, 8, \ + "Default object alignment in bytes, 8 is minimum") \ + \ +- product(bool, AssumeMP, false, \ ++ product(bool, AssumeMP, true, \ + "Instruct the VM to assume multiple processors are available") \ + \ + /* UseMembar is theoretically a temp flag used for memory barrier \ diff --git a/java-1.8.0-openjdk-remove-intree-libraries.sh b/java-1.8.0-openjdk-remove-intree-libraries.sh old mode 100644 new mode 100755 index 1f022f6..201a220 --- a/java-1.8.0-openjdk-remove-intree-libraries.sh +++ b/java-1.8.0-openjdk-remove-intree-libraries.sh @@ -1,10 +1,10 @@ #!/bin/sh -ZIP_SRC=jdk8/jdk/src/share/native/java/util/zip/zlib-* -JPEG_SRC=jdk8/jdk/src/share/native/sun/awt/image/jpeg -GIF_SRC=jdk8/jdk/src/share/native/sun/awt/giflib -PNG_SRC=jdk8/jdk/src/share/native/sun/awt/libpng -LCMS_SRC=jdk8/jdk/src/share/native/sun/java2d/cmm/lcms +ZIP_SRC=openjdk/jdk/src/share/native/java/util/zip/zlib +JPEG_SRC=openjdk/jdk/src/share/native/sun/awt/image/jpeg +GIF_SRC=openjdk/jdk/src/share/native/sun/awt/giflib +PNG_SRC=openjdk/jdk/src/share/native/sun/awt/libpng +LCMS_SRC=openjdk/jdk/src/share/native/sun/java2d/cmm/lcms echo "Removing built-in libs (they will be linked)" @@ -99,6 +99,7 @@ if [ ! -d ${LCMS_SRC} ]; then fi # temporary change to move bundled LCMS if [ ! true ]; then +rm -vf ${LCMS_SRC}/cmsalpha.c rm -vf ${LCMS_SRC}/cmscam02.c rm -vf ${LCMS_SRC}/cmscgats.c rm -vf ${LCMS_SRC}/cmscnvrt.c diff --git a/java-1.8.0-openjdk-rh1191652-root.patch b/java-1.8.0-openjdk-rh1191652-root.patch index aa0ce35..46a9c6f 100644 --- a/java-1.8.0-openjdk-rh1191652-root.patch +++ b/java-1.8.0-openjdk-rh1191652-root.patch @@ -1,6 +1,6 @@ -diff -r 59d5dc6a0d95 common/autoconf/hotspot-spec.gmk.in ---- openjdk///common/autoconf/hotspot-spec.gmk.in Wed May 25 13:42:38 2016 +0100 -+++ openjdk///common/autoconf/hotspot-spec.gmk.in Thu May 26 04:43:57 2016 +0100 +diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in +--- openjdk///common/autoconf/hotspot-spec.gmk.in ++++ openjdk///common/autoconf/hotspot-spec.gmk.in @@ -71,6 +71,10 @@ LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB) # Set the cpu architecture @@ -12,9 +12,9 @@ diff -r 59d5dc6a0d95 common/autoconf/hotspot-spec.gmk.in # Legacy setting for building for a 64 bit machine. # If yes then this expands to _LP64:=1 @LP64@ -diff -r 59d5dc6a0d95 common/autoconf/jdk-options.m4 ---- openjdk///common/autoconf/jdk-options.m4 Wed May 25 13:42:38 2016 +0100 -+++ openjdk///common/autoconf/jdk-options.m4 Thu May 26 04:43:57 2016 +0100 +diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 +--- openjdk///common/autoconf/jdk-options.m4 ++++ openjdk///common/autoconf/jdk-options.m4 @@ -158,7 +158,7 @@ if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then INCLUDE_SA=false @@ -24,9 +24,9 @@ diff -r 59d5dc6a0d95 common/autoconf/jdk-options.m4 INCLUDE_SA=false fi if test "x$OPENJDK_TARGET_CPU" = xaarch64; then -diff -r 59d5dc6a0d95 common/autoconf/platform.m4 ---- openjdk///common/autoconf/platform.m4 Wed May 25 13:42:38 2016 +0100 -+++ openjdk///common/autoconf/platform.m4 Thu May 26 04:43:57 2016 +0100 +diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 +--- openjdk///common/autoconf/platform.m4 ++++ openjdk///common/autoconf/platform.m4 @@ -67,7 +67,7 @@ VAR_CPU_ENDIAN=big ;; @@ -36,16 +36,16 @@ diff -r 59d5dc6a0d95 common/autoconf/platform.m4 VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=little -diff -r 59d5dc6a0d95 common/autoconf/toolchain.m4 ---- openjdk///common/autoconf/toolchain.m4 Wed May 25 13:42:38 2016 +0100 -+++ openjdk///common/autoconf/toolchain.m4 Thu May 26 04:43:57 2016 +0100 -@@ -1056,6 +1056,9 @@ +diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 +--- openjdk///common/autoconf/toolchain.m4 ++++ openjdk///common/autoconf/toolchain.m4 +@@ -1123,6 +1123,9 @@ else - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN" + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN" fi + if test "x$OPENJDK_TARGET_CPU" = xppc64le; then -+ CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DABI_ELFv2" ++ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DABI_ELFv2" + fi if test "x$OPENJDK_TARGET_OS" = xlinux; then - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX" + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DLINUX" fi diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 0506f9c..a4008d3 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -29,7 +29,7 @@ %global include_debug_build 0 %endif -# on intels, we build shenandoah htspot +# On x86_64, we use the Shenandoah HotSpot %ifarch x86_64 %global use_shenandoah_hotspot 1 %else @@ -101,51 +101,87 @@ %global __noautoprov ^(%{_privatelibs})$ %global __noautoreq ^(%{_privatelibs})$ +# In some cases, the arch used by the JDK does +# not match _arch. +# Also, in some cases, the machine name used by SystemTap +# does not match that given by _build_cpu %ifarch x86_64 %global archinstall amd64 +%global stapinstall x86_64 %endif %ifarch ppc %global archinstall ppc +%global stapinstall powerpc %endif %ifarch %{ppc64be} %global archinstall ppc64 +%global stapinstall powerpc %endif %ifarch %{ppc64le} %global archinstall ppc64le +%global stapinstall powerpc %endif %ifarch %{ix86} %global archinstall i386 +%global stapinstall i386 %endif %ifarch ia64 %global archinstall ia64 +%global stapinstall ia64 %endif %ifarch s390 %global archinstall s390 +%global stapinstall s390 %endif %ifarch s390x %global archinstall s390x +%global stapinstall s390 %endif %ifarch %{arm} %global archinstall arm +%global stapinstall arm %endif %ifarch %{aarch64} %global archinstall aarch64 +%global stapinstall arm64 %endif # 32 bit sparc, optimized for v9 %ifarch sparcv9 %global archinstall sparc +%global stapinstall %{_build_cpu} %endif # 64 bit sparc %ifarch sparc64 %global archinstall sparcv9 +%global stapinstall %{_build_cpu} %endif %ifnarch %{jit_arches} %global archinstall %{_arch} %endif - %{?build_systap}%{?!build_systap:%bcond_without systap} +%ifarch %{ix86} x86_64 +# disable in ROSA, to be packaged separately +%global with_openjfx_binding 0 +%global openjfx_path %{_jvmdir}/openjfx +# links src directories +%global jfx_jre_libs_dir %{openjfx_path}/rt/lib +%global jfx_jre_native_dir %{jfx_jre_libs_dir}/%{archinstall} +%global jfx_sdk_libs_dir %{openjfx_path}/lib +%global jfx_sdk_bins_dir %{openjfx_path}/bin +%global jfx_jre_exts_dir %{jfx_jre_libs_dir}/ext +# links src files +# maybe depend on jfx and generate the lists in build time? Yes, bad idea to inlcude cyclic depndenci, but this list is aweful +%global jfx_jre_libs jfxswt.jar javafx.properties +%global jfx_jre_native libprism_es2.so libprism_common.so libjavafx_font.so libdecora_sse.so libjavafx_font_freetype.so libprism_sw.so libjavafx_font_pango.so libglass.so libjavafx_iio.so +%global jfx_sdk_libs javafx-mx.jar packager.jar ant-javafx.jar +%global jfx_sdk_bins javafxpackager javapackager +%global jfx_jre_exts jfxrt.jar +%else +%global with_openjfx_binding 0 +%endif + # Convert an absolute path to a relative path. Each symbolic link is # specified relative to the directory in which it is installed so that # it will resolve properly within chrooted installations. @@ -158,7 +194,7 @@ # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. %global project aarch64-port %global repo jdk8u -%global revision aarch64-jdk8u131-b12 +%global revision aarch64-jdk8u181-b13 # eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) %global whole_update %(VERSION=%{revision}; echo ${VERSION%%-*}) # eg jdk8u60 -> 60 or aarch64-jdk8u60 -> 60 @@ -173,17 +209,17 @@ # parametrized macros are order-sensitive %global fullversion %{name}-%{version}-%{release} #images stub -%global j2sdkimage() j2sdk-image +%global j2sdkimage j2sdk-image # output dir stub -%global buildoutputdir() %{expand:openjdk/build/jdk8.build%1} +%global buildoutputdir() %{expand:openjdk/build/jdk8.build%{?1}} #we can copy the javadoc to not arched dir, or made it not noarch -%global uniquejavadocdir() %{expand:%{fullversion}%1} +%global uniquejavadocdir() %{expand:%{fullversion}%{?1}} #main id and dir of this jdk -%global uniquesuffix() %{expand:%{fullversion}.%{_arch}%1} +%global uniquesuffix() %{expand:%{fullversion}.%{_arch}%{?1}} # Standard JPackage directories and symbolic links. %global sdkdir() %{expand:%{uniquesuffix %%1}} -%global jrelnk() %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%1} +%global jrelnk() %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%{?1}} %global jredir() %{expand:%{sdkdir %%1}/jre} %global sdkbindir() %{expand:%{_jvmdir}/%{sdkdir %%1}/bin} @@ -202,7 +238,7 @@ # for the primary arch for now). Systemtap uses the machine name # aka build_cpu as architecture specific directory name. %global tapsetroot /usr/share/systemtap -%global tapsetdir %{tapsetroot}/tapset/%{_build_cpu} +%global tapsetdir %{tapsetroot}/tapset/%{stapinstall} %endif # not-duplicated scriplets for normal/debug packages @@ -241,7 +277,6 @@ if [ "$1" -gt 1 ]; then fi fi fi - %ifarch %{jit_arches} # MetaspaceShared::generate_vtable_methods not implemented for PPC JIT %ifnarch %{power64} @@ -251,13 +286,13 @@ fi %endif PRIORITY=%{priority} -if [ "%1" == %{debug_suffix} ]; then +if [ "%{?1}" == %{debug_suffix} ]; then let PRIORITY=PRIORITY-1 fi ext=%{_extension} alternatives \\ - --install %{_bindir}/java java %{jrebindir %%1}/java $PRIORITY \\ + --install %{_bindir}/java java %{jrebindir %%1}/java $PRIORITY \\ --slave %{_jvmdir}/jre jre %{_jvmdir}/%{jredir %%1} \\ --slave %{_jvmjardir}/jre jre_exports %{_jvmjardir}/%{jrelnk %%1} \\ --slave %{_bindir}/jjs jjs %{jrebindir %%1}/jjs \\ @@ -306,6 +341,15 @@ update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver} update-desktop-database %{_datadir}/applications &> /dev/null || : /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +# see pretrans where this file is declared +# also see that pretrans is only for nondebug +if [ ! "%{?1}" == %{debug_suffix} ]; then + if [ -f %{_libexecdir}/copy_jdk_configs_fixFiles.sh ] ; then + sh %{_libexecdir}/copy_jdk_configs_fixFiles.sh %{rpm_state_dir}/%{name}.%{_arch} %{_jvmdir}/%{sdkdir %{?1}} + fi +fi + exit 0 } @@ -333,7 +377,7 @@ exit 0 %global post_devel() %{expand: PRIORITY=%{priority} -if [ "%1" == %{debug_suffix} ]; then +if [ "%{?1}" == %{debug_suffix} ]; then let PRIORITY=PRIORITY-1 fi @@ -468,7 +512,7 @@ exit 0 %global post_javadoc() %{expand: PRIORITY=%{priority} -if [ "%1" == %{debug_suffix} ]; then +if [ "%{?1}" == %{debug_suffix} ]; then let PRIORITY=PRIORITY-1 fi @@ -486,63 +530,160 @@ exit 0 %global post_javadoc_zip() %{expand: PRIORITY=%{priority} -if [ "%1" == %{debug_suffix} ]; then +if [ "%{?1}" == %{debug_suffix} ]; then let PRIORITY=PRIORITY-1 fi alternatives \\ --install %{_javadocdir}/java-zip javadoczip %{_javadocdir}/%{uniquejavadocdir %%1}.zip \\ - $PRIORITY + $PRIORITY exit 0 } -%global postun_javadoc_zip() %{expand: +%define postun_javadoc_zip() %{expand: alternatives --remove javadoczip %{_javadocdir}/%{uniquejavadocdir %%1}.zip exit 0 } -%global files_jre() %{expand: +%define files_jre() %{expand: %{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}.png -%{_datadir}/applications/*policytool%1.desktop +%{_datadir}/applications/*policytool%{?1}.desktop +%{_jvmdir}/%{sdkdir %{?1}}/jre/lib/%{archinstall}/libjsoundalsa.so +%{_jvmdir}/%{sdkdir %{?1}}/jre/lib/%{archinstall}/libsplashscreen.so +%{_jvmdir}/%{sdkdir %{?1}}/jre/lib/%{archinstall}/libawt_xawt.so +%{_jvmdir}/%{sdkdir %{?1}}/jre/lib/%{archinstall}/libjawt.so +%{_jvmdir}/%{sdkdir %{?1}}/jre/bin/policytool } -%global files_jre_headless() %{expand: -%defattr(-,root,root,-) -%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/ASSEMBLY_EXCEPTION -%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE -%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/THIRD_PARTY_README -%dir %{_jvmdir}/%{sdkdir %%1} -%{_jvmdir}/%{jrelnk %%1} -%{_jvmjardir}/%{jrelnk %%1} +%define files_jre_headless() %{expand: +%doc %{buildoutputdir %{?1}}/images/%{j2sdkimage}/jre/ASSEMBLY_EXCEPTION +%doc %{buildoutputdir %{?1}}/images/%{j2sdkimage}/jre/LICENSE +%doc %{buildoutputdir %{?1}}/images/%{j2sdkimage}/jre/THIRD_PARTY_README +%dir %{_jvmdir}/%{sdkdir %{?1}} +%{_jvmdir}/%{jrelnk %{?1}} +%{_jvmjardir}/%{jrelnk %{?1}} +%{jvmjardir %{?1}} %{_jvmprivdir}/* -%{jvmjardir %%1} -%dir %{_jvmdir}/%{jredir %%1}/lib/security -%{_jvmdir}/%{jredir %%1}/lib/security/cacerts -%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/US_export_policy.jar -%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/local_policy.jar -%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.policy -%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.security -%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/blacklisted.certs -%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/logging.properties -%{_mandir}/man1/java-%{uniquesuffix %%1}.1* -%{_mandir}/man1/jjs-%{uniquesuffix %%1}.1* -%{_mandir}/man1/keytool-%{uniquesuffix %%1}.1* -%{_mandir}/man1/orbd-%{uniquesuffix %%1}.1* -%{_mandir}/man1/pack200-%{uniquesuffix %%1}.1* -%{_mandir}/man1/rmid-%{uniquesuffix %%1}.1* -%{_mandir}/man1/rmiregistry-%{uniquesuffix %%1}.1* -%{_mandir}/man1/servertool-%{uniquesuffix %%1}.1* -%{_mandir}/man1/tnameserv-%{uniquesuffix %%1}.1* -%{_mandir}/man1/unpack200-%{uniquesuffix %%1}.1* -%{_mandir}/man1/policytool-%{uniquesuffix %%1}.1* -%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/nss.cfg -%{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/server/ -%{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/client/ +%dir %{_jvmdir}/%{jredir %{?1}}/lib/security +%{_jvmdir}/%{jredir %{?1}}/lib/security/cacerts +%dir %{_jvmdir}/%{jredir %{?1}} +%dir %{_jvmdir}/%{jredir %{?1}}/bin +%dir %{_jvmdir}/%{jredir %{?1}}/lib +%{_jvmdir}/%{jredir %{?1}}/bin/java +%{_jvmdir}/%{jredir %{?1}}/bin/jjs +%{_jvmdir}/%{jredir %{?1}}/bin/keytool +%{_jvmdir}/%{jredir %{?1}}/bin/orbd +%{_jvmdir}/%{jredir %{?1}}/bin/pack200 +%{_jvmdir}/%{jredir %{?1}}/bin/rmid +%{_jvmdir}/%{jredir %{?1}}/bin/rmiregistry +%{_jvmdir}/%{jredir %{?1}}/bin/servertool +%{_jvmdir}/%{jredir %{?1}}/bin/tnameserv +%{_jvmdir}/%{jredir %{?1}}/bin/unpack200 +%dir %{_jvmdir}/%{jredir %{?1}}/lib/security/policy/unlimited/ +%dir %{_jvmdir}/%{jredir %{?1}}/lib/security/policy/limited/ +%dir %{_jvmdir}/%{jredir %{?1}}/lib/security/policy/ +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/security/policy/unlimited/US_export_policy.jar +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/security/policy/unlimited/local_policy.jar +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/security/policy/limited/US_export_policy.jar +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/security/policy/limited/local_policy.jar +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/security/java.policy +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/security/java.security +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/security/blacklisted.certs +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/logging.properties +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/calendars.properties +%{_mandir}/man1/java-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/jjs-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/keytool-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/orbd-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/pack200-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/rmid-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/rmiregistry-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/servertool-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/tnameserv-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/unpack200-%{uniquesuffix %{?1}}.1* +%{_mandir}/man1/policytool-%{uniquesuffix %{?1}}.1* +%config(noreplace) %{_jvmdir}/%{jredir %{?1}}/lib/security/nss.cfg +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/server/ +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/client/ +%dir %{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall} +%dir %{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/jli +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/jli/libjli.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/jvm.cfg +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libattach.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libawt.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libawt_headless.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libdt_socket.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libfontmanager.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libhprof.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libinstrument.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libj2gss.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libj2pcsc.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libj2pkcs11.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libjaas_unix.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libjava.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libjava_crw_demo.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libjavajpeg.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libjdwp.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libjsdt.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libjsig.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libjsound.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/liblcms.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libmanagement.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libmlib_image.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libnet.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libnio.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libnpt.so +%ifarch x86_64 %{ix86} %{aarch64} +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libsaproc.so +%endif +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libsctp.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libsunec.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libunpack.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libverify.so +%{_jvmdir}/%{jredir %{?1}}/lib/%{archinstall}/libzip.so +%{_jvmdir}/%{jredir %{?1}}/lib/charsets.jar +%{_jvmdir}/%{jredir %{?1}}/lib/classlist +%{_jvmdir}/%{jredir %{?1}}/lib/content-types.properties +%{_jvmdir}/%{jredir %{?1}}/lib/currency.data +%{_jvmdir}/%{jredir %{?1}}/lib/flavormap.properties +%{_jvmdir}/%{jredir %{?1}}/lib/hijrah-config-umalqura.properties +%{_jvmdir}/%{jredir %{?1}}/lib/images/cursors/* +%{_jvmdir}/%{jredir %{?1}}/lib/jce.jar +%{_jvmdir}/%{jredir %{?1}}/lib/jexec +%{_jvmdir}/%{jredir %{?1}}/lib/jsse.jar +%{_jvmdir}/%{jredir %{?1}}/lib/jvm.hprof.txt +%{_jvmdir}/%{jredir %{?1}}/lib/meta-index +%{_jvmdir}/%{jredir %{?1}}/lib/net.properties +%{_jvmdir}/%{jredir %{?1}}/lib/psfont.properties.ja +%{_jvmdir}/%{jredir %{?1}}/lib/psfontj2d.properties +%{_jvmdir}/%{jredir %{?1}}/lib/resources.jar +%{_jvmdir}/%{jredir %{?1}}/lib/rt.jar +%{_jvmdir}/%{jredir %{?1}}/lib/sound.properties +%{_jvmdir}/%{jredir %{?1}}/lib/tzdb.dat +%{_jvmdir}/%{jredir %{?1}}/lib/management-agent.jar +%{_jvmdir}/%{jredir %{?1}}/lib/management/* +%{_jvmdir}/%{jredir %{?1}}/lib/cmm/* +%{_jvmdir}/%{jredir %{?1}}/lib/ext/cldrdata.jar +%{_jvmdir}/%{jredir %{?1}}/lib/ext/dnsns.jar +%{_jvmdir}/%{jredir %{?1}}/lib/ext/jaccess.jar +%{_jvmdir}/%{jredir %{?1}}/lib/ext/localedata.jar +%{_jvmdir}/%{jredir %{?1}}/lib/ext/meta-index +%{_jvmdir}/%{jredir %{?1}}/lib/ext/nashorn.jar +%{_jvmdir}/%{jredir %{?1}}/lib/ext/sunec.jar +%{_jvmdir}/%{jredir %{?1}}/lib/ext/sunjce_provider.jar +%{_jvmdir}/%{jredir %{?1}}/lib/ext/sunpkcs11.jar +%{_jvmdir}/%{jredir %{?1}}/lib/ext/zipfs.jar + +%dir %{_jvmdir}/%{jredir %{?1}}/lib/images +%dir %{_jvmdir}/%{jredir %{?1}}/lib/images/cursors +%dir %{_jvmdir}/%{jredir %{?1}}/lib/management +%dir %{_jvmdir}/%{jredir %{?1}}/lib/cmm +%dir %{_jvmdir}/%{jredir %{?1}}/lib/ext } -%global files_devel() %{expand: -%defattr(-,root,root,-) + +%define files_devel() %{expand: %doc %{buildoutputdir %%1}/images/%{j2sdkimage}/ASSEMBLY_EXCEPTION %doc %{buildoutputdir %%1}/images/%{j2sdkimage}/LICENSE %doc %{buildoutputdir %%1}/images/%{j2sdkimage}/THIRD_PARTY_README @@ -592,37 +733,33 @@ exit 0 %endif } -%global files_demo() %{expand: -%defattr(-,root,root,-) +%define files_demo() %{expand: %doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE } -%global files_src() %{expand: -%defattr(-,root,root,-) +%define files_src() %{expand: %doc README.src %{_jvmdir}/%{sdkdir %%1}/src.zip } -%global files_javadoc() %{expand: -%defattr(-,root,root,-) +%define files_javadoc() %{expand: %doc %{_javadocdir}/%{uniquejavadocdir %%1} %doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE } -%global files_javadoc_zip() %{expand: -%defattr(-,root,root,-) +%define files_javadoc_zip() %{expand: %doc %{_javadocdir}/%{uniquejavadocdir %%1}.zip %doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE } -%global files_accessibility() %{expand: +%define files_accessibility() %{expand: %{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/libatk-wrapper.so %{_jvmdir}/%{jredir %%1}/lib/ext/java-atk-wrapper.jar %{_jvmdir}/%{jredir %%1}/lib/accessibility.properties } # not-duplicated requires/provides/obsolate for normal/debug packages -%global java_rpo() %{expand: +%define java_rpo() %{expand: Requires: fontconfig Requires: x11-font-type1 @@ -632,17 +769,17 @@ Requires: %{name}-headless%1 = %{epoch}:%{version}-%{release} # Standard JPackage base provides. -Provides: jre-%{javaver}-%{origin}%1 = %{epoch}:%{version}-%{release} -Provides: jre-%{origin}%1 = %{epoch}:%{version}-%{release} -Provides: jre-%{javaver}%1 = %{epoch}:%{version}-%{release} -Provides: java-%{javaver}%1 = %{epoch}:%{version}-%{release} -Provides: jre = %{javaver}%1 -Provides: java-%{origin}%1 = %{epoch}:%{version}-%{release} -Provides: java%1 = %{epoch}:%{javaver} +Provides: jre-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{javaver}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}%{?1} = %{epoch}:%{version}-%{release} +Provides: jre = %{javaver}%{?1} +Provides: java-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java%{?1} = %{epoch}:%{javaver} # Standard JPackage extensions provides. -Provides: java-fonts%1 = %{epoch}:%{version} +Provides: java-fonts%{?1} = %{epoch}:%{version} -Obsoletes: java-1.7.0-openjdk%1 < %{EVRD} +Obsoletes: java-1.7.0-openjdk%{?1} < %{EVRD} } %global java_headless_rpo() %{expand: @@ -656,7 +793,7 @@ Requires: timezone-java >= 2015d # libsctp.so.1 is being `dlopen`ed on demand Requires: lksctp-tools # tool to copy jdk's configs - should be Recommends only, but then only dnf/yum eforce it, not rpm transaction and so no configs are persisted when pure rpm -u is run. I t may be consiedered as regression -Requires: copy-jdk-configs >= 1.1-1 +Requires: copy-jdk-configs >= 3.3 #OrderWithRequires: copy-jdk-configs # Post requires alternatives to install tool alternatives. Requires(post): update-alternatives @@ -664,31 +801,31 @@ Requires(post): update-alternatives Requires(postun): update-alternatives # Standard JPackage base provides. -Provides: jre-%{javaver}-%{origin}-headless%1 = %{epoch}:%{version}-%{release} -Provides: jre-%{origin}-headless%1 = %{epoch}:%{version}-%{release} -Provides: jre-%{javaver}-headless%1 = %{epoch}:%{version}-%{release} -Provides: java-%{javaver}-headless%1 = %{epoch}:%{version}-%{release} -Provides: jre-headless%1 = %{epoch}:%{javaver} -Provides: java-%{origin}-headless%1 = %{epoch}:%{version}-%{release} -Provides: java-headless%1 = %{epoch}:%{javaver} +Provides: jre-%{javaver}-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-headless%{?1} = %{epoch}:%{javaver} +Provides: java-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: java-headless%{?1} = %{epoch}:%{javaver} # Standard JPackage extensions provides. -Provides: jndi%1 = %{epoch}:%{version} -Provides: jndi-ldap%1 = %{epoch}:%{version} -Provides: jndi-cos%1 = %{epoch}:%{version} -Provides: jndi-rmi%1 = %{epoch}:%{version} -Provides: jndi-dns%1 = %{epoch}:%{version} -Provides: jaas%1 = %{epoch}:%{version} -Provides: jsse%1 = %{epoch}:%{version} -Provides: jce%1 = %{epoch}:%{version} -Provides: jdbc-stdext%1 = 4.1 -Provides: java-sasl%1 = %{epoch}:%{version} +Provides: jndi%{?1} = %{epoch}:%{version} +Provides: jndi-ldap%{?1} = %{epoch}:%{version} +Provides: jndi-cos%{?1} = %{epoch}:%{version} +Provides: jndi-rmi%{?1} = %{epoch}:%{version} +Provides: jndi-dns%{?1} = %{epoch}:%{version} +Provides: jaas%{?1} = %{epoch}:%{version} +Provides: jsse%{?1} = %{epoch}:%{version} +Provides: jce%{?1} = %{epoch}:%{version} +Provides: jdbc-stdext%{?1} = 4.1 +Provides: java-sasl%{?1} = %{epoch}:%{version} -Obsoletes: java-1.7.0-openjdk-headless%1 < %{EVRD} +Obsoletes: java-1.7.0-openjdk-headless%{?1} < %{EVRD} } %global java_devel_rpo() %{expand: # Require base package. -Requires: %{name}%1 = %{epoch}:%{version}-%{release} +Requires: %{name}%{?1} = %{epoch}:%{version}-%{release} #OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} # Post requires alternatives to install tool alternatives. Requires(post): update-alternatives @@ -696,23 +833,23 @@ Requires(post): update-alternatives Requires(postun): update-alternatives # Standard JPackage devel provides. -Provides: java-sdk-%{javaver}-%{origin}%1 = %{epoch}:%{version} -Provides: java-sdk-%{javaver}%1 = %{epoch}:%{version} -Provides: java-sdk-%{origin}%1 = %{epoch}:%{version} -Provides: java-sdk%1 = %{epoch}:%{javaver} -Provides: java-%{javaver}-devel%1 = %{epoch}:%{version} -Provides: java-devel-%{origin}%1 = %{epoch}:%{version} -Provides: java-devel%1 = %{epoch}:%{javaver} +Provides: java-sdk-%{javaver}-%{origin}%{?1} = %{epoch}:%{version} +Provides: java-sdk-%{javaver}%{?1} = %{epoch}:%{version} +Provides: java-sdk-%{origin}%{?1} = %{epoch}:%{version} +Provides: java-sdk%{?1} = %{epoch}:%{javaver} +Provides: java-%{javaver}-devel%{?1} = %{epoch}:%{version} +Provides: java-devel-%{origin}%{?1} = %{epoch}:%{version} +Provides: java-devel%{?1} = %{epoch}:%{javaver} -Obsoletes: java-1.7.0-openjdk-devel%1 < %{EVRD} +Obsoletes: java-1.7.0-openjdk-devel%{?1} < %{EVRD} } %global java_demo_rpo() %{expand: -Requires: %{name}%1 = %{epoch}:%{version}-%{release} +Requires: %{name}%{?1} = %{epoch}:%{version}-%{release} #OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} -Obsoletes: java-1.7.0-openjdk-demo%1 < %{EVRD} +Obsoletes: java-1.7.0-openjdk-demo%{?1} < %{EVRD} } %global java_javadoc_rpo() %{expand: @@ -723,25 +860,25 @@ Requires(post): update-alternatives Requires(postun): update-alternatives # Standard JPackage javadoc provides. -Provides: java-javadoc%1 = %{epoch}:%{version}-%{release} -Provides: java-%{javaver}-javadoc%1 = %{epoch}:%{version}-%{release} +Provides: java-javadoc%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-javadoc%{?1} = %{epoch}:%{version}-%{release} -Obsoletes: java-1.7.0-openjdk-javadoc%1 < %{EVRD} +Obsoletes: java-1.7.0-openjdk-javadoc%{?1} < %{EVRD} } %global java_src_rpo() %{expand: -Requires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +Requires: %{name}-headless%{?1} = %{epoch}:%{version}-%{release} -Obsoletes: java-1.7.0-openjdk-src%1 < %{EVRD} +Obsoletes: java-1.7.0-openjdk-src%{?1} < %{EVRD} } %global java_accessibility_rpo() %{expand: Requires: java-atk-wrapper -Requires: %{name}%1 = %{epoch}:%{version}-%{release} -#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +Requires: %{name}%{?1} = %{epoch}:%{version}-%{release} +#OrderWithRequires: %{name}-headless%{?1} = %{epoch}:%{version}-%{release} -Obsoletes: java-1.7.0-openjdk-accessibility%1 < %{EVRD} +Obsoletes: java-1.7.0-openjdk-accessibility%{?1} < %{EVRD} } # Prevent brp-java-repack-jars from being run. @@ -749,7 +886,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%1 < %{EVRD} Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever} -Release: 1.%{buildver}.4 +Release: 1.%{buildver}.5 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons, # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -773,27 +910,30 @@ URL: http://openjdk.java.net/ # where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} Source0: %{project}-%{repo}-%{revision}.tar.xz -# Additional source needed to build under Mageia -Source1: 9ae547861e9f.tar.bz2 +# Shenandoah HotSpot +Source1: aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u181-b13.tar.xz # Custom README for -src subpackage Source2: README.src -# Script to generate Source1 (requires mercurial) +# Script to generate Source4 (requires mercurial) Source3: mga-add-missing-files.sh +# Additional source needed to build under ROSA +Source4: ecd5644a5ebe.tar.bz2 + # Use 'generate_tarballs.sh' to generate the following tarballs # They are based on code contained in the IcedTea7 project. # Systemtap tapsets. Zipped up to keep it small. -Source8: systemtap-tapset-3.4.0pre01.tar.xz +Source8: systemtap-tapset-3.6.0pre02.tar.xz # Desktop files. Adapated from IcedTea. Source9: jconsole.desktop.in Source10: policytool.desktop.in # nss configuration file -Source11: nss.cfg +Source11: nss.cfg.in # Removed libraries that we link instead Source12: %{name}-remove-intree-libraries.sh @@ -809,8 +949,6 @@ Source20: repackReproduciblePolycies.sh # New versions of config files with aarch64 support. This is not upstream yet. Source100: config.guess Source101: config.sub -# shenandoah hotpost -Source999: aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u131-b12-shenandoah-merge-2017-04-20.tar.xz Source1000: %{name}.rpmlintrc @@ -840,12 +978,14 @@ Patch512: no_strict_overflow.patch # PR2815: Race condition in SunEC provider with system NSS # PR2899: Don't use WithSeed versions of NSS functions as they don't fully process the seed # PR2934: SunEC provider throwing KeyException with current NSS +# PR3479, RH1486025: ECC and NSS JVM crash Patch513: pr1983-jdk.patch Patch514: pr1983-root.patch Patch515: pr2127.patch Patch516: pr2815.patch Patch517: pr2899.patch Patch518: pr2934.patch +Patch519: pr3479-rh1486025.patch # S8150954, RH1176206, PR2866: Taking screenshots on x11 composite desktop produces wrong result # In progress: http://mail.openjdk.java.net/pipermail/awt-dev/2016-March/010742.html Patch508: rh1176206-jdk.patch @@ -854,17 +994,30 @@ Patch509: rh1176206-root.patch Patch523: pr2974-rh1337583.patch # PR3083, RH1346460: Regression in SSL debug output without an ECC provider Patch528: pr3083-rh1346460.patch +# RH1566890: CVE-2018-3639 +Patch529: rh1566890_embargoed20180521.patch +# PR3601: Fix additional -Wreturn-type issues introduced by 8061651 +Patch530: pr3601.patch +# 8196516, RH1538767: libfontmanager.so needs to be built with LDFLAGS so as to allow +# linking with unresolved symbols. +Patch531: rhbz_1538767_fix_linking.patch -# 8153711, PR3313, RH1284948: [REDO] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command -Patch535: 8153711-pr3313-rh1284948.patch +# Upstreamable debugging patches +# Patches 204 and 205 stop the build adding .gnu_debuglink sections to unstripped files +# 8207234: More libraries with .gnu_debuglink sections added unconditionally +Patch205: 8207234-dont-add-unnecessary-debug-links.patch # Arch-specific upstreamable patches -# PR2415: JVM -Xmx requirement is too high on s390 +# s390: PR2415: JVM -Xmx requirement is too high on s390 Patch100: %{name}-s390-java-opts.patch -# Type fixing for s390 +# s390: Type fixing for s390 Patch102: %{name}-size_t.patch -# Use "%z" for size_t on s390 as size_t != intptr_t -Patch103: s390-size_t_format_flags.patch +# s390: PR3593: Use "%z" for size_t on s390 as size_t != intptr_t +Patch103: pr3593-s390-size_t_format_flags.patch +# x86: S8199936, PR3533: HotSpot generates code with unaligned stack, crashes on SSE operations (-mstackrealign workaround) +Patch105: 8199936-pr3533-workaround.patch +# AArch64: PR3519: Fix further functions with a missing return value (AArch64) +Patch106: pr3519.patch # Patches which need backporting to 8u # S8073139, RH1191652; fix name of ppc64le architecture @@ -877,49 +1030,89 @@ Patch7: include-all-srcs.patch Patch202: system-libpng.patch # 8042159: Allow using a system-installed lcms2 Patch203: system-lcms.patch -# PR2462: Backport "8074839: Resolve disabled warnings for libunpack and the unpack200 binary" +# S8074839, PR2462: Resolve disabled warnings for libunpack and the unpack200 binary # This fixes printf warnings that lead to build failure with -Werror=format-security from optflags Patch502: pr2462.patch -# S8148351, PR2842: Only display resolved symlink for compiler, do not change path -Patch506: pr2842-01.patch -Patch507: pr2842-02.patch # S8154313: Generated javadoc scattered all over the place Patch400: 8154313.patch +# 8197429, PR3546, RH153662{2,3}: 32 bit java app started via JNI crashes with larger stack sizes +Patch561: 8197429-pr3546-rh1536622.patch +# 8171000, PR3542, RH1402819: Robot.createScreenCapture() crashes in wayland mode +Patch563: 8171000-pr3542-rh1402819.patch +# 8197546, PR3542, RH1402819: Fix for 8171000 breaks Solaris + Linux builds +Patch564: 8197546-pr3542-rh1402819.patch +# PR3559: Use ldrexd for atomic reads on ARMv7. +Patch567: pr3559.patch +# PR3591: Fix for bug 3533 doesn't add -mstackrealign to JDK code +Patch571: pr3591.patch +# 8184309, PR3596: Build warnings from GCC 7.1 on Fedora 26 +Patch572: 8184309-pr3596.patch +# 8141570, PR3548: Fix Zero interpreter build for --disable-precompiled-headers +Patch573: 8141570-pr3548.patch +# 8143245, PR3548: Zero build requires disabled warnings +Patch574: 8143245-pr3548.patch +# 8197981, PR3548: Missing return statement in __sync_val_compare_and_swap_8 +Patch575: 8197981-pr3548.patch +# 8064786, PR3599: Fix debug build after 8062808: Turn on the -Wreturn-type warning +Patch576: 8064786-pr3599.patch +# 8062808, PR3548: Turn on the -Wreturn-type warning +Patch577: 8062808-pr3548.patch +# 8207057, PR3613: Enable debug information for assembly code files +Patch206: 8207057-pr3613-hotspot-assembler-debuginfo.patch + +# Patches appearing in 8u192 +# S8031668, PR2842: TOOLCHAIN_FIND_COMPILER unexpectedly resolves symbolic links +Patch506: pr2842-01.patch +# S8148351, PR2842: Only display resolved symlink for compiler, do not change path +Patch507: pr2842-02.patch # S6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate Patch526: 6260348-pr3066.patch -# S8162384, PR3122, RH1358661: Performance regression: bimorphic inlining may be bypassed by type speculation # 8061305, PR3335, RH1423421: Javadoc crashes when method name ends with "Property" Patch538: 8061305-pr3335-rh1423421.patch -Patch532: 8162384-pr3122-rh1358661.patch -# RH1367357: lcms2: Out-of-bounds read in Type_MLU_Read() -Patch533: rh1367357.patch -# 8174164, PR3334, RH1417266: SafePointNode::_replaced_nodes breaks with irreducible loops" -Patch537: 8174164-pr3334-rh1417266.patch -# 6515172, PR3346: Runtime.availableProcessors() ignores Linux taskset command -Patch542: 6515172-pr3346.patch -# 8144566, PR3352: Custom HostnameVerifier disables SNI extension -Patch544: 8144566-pr3352.patch -# 8165231, RH1437545: java.nio.Bits.unaligned() doesn't return true on ppc -Patch546: 8165231-rh1437545.patch -# 8173941, PR3326: SA does not work if executable is DSO -Patch547: 8173941-pr3326.patch -# 8174729, PR3336, RH1420518: Race Condition in java.lang.reflect.WeakCache -Patch548: 8174729-pr3336-rh1420518.patch -# 8175097, PR3334, RH1417266: [TESTBUG] 8174164 fix missed the test -Patch549: 8175097-pr3334-rh1417266.patch - -# Patches upstream and appearing in 8u112 +# 8188030, PR3459, RH1484079: AWT java apps fail to start when some minimal fonts are present +Patch560: 8188030-pr3459-rh1484079.patch +# 8205104, PR3539, RH1548475: Pass EXTRA_LDFLAGS to HotSpot build +Patch562: pr3539-rh1548475.patch +# 8185723, PR3553: Zero: segfaults on Power PC 32-bit +Patch565: 8185723-pr3553.patch +# 8186461, PR3557: Zero's atomic_copy64() should use SPE instructions on linux-powerpcspe +Patch566: 8186461-pr3557.patch +# 8201509, PR3579: Zero: S390 31bit atomic_copy64 inline assembler is wrong +Patch569: 8201509-pr3579.patch +# 8165489, PR3589: Missing G1 barrier in Unsafe_GetObjectVolatile +Patch570: 8165489-pr3589.patch +# 8075942, PR3602: ArrayIndexOutOfBoundsException in sun.java2d.pisces.Dasher.goTo +Patch578: 8075942-pr3602-rh1582032.patch +# 8203182, PR3603: Release session if initialization of SunPKCS11 Signature fails +Patch579: 8203182-pr3603-rh1568033.patch +# 8206406, PR3610, RH1597825: StubCodeDesc constructor publishes partially-constructed objects on StubCodeDesc::_list +Patch580: 8206406-pr3610-rh1597825.patch +# 8146115, PR3508, RH1463098: Improve docker container detection and resource configuration usage +Patch581: 8146115-pr3508-rh1463098.patch +# 8206425: .gnu_debuglink sections added unconditionally when no debuginfo is stripped +Patch204: 8206425-hotspot-remove-debuglink.patch # Patches ineligible for 8u # 8043805: Allow using a system-installed libjpeg Patch201: system-libjpeg.patch +Patch210: suse_linuxfilestore.patch + # custom securities -Patch207: PR3183.patch +Patch300: PR3183.patch # Local fixes # PR1834, RH1022017: Reduce curves reported by SSL to those in NSS Patch525: pr1834-rh1022017.patch +# Turn on AssumeMP by default on RHEL systems +Patch534: always_assumemp.patch +# PR2888: OpenJDK should check for system cacerts database (e.g. /etc/pki/java/cacerts) +Patch539: pr2888.patch +# PR3575, RH1567204: System cacerts database handling should not affect jssecacerts +Patch540: pr3575-rh1567204.patch + +# Shenandoah fixes + # Non-OpenJDK fixes BuildRequires: autoconf @@ -928,6 +1121,7 @@ BuildRequires: pkgconfig(alsa) BuildRequires: binutils BuildRequires: cups-devel BuildRequires: desktop-file-utils +BuildRequires: elfutils BuildRequires: fontconfig BuildRequires: freetype-devel BuildRequires: giflib-devel @@ -1153,6 +1347,42 @@ Summary: OpenJDK accessibility connector %{for_debug} See normal java-%{version}-openjdk-accessibility description. %endif +%if %{with_openjfx_binding} +%package openjfx +Summary: OpenJDK x OpenJFX connector. This package adds symliks finishing Java FX integration to %{name} +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Requires: openjfx%{?_isa} +Provides: javafx = %{epoch}:%{version}-%{release} +%description openjfx +Set of links from OpenJDK (jre) to OpenJFX + +%package openjfx-devel +Summary: OpenJDK x OpenJFX connector for FX developers. This package adds symliks finishing Java FX integration to %{name}-devel +Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release} +Requires: openjfx-devel%{?_isa} +Provides: javafx-devel = %{epoch}:%{version}-%{release} +%description openjfx-devel +Set of links from OpenJDK (sdk) to OpenJFX + +%if %{include_debug_build} +%package openjfx-debug +Summary: OpenJDK x OpenJFX connector %{for_debug}. his package adds symliks finishing Java FX integration to %{name}-debug +Requires: %{name}-debug%{?_isa} = %{epoch}:%{version}-%{release} +Requires: openjfx%{?_isa} +Provides: javafx-debug = %{epoch}:%{version}-%{release} +%description openjfx-debug +Set of links from OpenJDK-debug (jre) to normal OpenJFX. OpenJFX do not support debug buuilds of itself + +%package openjfx-devel-debug +Summary: OpenJDK x OpenJFX connector for FX developers %{for_debug}. This package adds symliks finishing Java FX integration to %{name}-devel-debug +Requires: %{name}-devel-debug%{?_isa} = %{epoch}:%{version}-%{release} +Requires: openjfx-devel%{?_isa} +Provides: javafx-devel-debug = %{epoch}:%{version}-%{release} +%description openjfx-devel-debug +Set of links from OpenJDK-debug (sdk) to normal OpenJFX. OpenJFX do not support debug buuilds of itself +%endif +%endif + %prep if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then echo "include_normal_build is %{include_normal_build}" @@ -1172,7 +1402,7 @@ if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 ] ; then fi %setup -q -c -n %{uniquesuffix ""} -T -a 0 # Add the missing files to be able to build under Mageia -tar xjf %{SOURCE1} -C openjdk/jdk --strip-components=1 --overwrite +tar xjf %{SOURCE4} -C openjdk/jdk --strip-components=1 --overwrite # https://bugzilla.redhat.com/show_bug.cgi?id=1189084 prioritylength=`expr length %{priority}` if [ $prioritylength -ne 7 ] ; then @@ -1182,11 +1412,12 @@ fi # For old patches ln -s openjdk jdk8 %if %{use_shenandoah_hotspot} -#on intels, repalce hotpost by shenandoah-able hotspot +# On Shenandoah-supported architectures, replace HotSpot with +# the Shenandoah version pushd openjdk -tar -xf %{SOURCE999} +tar -xf %{SOURCE1} rm -rf hotspot -cp -r openjdk/hotspot . +mv openjdk/hotspot . rm -rf openjdk popd %endif @@ -1205,10 +1436,18 @@ cp %{SOURCE101} openjdk/common/autoconf/build-aux/ # Remove libraries that are linked sh %{SOURCE12} +# System library fixes %patch201 %patch202 %patch203 -%patch207 + +# Debugging fixes +%patch204 +%patch205 +%patch206 +%patch210 + +%patch300 %patch1 %patch3 @@ -1221,12 +1460,17 @@ sh %{SOURCE12} %patch103 %patch501 +%patch106 -# Zero fixes. +# x86 fixes +%patch105 + +# ppc64le fixes %patch603 %patch601 %patch602 +# Upstreamable fixes %patch502 %patch504 %patch506 @@ -1240,24 +1484,53 @@ sh %{SOURCE12} #patch515 #patch516 #patch517 +#patch518 +#patch519 %patch400 %patch523 -%patch525 %patch526 %patch528 -%patch532 -%patch533 +%patch529 %patch538 -%patch542 -%patch544 -%patch535 -%patch546 -%patch547 -%patch537 -%patch548 -%patch549 +%patch560 +pushd openjdk/jdk +%patch531 -p1 +popd +%patch561 +%patch562 +%patch563 +%patch564 +%patch565 +%patch566 +%patch567 +%patch569 +%patch571 +%patch572 +%patch573 +%patch574 +%patch575 +%patch576 +%patch577 +%patch578 +%patch579 +%patch580 +%patch581 +# RPM-only fixes +%patch525 +%patch539 +%patch540 +# RHEL-only patches +%if 0%{?rhel} +%patch534 +%endif + +# Shenandoah-only patches +%if %{use_shenandoah_hotspot} +%else +%patch570 +%endif # Extract systemtap tapsets %if %{with systap} @@ -1298,9 +1571,8 @@ for file in %{SOURCE9} %{SOURCE10} ; do done done -# this is check which controls, that latest java.security is included in post(_headless) -%{check_sum_presented_in_spec openjdk/jdk/src/share/lib/security/java.security-linux} - +# Setup nss.cfg +sed -e s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g %{SOURCE11} > nss.cfg %build # How many cpu's do we have? @@ -1322,9 +1594,9 @@ export CFLAGS="$CFLAGS -mieee" # We use ourcppflags because the OpenJDK build seems to # pass EXTRA_CFLAGS to the HotSpot C++ compiler... # 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_CFLAGS="%ourcppflags -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse" #-fno-lifetime-dse" -EXTRA_CPP_FLAGS="%ourcppflags -std=gnu++98 -fno-delete-null-pointer-checks " +EXTRA_CPP_FLAGS="%ourcppflags -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse" #-fno-lifetime-dse" %ifarch %{power64} ppc # fix rpmlint warnings @@ -1403,15 +1675,108 @@ popd >& /dev/null export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{j2sdkimage} # Install nss.cfg right away as we will be using the JRE above -install -m 644 %{SOURCE11} $JAVA_HOME/jre/lib/security/ +install -m 644 nss.cfg $JAVA_HOME/jre/lib/security/ # Use system-wide tzdata #rm $JAVA_HOME/jre/lib/tzdb.dat -#ln -s %{_datadir}/javazi/tzdb.dat $JAVA_HOME/jre/lib/tzdb.dat +#ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/jre/lib/tzdb.dat #build cycles done +%check + +# We test debug first as it will give better diagnostics on a crash +for suffix in %{rev_build_loop} ; do + +export JAVA_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{j2sdkimage} + +# Check unlimited policy has been used +$JAVA_HOME/bin/javac -d . %{SOURCE13} +$JAVA_HOME/bin/java TestCryptoLevel + +# Check ECC is working +$JAVA_HOME/bin/javac -d . %{SOURCE14} +$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") + +# Check debug symbols are present and can identify code +find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib +do + if [ -f "$lib" ] ; then + echo "Testing $lib for debug symbols" + # All these tests rely on RPM failing the build if the exit code of any set + # of piped commands is non-zero. + + # Test for .debug_* sections in the shared object. This is the main test. + # Stripped objects will not contain these. + eu-readelf -S "$lib" | grep "] .debug_" + test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + + # Test FILE symbols. These will most likely be removed by anyting that + # manipulates symbol tables because it's generally useless. So a nice test + # that nothing has messed with symbols. + old_IFS="$IFS" + IFS=$'\n' + for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") + do + # We expect to see .cpp files, except for architectures like aarch64 and + # s390 where we expect .o and .oS files + echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$" + done + IFS="$old_IFS" + + # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking. + if [ "`basename $lib`" = "libjvm.so" ]; then + eu-readelf -s "$lib" | \ + grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" + fi + # Test that there are no .gnu_debuglink sections pointing to another + # debuginfo file. There shouldn't be any debuginfo files, so the link makes + # no sense either. + eu-readelf -S "$lib" | grep 'gnu' + if eu-readelf -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then + echo "bad .gnu_debuglink section." + eu-readelf -x .gnu_debuglink "$lib" + false + fi + fi +done + +# Make sure gdb can do a backtrace based on line numbers on libjvm.so +# javaCalls.cpp:58 should map to: +# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58. +# 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 +gdb -q "$JAVA_HOME/bin/java" < %{name}.files-headless"$suffix" -# Find JRE files. -find %{buildroot}%{_jvmdir}/%{jredir $suffix} -type f -o -type l \ - | grep -v jre/lib/security \ - | sed 's|'%{buildroot}'||' \ - > %{name}.files.all"$suffix" -#split %%{name}.files to %%{name}.files-headless and %%{name}.files -#see https://bugzilla.redhat.com/show_bug.cgi?id=875408 -NOT_HEADLESS=\ -"%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libjsoundalsa.so -%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libpulse-java.so -%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libsplashscreen.so -%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libawt_xawt.so -%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libjawt.so -%{_jvmdir}/%{uniquesuffix $suffix}/jre/bin/policytool" -#filter %%{name}.files from %%{name}.files.all to %%{name}.files-headless -ALL=`cat %{name}.files.all"$suffix"` -for file in $ALL ; do - INLCUDE="NO" ; - for blacklist in $NOT_HEADLESS ; do -#we can not match normally, because rpmbuild will evaluate !0 result as script failure - q=`expr match "$file" "$blacklist"` || : - l=`expr length "$blacklist"` || : - if [ $q -eq $l ]; then - INLCUDE="YES" ; - fi; -done -if [ "x$INLCUDE" = "xNO" ]; then - echo "$file" >> %{name}.files-headless"$suffix" -else - echo "$file" >> %{name}.files"$suffix" -fi -done -# Find demo directories. -find %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/demo \ - %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/sample -type d \ - | sed 's|'%{buildroot}'|%dir |' \ - > %{name}-demo.files"$suffix" - # FIXME: remove SONAME entries from demo DSOs. See # https://bugzilla.redhat.com/show_bug.cgi?id=436497 @@ -1602,7 +1925,6 @@ find %{buildroot}%{_jvmdir}/%{sdkdir $suffix}/demo \ | sed 's|^|%doc |' \ >> %{name}-demo.files"$suffix" -# intentionally after the files generation, as it goes to separate package # Create links which leads to separately installed java-atk-bridge and allow configuration # links points to java-atk-wrapper - an dependence pushd %{buildroot}/%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall} @@ -1665,7 +1987,7 @@ else end end -- run contetn of included file with fake args -arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}"} +arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"} require "copy_jdk_configs.lua" %post headless @@ -1695,7 +2017,7 @@ require "copy_jdk_configs.lua" %endif %if %{include_normal_build} -%files -f %{name}.files +%files # main package builds always %{files_jre %{nil}} %else @@ -1705,7 +2027,7 @@ require "copy_jdk_configs.lua" %if %{include_normal_build} -%files headless -f %{name}.files-headless +%files headless # important note, see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue # all config/norepalce files (and more) have to be declared in pretrans. See pretrans %{files_jre_headless %{nil}} @@ -1729,7 +2051,20 @@ require "copy_jdk_configs.lua" %{files_accessibility %{nil}} %endif +%if %{with_openjfx_binding} +%files openjfx -f %{name}-openjfx.files + +%files openjfx-devel -f %{name}-openjfx-devel.files +%endif + + %if %{include_debug_build} +%if %{with_openjfx_binding} +%files openjfx-debug -f %{name}-openjfx.files-debug + +%files openjfx-devel-debug -f %{name}-openjfx-devel.files-debug +%endif + %files debug -f %{name}.files-debug %{files_jre %{debug_suffix_unquoted}} diff --git a/java-atk-wrapper-security.patch b/java-atk-wrapper-security.patch index 7d6f314..538468a 100644 --- a/java-atk-wrapper-security.patch +++ b/java-atk-wrapper-security.patch @@ -1,9 +1,9 @@ --- jdk8/jdk/src/share/lib/security/java.security-linux.orig +++ jdk8/jdk/src/share/lib/security/java.security-linux -@@ -211,7 +211,9 @@ - jdk.internal.,\ +@@ -223,7 +223,9 @@ jdk.nashorn.internal.,\ jdk.nashorn.tools.,\ + jdk.xml.internal.,\ - com.sun.activation.registries. + com.sun.activation.registries.,\ + org.GNOME.Accessibility.,\ @@ -11,10 +11,10 @@ # # List of comma-separated packages that start with or equal this string -@@ -258,7 +260,9 @@ - jdk.internal.,\ +@@ -273,7 +275,9 @@ jdk.nashorn.internal.,\ jdk.nashorn.tools.,\ + jdk.xml.internal.,\ - com.sun.activation.registries. + com.sun.activation.registries.,\ + org.GNOME.Accessibility.,\ @@ -22,4 +22,3 @@ # # Determines whether this properties file can be appended to - diff --git a/nss.cfg b/nss.cfg.in similarity index 100% rename from nss.cfg rename to nss.cfg.in diff --git a/pr1834-rh1022017.patch b/pr1834-rh1022017.patch index 4983884..8165340 100644 --- a/pr1834-rh1022017.patch +++ b/pr1834-rh1022017.patch @@ -1,6 +1,6 @@ -diff --git a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java ---- openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java -+++ openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java +diff --git a/src/share/classes/sun/security/ssl/EllipticCurvesExtension.java b/src/share/classes/sun/security/ssl/EllipticCurvesExtension.java +--- openjdk/jdk/src/share/classes/sun/security/ssl/EllipticCurvesExtension.java ++++ openjdk/jdk/src/share/classes/sun/security/ssl/EllipticCurvesExtension.java @@ -168,20 +168,10 @@ "contains no supported elliptic curves"); } diff --git a/pr2842-01.patch b/pr2842-01.patch index 4ee4c55..faaa309 100644 --- a/pr2842-01.patch +++ b/pr2842-01.patch @@ -7,16 +7,16 @@ 8031668, PR2842: TOOLCHAIN_FIND_COMPILER unexpectedly resolves symbolic links Reviewed-by: erikj, ihse -diff -r f0635543beb3 -r 842cc183c9f6 common/autoconf/toolchain.m4 ---- openjdk/./common/autoconf/toolchain.m4 Wed Jan 27 02:50:07 2016 +0000 -+++ openjdk/./common/autoconf/toolchain.m4 Tue Jan 14 10:25:22 2014 -0800 -@@ -188,8 +188,8 @@ +diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 +--- openjdk///common/autoconf/toolchain.m4 ++++ openjdk///common/autoconf/toolchain.m4 +@@ -230,8 +230,8 @@ $1="$PROPER_COMPILER_$1" else AC_MSG_RESULT([no, keeping $1]) - $1="$TEST_COMPILER" fi + - TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME]) + TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME]) ]) diff --git a/pr2842-02.patch b/pr2842-02.patch index f5268fc..1812e19 100644 --- a/pr2842-02.patch +++ b/pr2842-02.patch @@ -7,10 +7,10 @@ 8148351, PR2842: Only display resolved symlink for compiler, do not change path Reviewed-by: erikj -diff -r 5096b6468914 common/autoconf/toolchain.m4 ---- openjdk/./common/autoconf/toolchain.m4 Tue Jan 14 10:25:22 2014 -0800 -+++ openjdk/./common/autoconf/toolchain.m4 Fri Feb 05 20:02:15 2016 +0000 -@@ -147,38 +147,22 @@ +diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 +--- openjdk///common/autoconf/toolchain.m4 ++++ openjdk///common/autoconf/toolchain.m4 +@@ -198,38 +198,22 @@ fi BASIC_FIXUP_EXECUTABLE($1) TEST_COMPILER="[$]$1" @@ -62,4 +62,4 @@ diff -r 5096b6468914 common/autoconf/toolchain.m4 + fi fi - TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME]) + TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME]) diff --git a/pr2888.patch b/pr2888.patch new file mode 100644 index 0000000..fc8f981 --- /dev/null +++ b/pr2888.patch @@ -0,0 +1,60 @@ +# HG changeset patch +# User andrew +# Date 1459487045 -3600 +# Fri Apr 01 06:04:05 2016 +0100 +# Node ID 3334efeacd8327a14b7d2f392f4546e3c29c594b +# Parent 6b81fd2227d14226f2121f2d51b464536925686e +PR2888: OpenJDK should check for system cacerts database (e.g. /etc/pki/java/cacerts) + +diff --git a/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java b/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java +--- openjdk/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java ++++ openjdk/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java +@@ -174,15 +174,20 @@ + storeFile = new File(storeFileName); + fis = getFileInputStream(storeFile); + } else { +- String javaHome = props.get("javaHome"); +- storeFile = new File(javaHome + sep + "lib" + sep +- + "security" + sep + +- "jssecacerts"); ++ /* Check system cacerts DB first; /etc/pki/java/cacerts */ ++ storeFile = new File(sep + "etc" + sep + "pki" + sep ++ + "java" + sep + "cacerts"); + if ((fis = getFileInputStream(storeFile)) == null) { ++ String javaHome = props.get("javaHome"); + storeFile = new File(javaHome + sep + "lib" + sep +- + "security" + sep + +- "cacerts"); +- fis = getFileInputStream(storeFile); ++ + "security" + sep + ++ "jssecacerts"); ++ if ((fis = getFileInputStream(storeFile)) == null) { ++ storeFile = new File(javaHome + sep + "lib" + sep ++ + "security" + sep + ++ "cacerts"); ++ fis = getFileInputStream(storeFile); ++ } + } + } + +diff --git a/src/share/classes/sun/security/tools/KeyStoreUtil.java b/src/share/classes/sun/security/tools/KeyStoreUtil.java +--- openjdk/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java ++++ openjdk/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java +@@ -87,9 +87,14 @@ + throws Exception + { + String sep = File.separator; +- File file = new File(System.getProperty("java.home") + sep +- + "lib" + sep + "security" + sep +- + "cacerts"); ++ /* Check system cacerts DB first; /etc/pki/java/cacerts */ ++ File file = new File(sep + "etc" + sep + "pki" + sep ++ + "java" + sep + "cacerts"); ++ if (!file.exists()) { ++ file = new File(System.getProperty("java.home") + sep ++ + "lib" + sep + "security" + sep ++ + "cacerts"); ++ } + if (!file.exists()) { + return null; + } diff --git a/pr2974-rh1337583.patch b/pr2974-rh1337583.patch index 5c00050..4859ca6 100644 --- a/pr2974-rh1337583.patch +++ b/pr2974-rh1337583.patch @@ -7,9 +7,9 @@ PR2974: PKCS#10 certificate requests now use CRLF line endings rather than system line endings Summary: Add -systemlineendings option to keytool to allow system line endings to be used again. -diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/pkcs10/PKCS10.java ---- openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java Tue Dec 29 10:40:43 2015 -0500 -+++ openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java Fri May 27 03:28:35 2016 +0100 +diff --git a/src/share/classes/sun/security/pkcs10/PKCS10.java b/src/share/classes/sun/security/pkcs10/PKCS10.java +--- openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java ++++ openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java @@ -30,6 +30,7 @@ import java.io.IOException; import java.math.BigInteger; @@ -41,7 +41,7 @@ diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/pkcs10/PKCS1 /** * Constructs an unsigned PKCS #10 certificate request. Before this * request may be used, it must be encoded and signed. Then it -@@ -286,13 +296,39 @@ +@@ -293,13 +303,39 @@ */ public void print(PrintStream out) throws IOException, SignatureException { @@ -83,10 +83,10 @@ diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/pkcs10/PKCS1 out.println("-----END NEW CERTIFICATE REQUEST-----"); } -diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytool/Main.java ---- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java Tue Dec 29 10:40:43 2015 -0500 -+++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java Fri May 27 03:28:35 2016 +0100 -@@ -117,6 +117,7 @@ +diff --git a/src/share/classes/sun/security/tools/keytool/Main.java b/src/share/classes/sun/security/tools/keytool/Main.java +--- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java ++++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java +@@ -124,6 +124,7 @@ private String infilename = null; private String outfilename = null; private String srcksfname = null; @@ -94,7 +94,7 @@ diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytoo // User-specified providers are added before any command is called. // However, they are not removed before the end of the main() method. -@@ -163,7 +164,7 @@ +@@ -186,7 +187,7 @@ CERTREQ("Generates.a.certificate.request", ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, @@ -103,7 +103,7 @@ diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytoo CHANGEALIAS("Changes.an.entry.s.alias", ALIAS, DESTALIAS, KEYPASS, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, -@@ -296,6 +297,7 @@ +@@ -319,6 +320,7 @@ STARTDATE("startdate", "", "certificate.validity.start.date.time"), STOREPASS("storepass", "", "keystore.password"), STORETYPE("storetype", "", "keystore.type"), @@ -111,7 +111,7 @@ diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytoo TRUSTCACERTS("trustcacerts", null, "trust.certificates.from.cacerts"), V("v", null, "verbose.output"), VALIDITY("validity", "", "validity.number.of.days"); -@@ -537,6 +539,8 @@ +@@ -559,6 +561,8 @@ protectedPath = true; } else if (collator.compare(flags, "-srcprotected") == 0) { srcprotectedPath = true; @@ -120,23 +120,23 @@ diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytoo } else { System.err.println(rb.getString("Illegal.option.") + flags); tinyHelp(); -@@ -1335,7 +1339,7 @@ +@@ -1463,7 +1467,7 @@ // Sign the request and base-64 encode it request.encodeAndSign(subject, signature); - request.print(out); + request.print(out, systemLineEndings); - } - /** -@@ -4191,4 +4195,3 @@ + checkWeak(rb.getString("the.generated.certificate.request"), request); + } +@@ -4540,4 +4544,3 @@ return new Pair<>(a,b); } } - -diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytool/Resources.java ---- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java Tue Dec 29 10:40:43 2015 -0500 -+++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java Fri May 27 03:28:35 2016 +0100 +diff --git a/src/share/classes/sun/security/tools/keytool/Resources.java b/src/share/classes/sun/security/tools/keytool/Resources.java +--- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java ++++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java @@ -168,6 +168,8 @@ "keystore password"}, //-storepass {"keystore.type", diff --git a/pr3479-rh1486025.patch b/pr3479-rh1486025.patch new file mode 100644 index 0000000..14c693b --- /dev/null +++ b/pr3479-rh1486025.patch @@ -0,0 +1,67 @@ +# HG changeset patch +# User andrew +# Date 1508194072 -3600 +# Mon Oct 16 23:47:52 2017 +0100 +# Node ID 5dcb55da00c1531264934559c9f10c2e0ae46420 +# Parent bf62c56e3604fee0018b19f65fd56c76dc156630 +PR3479, RH1486025: ECC and NSS JVM crash +Summary: SunEC provider can have multiple instances, leading to premature NSS shutdown +Contributed-by: Martin Balao + +diff --git a/make/mapfiles/libsunec/mapfile-vers b/make/mapfiles/libsunec/mapfile-vers +--- openjdk/jdk/make/mapfiles/libsunec/mapfile-vers ++++ openjdk/jdk/make/mapfiles/libsunec/mapfile-vers +@@ -32,7 +32,6 @@ + Java_sun_security_ec_ECDSASignature_verifySignedDigest; + Java_sun_security_ec_ECDHKeyAgreement_deriveKey; + Java_sun_security_ec_SunEC_initialize; +- Java_sun_security_ec_SunEC_cleanup; + local: + *; + }; +diff --git a/src/share/classes/sun/security/ec/SunEC.java b/src/share/classes/sun/security/ec/SunEC.java +--- openjdk/jdk/src/share/classes/sun/security/ec/SunEC.java ++++ openjdk/jdk/src/share/classes/sun/security/ec/SunEC.java +@@ -83,21 +83,8 @@ + } + + /** +- * Cleanup native resources during finalisation. +- */ +- @Override +- protected void finalize() { +- cleanup(); +- } +- +- /** + * Initialize the native code. + */ + private static native void initialize(); + +- /** +- * Cleanup in the native layer. +- */ +- private static native void cleanup(); +- + } +diff --git a/src/share/native/sun/security/ec/ECC_JNI.cpp b/src/share/native/sun/security/ec/ECC_JNI.cpp +--- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp ++++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp +@@ -525,14 +525,12 @@ + } + + JNIEXPORT void +-JNICALL Java_sun_security_ec_SunEC_cleanup +- (JNIEnv *env, jclass UNUSED(clazz)) ++JNICALL JNI_OnUnload ++ (JavaVM *vm, void *reserved) + { + #ifdef SYSTEM_NSS + RNG_RNGShutdown(); +- if (SECOID_Shutdown() != SECSuccess) { +- ThrowException(env, INTERNAL_ERROR); +- } ++ SECOID_Shutdown(); + #endif + } + diff --git a/pr3519.patch b/pr3519.patch new file mode 100644 index 0000000..51ca7f1 --- /dev/null +++ b/pr3519.patch @@ -0,0 +1,19 @@ +# HG changeset patch +# User andrew +# Date 1518669922 0 +# Thu Feb 15 04:45:22 2018 +0000 +# Node ID adaf109718c10888cce5b6e73af7f3e15a7ab0db +# Parent 3ade0115344b77e6d00462044e0cf68722685bfe +PR3519: Fix further functions with a missing return value. + +diff --git openjdk.orig/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp openjdk/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +--- openjdk.orig/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp ++++ openjdk/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +@@ -205,6 +205,7 @@ + return Address(base, tmp, Address::lsl(addr->scale())); + } + } ++ return Address(); + } + + Address LIR_Assembler::as_Address_hi(LIR_Address* addr) { diff --git a/pr3539-rh1548475.patch b/pr3539-rh1548475.patch new file mode 100644 index 0000000..492a080 --- /dev/null +++ b/pr3539-rh1548475.patch @@ -0,0 +1,116 @@ +# HG changeset patch +# User andrew +# Date 1526065930 -3600 +# Fri May 11 20:12:10 2018 +0100 +# Node ID b8fc1e640c4c7f38ca94131279cb67c4d3de6961 +# Parent afb31413c73cbc06420fdb447aa90a7a38258904 +PR3539, RH1548475: Pass EXTRA_LDFLAGS to HotSpot build + +diff --git openjdk.orig/hotspot/make/aix/makefiles/jsig.make openjdk/hotspot/make/aix/makefiles/jsig.make +--- openjdk.orig/hotspot/make/aix/makefiles/jsig.make ++++ openjdk/hotspot/make/aix/makefiles/jsig.make +@@ -45,7 +45,7 @@ + # cause problems with interposing. See CR: 6466665 + # LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE)) + +-LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) ++LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS) + + LFLAGS_JSIG += $(BIN_UTILS) + +diff --git openjdk.orig/hotspot/make/aix/makefiles/saproc.make openjdk/hotspot/make/aix/makefiles/saproc.make +--- openjdk.orig/hotspot/make/aix/makefiles/saproc.make ++++ openjdk/hotspot/make/aix/makefiles/saproc.make +@@ -66,7 +66,7 @@ + endif + + +-SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE) ++SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS) + + $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) + $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ +diff --git openjdk.orig/hotspot/make/aix/makefiles/vm.make openjdk/hotspot/make/aix/makefiles/vm.make +--- openjdk.orig/hotspot/make/aix/makefiles/vm.make ++++ openjdk/hotspot/make/aix/makefiles/vm.make +@@ -117,7 +117,7 @@ + + # Extra flags from gnumake's invocation or environment + CFLAGS += $(EXTRA_CFLAGS) +-LFLAGS += $(EXTRA_CFLAGS) ++LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) + + # Don't set excutable bit on stack segment + # the same could be done by separate execstack command +diff --git openjdk.orig/hotspot/make/bsd/makefiles/jsig.make openjdk/hotspot/make/bsd/makefiles/jsig.make +--- openjdk.orig/hotspot/make/bsd/makefiles/jsig.make ++++ openjdk/hotspot/make/bsd/makefiles/jsig.make +@@ -52,7 +52,7 @@ + # cause problems with interposing. See CR: 6466665 + # LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE)) + +-LFLAGS_JSIG += -D_GNU_SOURCE -pthread $(LDFLAGS_HASH_STYLE) ++LFLAGS_JSIG += -D_GNU_SOURCE -pthread $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS) + + # DEBUG_BINARIES overrides everything, use full -g debug information + ifeq ($(DEBUG_BINARIES), true) +diff --git openjdk.orig/hotspot/make/bsd/makefiles/saproc.make openjdk/hotspot/make/bsd/makefiles/saproc.make +--- openjdk.orig/hotspot/make/bsd/makefiles/saproc.make ++++ openjdk/hotspot/make/bsd/makefiles/saproc.make +@@ -114,7 +114,7 @@ + # bring in minimum version argument or we'll fail on OSX 10.10 + SA_LFLAGS = $(LFLAGS) + endif +-SA_LFLAGS += $(LDFLAGS_HASH_STYLE) ++SA_LFLAGS += $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS) + + BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ + -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") +diff --git openjdk.orig/hotspot/make/bsd/makefiles/vm.make openjdk/hotspot/make/bsd/makefiles/vm.make +--- openjdk.orig/hotspot/make/bsd/makefiles/vm.make ++++ openjdk/hotspot/make/bsd/makefiles/vm.make +@@ -119,7 +119,7 @@ + + # Extra flags from gnumake's invocation or environment + CFLAGS += $(EXTRA_CFLAGS) +-LFLAGS += $(EXTRA_CFLAGS) ++LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) + + # Don't set excutable bit on stack segment + # the same could be done by separate execstack command +diff --git openjdk.orig/hotspot/make/linux/makefiles/jsig.make openjdk/hotspot/make/linux/makefiles/jsig.make +--- openjdk.orig/hotspot/make/linux/makefiles/jsig.make ++++ openjdk/hotspot/make/linux/makefiles/jsig.make +@@ -44,7 +44,7 @@ + # cause problems with interposing. See CR: 6466665 + # LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE)) + +-LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) ++LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS) + + # DEBUG_BINARIES overrides everything, use full -g debug information + ifeq ($(DEBUG_BINARIES), true) +diff --git openjdk.orig/hotspot/make/linux/makefiles/saproc.make openjdk/hotspot/make/linux/makefiles/saproc.make +--- openjdk.orig/hotspot/make/linux/makefiles/saproc.make ++++ openjdk/hotspot/make/linux/makefiles/saproc.make +@@ -73,7 +73,7 @@ + else + ALT_SAINCDIR= + endif +-SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE) ++SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS) + + SAARCH ?= $(BUILDARCH) + +diff --git openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make +--- openjdk.orig/hotspot/make/linux/makefiles/vm.make ++++ openjdk/hotspot/make/linux/makefiles/vm.make +@@ -130,7 +130,7 @@ + + # Extra flags from gnumake's invocation or environment + CFLAGS += $(EXTRA_CFLAGS) +-LFLAGS += $(EXTRA_CFLAGS) ++LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) + + # Don't set excutable bit on stack segment + # the same could be done by separate execstack command diff --git a/pr3559.patch b/pr3559.patch new file mode 100644 index 0000000..48211dc --- /dev/null +++ b/pr3559.patch @@ -0,0 +1,29 @@ +# HG changeset patch +# User aph +# Date 1338206478 14400 +# Mon May 28 08:01:18 2012 -0400 +# Node ID 6275d7b419091092752d5a1854194c98897892ba +# Parent be1379a186ba527b32c93a83e04c9600735fe44b +PR3559: Use ldrexd for atomic reads on ARMv7. + +2012-05-28 Andrew Haley + + * os_linux_zero.hpp (atomic_copy64): Use ldrexd for atomic reads + on ARMv7. + +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +@@ -54,6 +54,12 @@ + "std %0, 0(%2)\n" + : "=r"(tmp) + : "a"(src), "a"(dst)); ++#elif defined(__ARM_ARCH_7A__) ++ jlong tmp; ++ asm volatile ("ldrexd %0, [%1]\n" ++ : "=r"(tmp) ++ : "r"(src), "m"(src)); ++ *(jlong *) dst = tmp; + #else + *(jlong *) dst = *(jlong *) src; + #endif diff --git a/pr3575-rh1567204.patch b/pr3575-rh1567204.patch new file mode 100644 index 0000000..ce24c59 --- /dev/null +++ b/pr3575-rh1567204.patch @@ -0,0 +1,42 @@ +# HG changeset patch +# User andrew +# Date 1525111445 -3600 +# Mon Apr 30 19:04:05 2018 +0100 +# Node ID 388fc8da23044317c160678ffa8ff541c216a255 +# Parent 556adf3a76aa81bf3918d7d46554dae7cc1d5c5c +PR3575: System cacerts database handling should not affect jssecacerts + +diff --git openjdk.orig/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java openjdk/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java +--- openjdk.orig/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java ++++ openjdk/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java +@@ -162,7 +162,7 @@ + * Try: + * javax.net.ssl.trustStore (if this variable exists, stop) + * jssecacerts +- * cacerts ++ * cacerts (system and local) + * + * If none exists, we use an empty keystore. + */ +@@ -174,14 +174,14 @@ + storeFile = new File(storeFileName); + fis = getFileInputStream(storeFile); + } else { +- /* Check system cacerts DB first; /etc/pki/java/cacerts */ +- storeFile = new File(sep + "etc" + sep + "pki" + sep +- + "java" + sep + "cacerts"); ++ String javaHome = props.get("javaHome"); ++ storeFile = new File(javaHome + sep + "lib" + sep ++ + "security" + sep + ++ "jssecacerts"); + if ((fis = getFileInputStream(storeFile)) == null) { +- String javaHome = props.get("javaHome"); +- storeFile = new File(javaHome + sep + "lib" + sep +- + "security" + sep + +- "jssecacerts"); ++ /* Check system cacerts DB first; /etc/pki/java/cacerts */ ++ storeFile = new File(sep + "etc" + sep + "pki" + sep ++ + "java" + sep + "cacerts"); + if ((fis = getFileInputStream(storeFile)) == null) { + storeFile = new File(javaHome + sep + "lib" + sep + + "security" + sep + diff --git a/pr3591.patch b/pr3591.patch new file mode 100644 index 0000000..e287590 --- /dev/null +++ b/pr3591.patch @@ -0,0 +1,20 @@ +# HG changeset patch +# User andrew +# Date 1526489197 -3600 +# Wed May 16 17:46:37 2018 +0100 +# Node ID 64e87a408afd2b56d59dad73dee28d4b99463810 +# Parent 00ccc73498628a51a45301322e64ce2ad06e49be +PR3591: Fix for bug 3533 doesn't add -mstackrealign to JDK code + +diff --git openjdk.orig///common/autoconf/toolchain.m4 openjdk///common/autoconf/toolchain.m4 +--- openjdk.orig///common/autoconf/toolchain.m4 ++++ openjdk///common/autoconf/toolchain.m4 +@@ -794,6 +794,8 @@ + TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$REALIGN_CFLAG -Werror], [], + AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) + ) ++ CFLAGS_JDK="${CFLAGS_JDK} ${REALIGN_CFLAG}" ++ CXXFLAGS_JDK="${CXXFLAGS_JDK} ${REALIGN_CFLAG}" + AC_SUBST([REALIGN_CFLAG]) + fi + diff --git a/pr3593-s390-size_t_format_flags.patch b/pr3593-s390-size_t_format_flags.patch new file mode 100644 index 0000000..b9ae9ab --- /dev/null +++ b/pr3593-s390-size_t_format_flags.patch @@ -0,0 +1,143 @@ +diff -r cf43a852f486 src/share/vm/asm/codeBuffer.cpp +--- openjdk/hotspot/src/share/vm/asm/codeBuffer.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/asm/codeBuffer.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -977,7 +977,7 @@ + for (int n = (int) CodeBuffer::SECT_FIRST; n < (int) CodeBuffer::SECT_LIMIT; n++) { + CodeSection* sect = code_section(n); + if (!sect->is_allocated() || sect->is_empty()) continue; +- xtty->print_cr("", ++ xtty->print_cr("", + n, sect->limit() - sect->start(), sect->limit() - sect->end()); + } + xtty->print_cr(""); +diff -r cf43a852f486 src/share/vm/code/codeCache.cpp +--- openjdk/hotspot/src/share/vm/code/codeCache.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/code/codeCache.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -191,7 +191,7 @@ + } + if (PrintCodeCacheExtension) { + ResourceMark rm; +- tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)", ++ tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" INTX_FORMAT " bytes)", + (intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(), + (address)_heap->high() - (address)_heap->low_boundary()); + } +diff -r cf43a852f486 src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -556,7 +556,7 @@ + " [Table]\n" + " [Memory Usage: "G1_STRDEDUP_BYTES_FORMAT_NS"]\n" + " [Size: "SIZE_FORMAT", Min: "SIZE_FORMAT", Max: "SIZE_FORMAT"]\n" +- " [Entries: "UINTX_FORMAT", Load: "G1_STRDEDUP_PERCENT_FORMAT_NS", Cached: " UINTX_FORMAT ", Added: "UINTX_FORMAT", Removed: "UINTX_FORMAT"]\n" ++ " [Entries: "UINTX_FORMAT", Load: "G1_STRDEDUP_PERCENT_FORMAT_NS", Cached: " SIZE_FORMAT ", Added: "UINTX_FORMAT", Removed: "UINTX_FORMAT"]\n" + " [Resize Count: "UINTX_FORMAT", Shrink Threshold: "UINTX_FORMAT"("G1_STRDEDUP_PERCENT_FORMAT_NS"), Grow Threshold: "UINTX_FORMAT"("G1_STRDEDUP_PERCENT_FORMAT_NS")]\n" + " [Rehash Count: "UINTX_FORMAT", Rehash Threshold: "UINTX_FORMAT", Hash Seed: 0x%x]\n" + " [Age Threshold: "UINTX_FORMAT"]", +diff -r cf43a852f486 src/share/vm/memory/blockOffsetTable.cpp +--- openjdk/hotspot/src/share/vm/memory/blockOffsetTable.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/memory/blockOffsetTable.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -57,7 +57,7 @@ + gclog_or_tty->print_cr("BlockOffsetSharedArray::BlockOffsetSharedArray: "); + gclog_or_tty->print_cr(" " + " rs.base(): " INTPTR_FORMAT +- " rs.size(): " INTPTR_FORMAT ++ " rs.size(): " SIZE_FORMAT + " rs end(): " INTPTR_FORMAT, + p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size())); + gclog_or_tty->print_cr(" " +diff -r cf43a852f486 src/share/vm/runtime/arguments.cpp +--- openjdk/hotspot/src/share/vm/runtime/arguments.cpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp Wed Jan 13 05:30:26 2016 +0000 +@@ -1285,14 +1285,14 @@ + } + if (PrintGCDetails && Verbose) { + // Too early to use gclog_or_tty +- tty->print_cr("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize); ++ tty->print_cr("CMS ergo set MaxNewSize: " UINTX_FORMAT, MaxNewSize); + } + + // Code along this path potentially sets NewSize and OldSize + if (PrintGCDetails && Verbose) { + // Too early to use gclog_or_tty +- tty->print_cr("CMS set min_heap_size: " SIZE_FORMAT +- " initial_heap_size: " SIZE_FORMAT ++ tty->print_cr("CMS set min_heap_size: " UINTX_FORMAT ++ " initial_heap_size: " UINTX_FORMAT + " max_heap: " SIZE_FORMAT, + min_heap_size(), InitialHeapSize, max_heap); + } +@@ -1308,7 +1308,7 @@ + FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, (size_t)NewSize)); + if (PrintGCDetails && Verbose) { + // Too early to use gclog_or_tty +- tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize); ++ tty->print_cr("CMS ergo set NewSize: " UINTX_FORMAT, NewSize); + } + } + // Unless explicitly requested otherwise, size old gen +@@ -1318,7 +1318,7 @@ + FLAG_SET_ERGO(uintx, OldSize, MIN2((size_t)(NewRatio*NewSize), max_heap - NewSize)); + if (PrintGCDetails && Verbose) { + // Too early to use gclog_or_tty +- tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize); ++ tty->print_cr("CMS ergo set OldSize: " UINTX_FORMAT, OldSize); + } + } + } +@@ -1834,7 +1834,7 @@ + + if (PrintGCDetails && Verbose) { + // Cannot use gclog_or_tty yet. +- tty->print_cr(" Initial heap size " SIZE_FORMAT, (uintx)reasonable_initial); ++ tty->print_cr(" Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial); + } + FLAG_SET_ERGO(uintx, InitialHeapSize, (uintx)reasonable_initial); + } +@@ -1844,7 +1844,7 @@ + set_min_heap_size(MIN2((uintx)reasonable_minimum, InitialHeapSize)); + if (PrintGCDetails && Verbose) { + // Cannot use gclog_or_tty yet. +- tty->print_cr(" Minimum heap size " SIZE_FORMAT, min_heap_size()); ++ tty->print_cr(" Minimum heap size " UINTX_FORMAT, min_heap_size()); + } + } + } +diff -r cf43a852f486 src/share/vm/utilities/globalDefinitions.hpp +--- openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp Wed Jan 13 03:43:29 2016 +0000 ++++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp Wed Jan 13 05:30:26 2016 +0000 +@@ -1382,12 +1382,21 @@ + + #define INTPTR_FORMAT_W(width) "%" #width PRIxPTR + ++#if defined(S390) && !defined(_LP64) ++#define SSIZE_FORMAT "%z" PRIdPTR ++#define SIZE_FORMAT "%z" PRIuPTR ++#define SIZE_FORMAT_HEX "0x%z" PRIxPTR ++#define SSIZE_FORMAT_W(width) "%" #width "z" PRIdPTR ++#define SIZE_FORMAT_W(width) "%" #width "z" PRIuPTR ++#define SIZE_FORMAT_HEX_W(width) "0x%" #width "z" PRIxPTR ++#else // !S390 + #define SSIZE_FORMAT "%" PRIdPTR + #define SIZE_FORMAT "%" PRIuPTR + #define SIZE_FORMAT_HEX "0x%" PRIxPTR + #define SSIZE_FORMAT_W(width) "%" #width PRIdPTR + #define SIZE_FORMAT_W(width) "%" #width PRIuPTR + #define SIZE_FORMAT_HEX_W(width) "0x%" #width PRIxPTR ++#endif // S390 + + #define INTX_FORMAT "%" PRIdPTR + #define UINTX_FORMAT "%" PRIuPTR +diff -r 388e9d0905e6 src/share/vm/memory/collectorPolicy.cpp +--- openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp Mon Apr 11 11:33:18 2016 +0000 ++++ openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp Tue Apr 12 04:12:50 2016 +0100 +@@ -1056,7 +1056,8 @@ + size_t expected = msp.scale_by_NewRatio_aligned(initial_heap_size); + assert(msp.initial_gen0_size() == expected, err_msg("%zu != %zu", msp.initial_gen0_size(), expected)); + assert(FLAG_IS_ERGO(NewSize) && NewSize == expected, +- err_msg("NewSize should have been set ergonomically to %zu, but was %zu", expected, NewSize)); ++ err_msg("NewSize should have been set ergonomically to " SIZE_FORMAT ", but was " UINTX_FORMAT, ++ expected, NewSize)); + } + + private: diff --git a/pr3601.patch b/pr3601.patch new file mode 100644 index 0000000..d1e9576 --- /dev/null +++ b/pr3601.patch @@ -0,0 +1,38 @@ +# HG changeset patch +# User andrew +# Date 1529475043 -3600 +# Wed Jun 20 07:10:43 2018 +0100 +# Node ID f6341f4635dacb56678264d29a88cd052b74036b +# Parent 30520d5018b509b0ae68f5fcc9a5c540e3e5b2de +PR3601: Fix additional -Wreturn-type issues introduced by 8061651 + +diff --git openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp openjdk/hotspot/src/share/vm/prims/jvm.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp ++++ openjdk/hotspot/src/share/vm/prims/jvm.cpp +@@ -835,7 +835,7 @@ + JVM_ENTRY(jboolean, JVM_KnownToNotExist(JNIEnv *env, jobject loader, const char *classname)) + JVMWrapper("JVM_KnownToNotExist"); + #if INCLUDE_CDS +- return ClassLoaderExt::known_to_not_exist(env, loader, classname, CHECK_(false)); ++ return ClassLoaderExt::known_to_not_exist(env, loader, classname, THREAD); + #else + return false; + #endif +@@ -845,7 +845,7 @@ + JVM_ENTRY(jobjectArray, JVM_GetResourceLookupCacheURLs(JNIEnv *env, jobject loader)) + JVMWrapper("JVM_GetResourceLookupCacheURLs"); + #if INCLUDE_CDS +- return ClassLoaderExt::get_lookup_cache_urls(env, loader, CHECK_NULL); ++ return ClassLoaderExt::get_lookup_cache_urls(env, loader, THREAD); + #else + return NULL; + #endif +@@ -855,7 +855,7 @@ + JVM_ENTRY(jintArray, JVM_GetResourceLookupCache(JNIEnv *env, jobject loader, const char *resource_name)) + JVMWrapper("JVM_GetResourceLookupCache"); + #if INCLUDE_CDS +- return ClassLoaderExt::get_lookup_cache(env, loader, resource_name, CHECK_NULL); ++ return ClassLoaderExt::get_lookup_cache(env, loader, resource_name, THREAD); + #else + return NULL; + #endif diff --git a/rh1163501.patch b/rh1163501.patch index 851529f..d9cbac4 100644 --- a/rh1163501.patch +++ b/rh1163501.patch @@ -1,73 +1,35 @@ -diff --git a/src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java b/src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java ---- openjdk/jdk/src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java -+++ openjdk/jdk/src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java -@@ -1,5 +1,6 @@ - /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2014 Red Hat Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -74,10 +75,10 @@ - private static void checkKeySize(int keysize) - throws InvalidParameterException { - -- if ((keysize < 512) || (keysize > 2048) || ((keysize & 0x3F) != 0)) { -+ if ((keysize < 512) || (keysize > 4096) || ((keysize & 0x3F) != 0)) { - throw new InvalidParameterException( - "DH key size must be multiple of 64, and can only range " + -- "from 512 to 2048 (inclusive). " + -+ "from 512 to 4096 (inclusive). " + - "The specific key size " + keysize + " is not supported"); - } - } diff --git a/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java b/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java --- openjdk/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java +++ openjdk/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014 Red Hat Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it -@@ -60,11 +61,11 @@ +@@ -61,13 +62,13 @@ private static void checkKeySize(int keysize) throws InvalidParameterException { -- if ((keysize != 2048) && -+ if ((keysize != 2048) && (keysize != 4096) && - ((keysize < 512) || (keysize > 1024) || (keysize % 64 != 0))) { +- boolean supported = ((keysize == 2048) || (keysize == 3072) || ++ boolean supported = ((keysize == 2048) || (keysize == 3072) || (keysize == 4096) || + ((keysize >= 512) && (keysize <= 1024) && ((keysize & 0x3F) == 0))); + + if (!supported) { throw new InvalidParameterException( "DH key size must be multiple of 64 and range " + -- "from 512 to 1024 (inclusive), or 2048. " + -+ "from 512 to 1024 (inclusive), or 2048, or 4096. " + +- "from 512 to 1024 (inclusive), or 2048, 3072. " + ++ "from 512 to 1024 (inclusive), or 2048, 3072, 4096. " + "The specific key size " + keysize + " is not supported"); } } -diff --git a/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java b/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java ---- openjdk/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java -+++ openjdk/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java -@@ -285,11 +285,11 @@ - // this restriction is in the spec for DSA - // since we currently use DSA parameters for DH as well, - // it also applies to DH if no parameters are specified -- if ((keySize != 2048) && -+ if ((keySize != 2048) && (keySize != 4096) && - ((keySize > 1024) || ((keySize & 0x3f) != 0))) { - throw new InvalidAlgorithmParameterException(algorithm + - " key must be multiples of 64 if less than 1024 bits" + -- ", or 2048 bits. " + -+ ", or 2048 bits, or 4096 bits. " + - "The specific key size " + - keySize + " is not supported"); - } diff --git a/test/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java b/test/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java --- openjdk/jdk/test/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java +++ openjdk/jdk/test/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014 Red Hat Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -101,3 +63,4 @@ diff --git a/test/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java b/t System.out.println("OK"); } + diff --git a/rh1367357.patch b/rh1367357.patch deleted file mode 100644 index 254be99..0000000 --- a/rh1367357.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/src/share/native/sun/java2d/cmm/lcms/cmstypes.c b/src/share/native/sun/java2d/cmm/lcms/cmstypes.c ---- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c -+++ openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c -@@ -1484,6 +1484,7 @@ - - // Check for overflow - if (Offset < (SizeOfHeader + 8)) goto Error; -+ if ((Offset + Len) > SizeOfTag + 8) goto Error; - - // True begin of the string - BeginOfThisString = Offset - SizeOfHeader - 8; diff --git a/rh1566890_embargoed20180521.patch b/rh1566890_embargoed20180521.patch new file mode 100644 index 0000000..e29bdb9 --- /dev/null +++ b/rh1566890_embargoed20180521.patch @@ -0,0 +1,44 @@ +# ssbd2.patch +--- ./openjdk/hotspot/src/os/linux/vm/os_linux.cpp~ 2018-05-02 13:02:51.924489199 -0400 ++++ ./openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2018-05-02 13:04:57.274216581 -0400 +@@ -102,6 +102,8 @@ + # include + # include + ++#include ++ + PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC + + #ifndef _GNU_SOURCE +@@ -4892,6 +4894,31 @@ + } + } + ++/* 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 */ ++# undef PR_SPEC_STORE_BYPASS ++# define PR_SPEC_STORE_BYPASS 0 ++/* Return and control values for PR_SET/GET_SPECULATION_CTRL */ ++# undef PR_SPEC_NOT_AFFECTED ++# undef PR_SPEC_PRCTL ++# undef PR_SPEC_ENABLE ++# undef PR_SPEC_DISABLE ++# define PR_SPEC_NOT_AFFECTED 0 ++# define PR_SPEC_PRCTL (1UL << 0) ++# define PR_SPEC_ENABLE (1UL << 1) ++# define PR_SPEC_DISABLE (1UL << 2) ++ ++static void set_speculation() __attribute__((constructor)); ++static void set_speculation() { ++ prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_DISABLE, 0, 0); ++} ++ + // this is called _before_ the most of global arguments have been parsed + void os::init(void) { + char dummy; /* used to get a guess on initial stack address */ diff --git a/rhbz_1538767_fix_linking.patch b/rhbz_1538767_fix_linking.patch new file mode 100644 index 0000000..b321611 --- /dev/null +++ b/rhbz_1538767_fix_linking.patch @@ -0,0 +1,33 @@ +# HG changeset patch +# User sgehwolf +# Date 1523360781 -7200 +# Tue Apr 10 13:46:21 2018 +0200 +# Node ID 5f2401aef9acb6998f06cb82fdd8a84eda3e63ad +# Parent 656ab3b39178c1e4de644d490613bfd8212ae924 +8196516: libfontmanager must be built with LDFLAGS allowing unresolved symbols +Summary: Fixes build failures on some sustems with custom LDFLAGS settings. + +diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk +--- a/make/lib/Awt2dLibraries.gmk ++++ b/make/lib/Awt2dLibraries.gmk +@@ -927,6 +927,10 @@ ifeq ($(OPENJDK_TARGET_OS), linux) + BUILD_LIBFONTMANAGER_IndicRearrangementProcessor2.cpp_CXXFLAGS := -fno-strict-overflow + endif + ++# LDFLAGS clarification: ++# Filter relevant linker flags disallowing unresolved symbols as we cannot ++# build-time decide to which library to link against (libawt_headless or ++# libawt_xawt). See JDK-8196516 for details. + $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ + LIBRARY := fontmanager, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ +@@ -941,7 +945,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ + CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ + -DCC_NOEX, \ + MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ +- LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ ++ LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \ ++ $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \ + LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \ diff --git a/suse_linuxfilestore.patch b/suse_linuxfilestore.patch new file mode 100644 index 0000000..6a9f643 --- /dev/null +++ b/suse_linuxfilestore.patch @@ -0,0 +1,21 @@ +--- openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java 2017-08-23 11:40:26.690809603 +0200 ++++ openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java 2017-08-23 11:44:28.314815334 +0200 +@@ -74,8 +74,16 @@ + } catch (UnixException x) { + x.rethrowAsIOException(parent); + } +- if (attrs.dev() != dev()) +- break; ++ if (attrs.dev() != dev()) { ++ ++ // step 3: lookup mounted file systems (use /proc/mounts to ensure we ++ // find the file system even when not in /etc/mtab) ++ byte[] dir = path.asByteArray(); ++ for (UnixMountEntry entry: fs.getMountEntries("/proc/mounts")) { ++ if (Arrays.equals(dir, entry.dir())) ++ return entry; ++ } ++ } + path = parent; + parent = parent.getParent(); + }