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/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/8187577-pr3578.patch b/8187577-pr3578.patch new file mode 100644 index 0000000..ca60619 --- /dev/null +++ b/8187577-pr3578.patch @@ -0,0 +1,59 @@ +# HG changeset patch +# User poonam +# Date 1525279722 -3600 +# Wed May 02 17:48:42 2018 +0100 +# Node ID ffd5260fe5adcb26f87a14f1aaaf3e1a075d712a +# Parent 5460c427c0dcb335f510cbc2ea1d76c6921b1aaa +8187577, PR3578: JVM crash during gc doing concurrent marking +Summary: Inform G1's SATB that a klass has been resurrected and it should not be unloaded +Reviewed-by: coleenp, tschatzl, kbarrett + +diff --git openjdk.orig/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp openjdk/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp ++++ openjdk/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2003, 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 +@@ -27,6 +27,9 @@ + #include "memory/universe.inline.hpp" + #include "prims/jvmtiGetLoadedClasses.hpp" + #include "runtime/thread.hpp" ++#if INCLUDE_ALL_GCS ++#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" ++#endif + + + // The closure for GetLoadedClasses +@@ -35,6 +38,20 @@ + Stack _classStack; + JvmtiEnv* _env; + ++// Tell the GC to keep this klass alive ++static void ensure_klass_alive(oop o) { ++ // A klass that was previously considered dead can be looked up in the ++ // CLD/SD, and its _java_mirror or _class_loader can be stored in a root ++ // or a reachable object making it alive again. The SATB part of G1 needs ++ // to get notified about this potential resurrection, otherwise the marking ++ // might not find the object. ++#if INCLUDE_ALL_GCS ++ if (UseG1GC && o != NULL) { ++ G1SATBCardTableModRefBS::enqueue(o); ++ } ++#endif ++} ++ + public: + LoadedClassesClosure(JvmtiEnv* env) { + _env = env; +@@ -43,6 +60,7 @@ + void do_klass(Klass* k) { + // Collect all jclasses + _classStack.push((jclass) _env->jni_reference(k->java_mirror())); ++ ensure_klass_alive(k->java_mirror()); + } + + int extract(jclass* result_list) { diff --git a/8197429-pr3456-rh1536622.patch b/8197429-pr3456-rh1536622.patch deleted file mode 100644 index fc60cd3..0000000 --- a/8197429-pr3456-rh1536622.patch +++ /dev/null @@ -1,93 +0,0 @@ -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/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/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/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 6fe40a2..2271812 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -65,14 +65,22 @@ %global targets all %endif + +%ifarch %{aarch64} +# Disable hardened build on AArch64 as it didn't bootcycle +%undefine _hardened_build +%global ourcppflags "-fstack-protector-strong" +%global ourldflags %{nil} +%else # Filter out flags from the optflags macro that cause problems with the OpenJDK build # We filter out -O flags so that the optimisation of HotSpot is not lowered from O3 to O2 # We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs) # We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings # We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++ %global ourflags %(echo %optflags | sed -e 's|-Wall|-Wformat -Wno-cpp|' | sed -r -e 's|-O[0-9]*||') -%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||') +%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||') "-fstack-protector-strong" %global ourldflags %{__global_ldflags} +%endif # With diabled nss is NSS deactivated, so in NSS_LIBDIR can be wrong path # the initialisation must be here. LAter the pkg-connfig have bugy behaviour @@ -926,7 +934,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%{?1} Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever} -Release: 1.%{buildver}%{?dist} +Release: 5.%{buildver}%{?dist} # 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 @@ -968,7 +976,7 @@ Source1: aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u172-b11--shenando Source2: README.src # Use 'generate_tarballs.sh' to generate the following tarballs -# They are based on code contained in the IcedTea7 project. +# They are based on code contained in the IcedTea project (3.x). # Systemtap tapsets. Zipped up to keep it small. Source8: systemtap-tapset-3.6.0pre02.tar.xz @@ -1034,9 +1042,11 @@ 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 # 8196516, RH1538767: libfontmanager.so needs to be built with LDFLAGS so as to allow # linking with unresolved symbols. -Patch529: rhbz_1538767_fix_linking.patch +Patch530: rhbz_1538767_fix_linking.patch # Upstreamable debugging patches # Patches 204 and 205 stop the build adding .gnu_debuglink sections to unstripped files @@ -1046,14 +1056,18 @@ Patch205: dont-add-unnecessary-debug-links.patch Patch206: hotspot-assembler-debuginfo.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 -# Fix more cases of missing return statements on AArch64 -Patch104: pr3458-rh1540242.patch +# s390: PR3593: Use "%z" for size_t on s390 as size_t != intptr_t +Patch103: pr3593-s390-size_t_format_flags.patch +# AArch64: Fix more cases of missing return statements +Patch104: pr3458-rh1540242-aarch64.patch +# x86: S8199936, PR3533: HotSpot generates code with unaligned stack, crashes on SSE operations (-mstackrealign workaround) +Patch105: 8199936-pr3533-workaround.patch +# Zero: Fix more cases of missing return statements +Patch106: pr3458-rh1540242-zero.patch # Patches which need backporting to 8u # S8073139, RH1191652; fix name of ppc64le architecture @@ -1078,12 +1092,33 @@ Patch400: 8154313.patch Patch526: 6260348-pr3066.patch # 8061305, PR3335, RH1423421: Javadoc crashes when method name ends with "Property" Patch538: 8061305-pr3335-rh1423421.patch -Patch540: rhbz1548475-LDFLAGSusage.patch # 8188030, PR3459, RH1484079: AWT java apps fail to start when some minimal fonts are present Patch560: 8188030-pr3459-rh1484079.patch -# 8197429, PR3456, RH153662{2,3}: 32 bit java app started via JNI crashes with larger stack sizes -Patch561: 8197429-pr3456-rh1536622.patch - +# 8197429, PR3546, RH153662{2,3}: 32 bit java app started via JNI crashes with larger stack sizes +Patch561: 8197429-pr3546-rh1536622.patch +# PR3539, RH1548475: Pass EXTRA_LDFLAGS to HotSpot build +Patch562: pr3539-rh1548475.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 +# 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 +# PR3559: Use ldrexd for atomic reads on ARMv7. +Patch567: pr3559.patch +# 8187577, PR3578: JVM crash during gc doing concurrent marking +Patch568: 8187577-pr3578.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 +# 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 + # Patches ineligible for 8u # 8043805: Allow using a system-installed libjpeg Patch201: system-libjpeg.patch @@ -1098,6 +1133,10 @@ Patch525: pr1834-rh1022017.patch 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 Patch1000: enableCommentedOutSystemNss.patch @@ -1132,6 +1171,7 @@ BuildRequires: zip # Use OpenJDK 7 where available (on RHEL) to avoid # having to use the rhel-7.x-java-unsafe-candidate hack %if ! 0%{?fedora} && 0%{?rhel} <= 7 +# Require a boot JDK which doesn't fail due to RH1482244 BuildRequires: java-1.7.0-openjdk-devel >= 1.7.0.151-2.6.11.3 %else BuildRequires: java-1.8.0-openjdk-devel @@ -1456,12 +1496,16 @@ sh %{SOURCE12} %patch104 %endif +# x86 fixes +%patch105 + # ppc64le fixes %patch603 %patch601 %patch602 # Zero fixes. +%patch106 # Upstreamable fixes %patch502 @@ -1483,23 +1527,40 @@ sh %{SOURCE12} %patch523 %patch526 %patch528 +%patch529 %patch538 -%patch540 %patch560 pushd openjdk/jdk -%patch529 -p1 +%patch530 -p1 popd %patch561 +%patch562 +%patch563 +%patch564 +%patch565 +%patch566 +%patch567 +%patch569 +%patch571 +%patch572 # RPM-only fixes %patch525 %patch539 +%patch540 # RHEL-only patches %if ! 0%{?fedora} && 0%{?rhel} <= 7 %patch534 %endif +# Shenandoah-only patches +%if %{use_shenandoah_hotspot} +%else +%patch568 +%patch570 +%endif + %patch1000 # Extract systemtap tapsets diff --git a/pr3458-rh1540242-aarch64.patch b/pr3458-rh1540242-aarch64.patch new file mode 100644 index 0000000..01ebc2c --- /dev/null +++ b/pr3458-rh1540242-aarch64.patch @@ -0,0 +1,11 @@ +diff --git a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp +--- openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp ++++ openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp +@@ -698,6 +698,7 @@ + + extern "C" { + int SpinPause() { ++ return 0; + } + + void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) { diff --git a/pr3458-rh1540242-zero.patch b/pr3458-rh1540242-zero.patch new file mode 100644 index 0000000..dad435b --- /dev/null +++ b/pr3458-rh1540242-zero.patch @@ -0,0 +1,11 @@ +diff --git a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +--- openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +@@ -408,6 +408,7 @@ + + extern "C" { + int SpinPause() { ++ return 0; + } + + diff --git a/pr3458-rh1540242.patch b/pr3458-rh1540242.patch deleted file mode 100644 index 2a1ce5e..0000000 --- a/pr3458-rh1540242.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp ---- openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp -+++ openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp -@@ -698,6 +698,7 @@ - - extern "C" { - int SpinPause() { -+ return 0; - } - - void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) { -diff --git a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp ---- openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp -+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp -@@ -408,6 +408,7 @@ - - extern "C" { - int SpinPause() { -+ return 0; - } - - - 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/pr3573.patch b/pr3573.patch new file mode 100644 index 0000000..07b9f10 --- /dev/null +++ b/pr3573.patch @@ -0,0 +1,25 @@ +# HG changeset patch +# User roland +# Date 1506520357 -7200 +# Wed Sep 27 15:52:37 2017 +0200 +# Node ID c307975d0800f8da5cc8e82cd8f1fdadbd745357 +# Parent ab0c101fa16e4cd97ac8ceff4f5ff72e2f4d5776 +[backport] fix TCK crash with shenandoah + +diff --git a/src/share/vm/opto/shenandoahSupport.cpp b/src/share/vm/opto/shenandoahSupport.cpp +--- openjdk/hotspot/src/share/vm/opto/shenandoahSupport.cpp ++++ openjdk/hotspot/src/share/vm/opto/shenandoahSupport.cpp +@@ -472,9 +472,11 @@ + Node* input = in(Memory); + if (input->Opcode() == Op_ShenandoahWBMemProj) { + Node* wb = input->in(0); +- if (wb->is_top()) return NULL; // Dead path. ++ const Type* in_type = phase->type(wb); ++ // is_top() test not sufficient here: we can come here after CCP ++ // in a dead branch of the graph that has not yet been removed. ++ if (in_type == Type::TOP) return NULL; // Dead path. + assert(wb->Opcode() == Op_ShenandoahWriteBarrier, "expect write barrier"); +- const Type* in_type = phase->type(wb); + if (is_independent(in_type, _type)) { + if (phase->is_IterGVN()) { + phase->is_IterGVN()->rehash_node_delayed(wb); 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/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/rhbz1548475-LDFLAGSusage.patch b/rhbz1548475-LDFLAGSusage.patch deleted file mode 100644 index 243c71b..0000000 --- a/rhbz1548475-LDFLAGSusage.patch +++ /dev/null @@ -1,59 +0,0 @@ -# User jvanek -# https://bugzilla.redhat.com/show_bug.cgi?id=1548475 -# java-1.8.0-openjdk: Partial build flags injection -# LFLAGS += $(EXTRA_CFLAGS) corrected to LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) ---- openjdk/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 ---- openjdk/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 ---- openjdk/hotspot/make/linux/makefiles/vm.make -+++ openjdk/hotspot/make/linux/makefiles/vm.make -@@ -122,7 +122,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 ---- openjdk/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) - ---- openjdk/hotspot/make/linux/makefiles/jsig.make -+++ openjdk/hotspot/make/linux/makefiles/jsig.make -@@ -44,7 +44,7 @@ LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig - # 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 a/s390-size_t_format_flags.patch b/s390-size_t_format_flags.patch deleted file mode 100644 index b9ae9ab..0000000 --- a/s390-size_t_format_flags.patch +++ /dev/null @@ -1,143 +0,0 @@ -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: