From 07b2a49bfd82d110e6ac68e12adbbb9560d36a15 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 29 2020 07:01:43 +0000 Subject: import java-11-openjdk-11.0.8.10-1.el7 --- diff --git a/.gitignore b/.gitignore index bd6fdff..b705f93 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.8+10-4curve.tar.xz -SOURCES/systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz +SOURCES/tapsets-icedtea-3.15.0.tar.xz diff --git a/.java-11-openjdk.metadata b/.java-11-openjdk.metadata index 2e7ceca..6163a15 100644 --- a/.java-11-openjdk.metadata +++ b/.java-11-openjdk.metadata @@ -1,2 +1,2 @@ 96b0432148cbf9743ef57d6645600dbcc5c25bb0 SOURCES/shenandoah-jdk11-shenandoah-jdk-11.0.8+10-4curve.tar.xz -cd8bf91753b9eb1401cfc529e78517105fc66011 SOURCES/systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz +7ae2cba67467825b2c2a5fec7aea041865023002 SOURCES/tapsets-icedtea-3.15.0.tar.xz diff --git a/SOURCES/jconsole.desktop.in b/SOURCES/jconsole.desktop.in index a8917c1..8a3b04d 100644 --- a/SOURCES/jconsole.desktop.in +++ b/SOURCES/jconsole.desktop.in @@ -1,8 +1,8 @@ [Desktop Entry] -Name=OpenJDK @JAVA_MAJOR_VERSION@ Monitoring & Management Console @ARCH@ -Comment=Monitor and manage OpenJDK @JAVA_MAJOR_VERSION@ applications for @ARCH@ -Exec=@JAVA_HOME@/jconsole -Icon=java-@JAVA_MAJOR_VERSION@-@JAVA_VENDOR@ +Name=OpenJDK @JAVA_VER@ for @target_cpu@ Monitoring & Management Console (@OPENJDK_VER@) +Comment=Monitor and manage OpenJDK applications +Exec=_SDKBINDIR_/jconsole +Icon=java-@JAVA_VER@-@JAVA_VENDOR@ Terminal=false Type=Application StartupWMClass=sun-tools-jconsole-JConsole diff --git a/SOURCES/jdk8227269-rh1826915-slow_class_loading_with_jdwp.patch b/SOURCES/jdk8227269-rh1826915-slow_class_loading_with_jdwp.patch new file mode 100644 index 0000000..8c33e40 --- /dev/null +++ b/SOURCES/jdk8227269-rh1826915-slow_class_loading_with_jdwp.patch @@ -0,0 +1,481 @@ +# HG changeset patch +# User rkennke +# Date 1579704902 -3600 +# Wed Jan 22 15:55:02 2020 +0100 +# Node ID 63a288f3f25a5785460fa25756bd7d1e532cd874 +# Parent ca116bb90caf334f8a78c6c763321f7c76452540 +8227269: Slow class loading when running with JDWP +Reviewed-by: sspitsyn, cjplummer + +diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c b/src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c +--- a/src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c ++++ b/src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c +@@ -22,273 +22,204 @@ + * or visit www.oracle.com if you need additional information or have any + * questions. + */ ++ + /* + * This module tracks classes that have been prepared, so as to +- * be able to compute which have been unloaded. On VM start-up +- * all prepared classes are put in a table. As class prepare +- * events come in they are added to the table. After an unload +- * event or series of them, the VM can be asked for the list +- * of classes; this list is compared against the table keep by +- * this module, any classes no longer present are known to +- * have been unloaded. +- * +- * For efficient access, classes are keep in a hash table. +- * Each slot in the hash table has a linked list of KlassNode. +- * +- * Comparing current set of classes is compared with previous +- * set by transferring all classes in the current set into +- * a new table, any that remain in the old table have been +- * unloaded. ++ * be able to report which have been unloaded. On VM start-up ++ * and whenever new classes are loaded, all prepared classes' ++ * signatures are attached as JVMTI tag to the class object. ++ * Class unloading is tracked by registering ++ * ObjectFree callback on class objects. When this happens, we find ++ * the signature of the unloaded class(es) and report them back ++ * to the event handler to synthesize class-unload-events. + */ + + #include "util.h" + #include "bag.h" + #include "classTrack.h" + +-/* ClassTrack hash table slot count */ +-#define CT_HASH_SLOT_COUNT 263 /* Prime which eauals 4k+3 for some k */ ++#define NOT_TAGGED 0 + +-typedef struct KlassNode { +- jclass klass; /* weak global reference */ +- char *signature; /* class signature */ +- struct KlassNode *next; /* next node in this slot */ +-} KlassNode; ++/* ++ * The JVMTI tracking env to keep track of klass tags for class-unloads ++ */ ++static jvmtiEnv* trackingEnv; ++ ++/* ++ * A bag containing all the deleted classes' signatures. Must be accessed under ++ * classTrackLock. ++ */ ++struct bag* deletedSignatures; + + /* +- * Hash table of prepared classes. Each entry is a pointer +- * to a linked list of KlassNode. ++ * Lock to keep integrity of deletedSignatures. + */ +-static KlassNode **table; ++static jrawMonitorID classTrackLock; + + /* +- * Return slot in hash table to use for this class. ++ * Invoke the callback when classes are freed, find and record the signature ++ * in deletedSignatures. Those are only used in addPreparedClass() by the ++ * same thread. + */ +-static jint +-hashKlass(jclass klass) ++static void JNICALL ++cbTrackingObjectFree(jvmtiEnv* jvmti_env, jlong tag) + { +- jint hashCode = objectHashCode(klass); +- return abs(hashCode) % CT_HASH_SLOT_COUNT; ++ debugMonitorEnter(classTrackLock); ++ if (deletedSignatures == NULL) { ++ debugMonitorExit(classTrackLock); ++ return; ++ } ++ *(char**)bagAdd(deletedSignatures) = (char*)tag; ++ ++ debugMonitorExit(classTrackLock); + } + + /* +- * Transfer a node (which represents klass) from the current +- * table to the new table. +- */ +-static void +-transferClass(JNIEnv *env, jclass klass, KlassNode **newTable) { +- jint slot = hashKlass(klass); +- KlassNode **head = &table[slot]; +- KlassNode **newHead = &newTable[slot]; +- KlassNode **nodePtr; +- KlassNode *node; +- +- /* Search the node list of the current table for klass */ +- for (nodePtr = head; node = *nodePtr, node != NULL; nodePtr = &(node->next)) { +- if (isSameObject(env, klass, node->klass)) { +- /* Match found transfer node */ +- +- /* unlink from old list */ +- *nodePtr = node->next; +- +- /* insert in new list */ +- node->next = *newHead; +- *newHead = node; +- +- return; +- } +- } +- +- /* we haven't found the class, only unloads should have happenned, +- * so the only reason a class should not have been found is +- * that it is not prepared yet, in which case we don't want it. +- * Asset that the above is true. +- */ +-/**** the HotSpot VM doesn't create prepare events for some internal classes *** +- JDI_ASSERT_MSG((classStatus(klass) & +- (JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY))==0, +- classSignature(klass)); +-***/ +-} +- +-/* +- * Delete a hash table of classes. +- * The signatures of classes in the table are returned. +- */ +-static struct bag * +-deleteTable(JNIEnv *env, KlassNode *oldTable[]) +-{ +- struct bag *signatures = bagCreateBag(sizeof(char*), 10); +- jint slot; +- +- if (signatures == NULL) { +- EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY,"signatures"); +- } +- +- for (slot = 0; slot < CT_HASH_SLOT_COUNT; slot++) { +- KlassNode *node = oldTable[slot]; +- +- while (node != NULL) { +- KlassNode *next; +- char **sigSpot; +- +- /* Add signature to the signature bag */ +- sigSpot = bagAdd(signatures); +- if (sigSpot == NULL) { +- EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY,"signature bag"); +- } +- *sigSpot = node->signature; +- +- /* Free weak ref and the node itself */ +- JNI_FUNC_PTR(env,DeleteWeakGlobalRef)(env, node->klass); +- next = node->next; +- jvmtiDeallocate(node); +- +- node = next; +- } +- } +- jvmtiDeallocate(oldTable); +- +- return signatures; +-} +- +-/* +- * Called after class unloads have occurred. Creates a new hash table +- * of currently loaded prepared classes. +- * The signatures of classes which were unloaded (not present in the +- * new table) are returned. ++ * Called after class unloads have occurred. ++ * The signatures of classes which were unloaded are returned. + */ + struct bag * + classTrack_processUnloads(JNIEnv *env) + { +- KlassNode **newTable; +- struct bag *unloadedSignatures; +- +- unloadedSignatures = NULL; +- newTable = jvmtiAllocate(CT_HASH_SLOT_COUNT * sizeof(KlassNode *)); +- if (newTable == NULL) { +- EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY, "classTrack table"); +- } else { +- +- (void)memset(newTable, 0, CT_HASH_SLOT_COUNT * sizeof(KlassNode *)); +- +- WITH_LOCAL_REFS(env, 1) { +- +- jint classCount; +- jclass *classes; +- jvmtiError error; +- int i; +- +- error = allLoadedClasses(&classes, &classCount); +- if ( error != JVMTI_ERROR_NONE ) { +- jvmtiDeallocate(newTable); +- EXIT_ERROR(error,"loaded classes"); +- } else { +- +- /* Transfer each current class into the new table */ +- for (i=0; iassertOn) { +- /* Check this is not a duplicate */ +- for (node = *head; node != NULL; node = node->next) { +- if (isSameObject(env, klass, node->klass)) { +- JDI_ASSERT_FAILED("Attempting to insert duplicate class"); +- break; +- } ++ if (gdata && gdata->assertOn) { ++ // Check this is not already tagged. ++ jlong tag; ++ error = JVMTI_FUNC_PTR(trackingEnv, GetTag)(env, klass, &tag); ++ if (error != JVMTI_ERROR_NONE) { ++ EXIT_ERROR(error, "Unable to GetTag with class trackingEnv"); + } ++ JDI_ASSERT(tag == NOT_TAGGED); + } + +- node = jvmtiAllocate(sizeof(KlassNode)); +- if (node == NULL) { +- EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY,"KlassNode"); +- } +- error = classSignature(klass, &(node->signature), NULL); ++ char* signature; ++ error = classSignature(klass, &signature, NULL); + if (error != JVMTI_ERROR_NONE) { +- jvmtiDeallocate(node); + EXIT_ERROR(error,"signature"); + } +- if ((node->klass = JNI_FUNC_PTR(env,NewWeakGlobalRef)(env, klass)) == NULL) { +- jvmtiDeallocate(node->signature); +- jvmtiDeallocate(node); +- EXIT_ERROR(AGENT_ERROR_NULL_POINTER,"NewWeakGlobalRef"); ++ error = JVMTI_FUNC_PTR(trackingEnv, SetTag)(env, klass, (jlong)signature); ++ if (error != JVMTI_ERROR_NONE) { ++ jvmtiDeallocate(signature); ++ EXIT_ERROR(error,"SetTag"); + } ++} + +- /* Insert the new node */ +- node->next = *head; +- *head = node; ++static jboolean ++setupEvents() ++{ ++ jvmtiCapabilities caps; ++ memset(&caps, 0, sizeof(caps)); ++ caps.can_generate_object_free_events = 1; ++ jvmtiError error = JVMTI_FUNC_PTR(trackingEnv, AddCapabilities)(trackingEnv, &caps); ++ if (error != JVMTI_ERROR_NONE) { ++ return JNI_FALSE; ++ } ++ jvmtiEventCallbacks cb; ++ memset(&cb, 0, sizeof(cb)); ++ cb.ObjectFree = cbTrackingObjectFree; ++ error = JVMTI_FUNC_PTR(trackingEnv, SetEventCallbacks)(trackingEnv, &cb, sizeof(cb)); ++ if (error != JVMTI_ERROR_NONE) { ++ return JNI_FALSE; ++ } ++ error = JVMTI_FUNC_PTR(trackingEnv, SetEventNotificationMode)(trackingEnv, JVMTI_ENABLE, JVMTI_EVENT_OBJECT_FREE, NULL); ++ if (error != JVMTI_ERROR_NONE) { ++ return JNI_FALSE; ++ } ++ return JNI_TRUE; + } + + /* +- * Called once to build the initial prepared class hash table. ++ * Called once to initialize class-tracking. + */ + void + classTrack_initialize(JNIEnv *env) + { +- WITH_LOCAL_REFS(env, 1) { +- +- jint classCount; +- jclass *classes; +- jvmtiError error; +- jint i; ++ deletedSignatures = NULL; ++ classTrackLock = debugMonitorCreate("Deleted class tag lock"); ++ trackingEnv = getSpecialJvmti(); ++ if (trackingEnv == NULL) { ++ EXIT_ERROR(AGENT_ERROR_INTERNAL, "Failed to allocate tag-tracking jvmtiEnv"); ++ } + +- error = allLoadedClasses(&classes, &classCount); +- if ( error == JVMTI_ERROR_NONE ) { +- table = jvmtiAllocate(CT_HASH_SLOT_COUNT * sizeof(KlassNode *)); +- if (table != NULL) { +- (void)memset(table, 0, CT_HASH_SLOT_COUNT * sizeof(KlassNode *)); +- for (i=0; ihandlerID = external? ++requestIdCounter : 0; + error = eventFilterRestricted_install(node); ++ if (node->ei == EI_GC_FINISH) { ++ classTrack_activate(getEnv()); ++ } + if (error == JVMTI_ERROR_NONE) { + insert(getHandlerChain(node->ei), node); + } +diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/util.c b/src/jdk.jdwp.agent/share/native/libjdwp/util.c +--- a/src/jdk.jdwp.agent/share/native/libjdwp/util.c ++++ b/src/jdk.jdwp.agent/share/native/libjdwp/util.c +@@ -1742,7 +1742,7 @@ + } + + /* Get the jvmti environment to be used with tags */ +-static jvmtiEnv * ++jvmtiEnv * + getSpecialJvmti(void) + { + jvmtiEnv *jvmti; +diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/util.h b/src/jdk.jdwp.agent/share/native/libjdwp/util.h +--- a/src/jdk.jdwp.agent/share/native/libjdwp/util.h ++++ b/src/jdk.jdwp.agent/share/native/libjdwp/util.h +@@ -414,4 +414,6 @@ + void saveGlobalRef(JNIEnv *env, jobject obj, jobject *pobj); + void tossGlobalRef(JNIEnv *env, jobject *pobj); + ++jvmtiEnv* getSpecialJvmti(void); ++ + #endif diff --git a/SOURCES/jdk8241750-rh1826915-x86-32_8227269_fix.patch b/SOURCES/jdk8241750-rh1826915-x86-32_8227269_fix.patch new file mode 100644 index 0000000..19e3d18 --- /dev/null +++ b/SOURCES/jdk8241750-rh1826915-x86-32_8227269_fix.patch @@ -0,0 +1,30 @@ +# HG changeset patch +# User shade +# Date 1585332307 -3600 +# Fri Mar 27 19:05:07 2020 +0100 +# Node ID af6e51a97af59304b5e5ad41cd3ee344dcc54f0a +# Parent a51657b8d38904b7d8d6820c8826a65a62959f06 +8241750: x86_32 build failure after JDK-8227269 +Reviewed-by: rkennke, cjplummer + +diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c b/src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c +--- a/src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c ++++ b/src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c +@@ -69,7 +69,7 @@ + debugMonitorExit(classTrackLock); + return; + } +- *(char**)bagAdd(deletedSignatures) = (char*)tag; ++ *(char**)bagAdd(deletedSignatures) = (char*)jlong_to_ptr(tag); + + debugMonitorExit(classTrackLock); + } +@@ -117,7 +117,7 @@ + if (error != JVMTI_ERROR_NONE) { + EXIT_ERROR(error,"signature"); + } +- error = JVMTI_FUNC_PTR(trackingEnv, SetTag)(env, klass, (jlong)signature); ++ error = JVMTI_FUNC_PTR(trackingEnv, SetTag)(env, klass, ptr_to_jlong(signature)); + if (error != JVMTI_ERROR_NONE) { + jvmtiDeallocate(signature); + EXIT_ERROR(error,"SetTag"); diff --git a/SOURCES/jdk8245714-rh1828845-build_loop_late_crash.patch b/SOURCES/jdk8245714-rh1828845-build_loop_late_crash.patch new file mode 100644 index 0000000..3ebce49 --- /dev/null +++ b/SOURCES/jdk8245714-rh1828845-build_loop_late_crash.patch @@ -0,0 +1,129 @@ +# HG changeset patch +# User roland +# Date 1590664914 -7200 +# Thu May 28 13:21:54 2020 +0200 +# Node ID 516c889e7582598020e49ed62bcf77871fe315d8 +# Parent b2e6516f67ff98224f14e65beb944ddb04b24548 +8245714: "Bad graph detected in build_loop_late" when loads are pinned on loop limit check uncommon branch +Reviewed-by: thartmann + +diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp +--- a/src/hotspot/share/opto/loopPredicate.cpp ++++ b/src/hotspot/share/opto/loopPredicate.cpp +@@ -111,6 +111,9 @@ + CallNode* call = rgn->as_Call(); + IdealLoopTree* loop = get_loop(call); + rgn = new RegionNode(1); ++ Node* uncommon_proj_orig = uncommon_proj; ++ uncommon_proj = uncommon_proj->clone()->as_Proj(); ++ register_control(uncommon_proj, loop, iff); + rgn->add_req(uncommon_proj); + register_control(rgn, loop, uncommon_proj); + _igvn.replace_input_of(call, 0, rgn); +@@ -118,13 +121,9 @@ + if (_idom != NULL) { + set_idom(call, rgn, dom_depth(rgn)); + } +- for (DUIterator_Fast imax, i = uncommon_proj->fast_outs(imax); i < imax; i++) { +- Node* n = uncommon_proj->fast_out(i); +- if (n->is_Load() || n->is_Store()) { +- _igvn.replace_input_of(n, 0, rgn); +- --i; --imax; +- } +- } ++ // Move nodes pinned on the projection or whose control is set to ++ // the projection to the region. ++ lazy_replace(uncommon_proj_orig, rgn); + } else { + // Find region's edge corresponding to uncommon_proj + for (; proj_index < rgn->req(); proj_index++) +diff --git a/test/hotspot/jtreg/compiler/loopopts/TestBadControlLoopLimitCheck.java b/test/hotspot/jtreg/compiler/loopopts/TestBadControlLoopLimitCheck.java +new file mode 100644 +--- /dev/null ++++ b/test/hotspot/jtreg/compiler/loopopts/TestBadControlLoopLimitCheck.java +@@ -0,0 +1,85 @@ ++/* ++ * Copyright (c) 2020, 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 8245714 ++ * @requires vm.compiler2.enabled ++ * @summary "Bad graph detected in build_loop_late" when loads are pinned on loop limit check uncommon branch ++ * ++ * @run main/othervm -XX:-BackgroundCompilation -XX:ArrayCopyLoadStoreMaxElem=0 TestBadControlLoopLimitCheck ++ */ ++ ++public class TestBadControlLoopLimitCheck { ++ public static void main(String[] args) { ++ int[] int_array = {0, 0}; ++ A[] obj_array = {new A(), new A()}; ++ for (int i = 0; i < 20_000; i++) { ++ test1(int_array, 0, 10, false); ++ test_helper(42); ++ test2(obj_array, 0, 10, false); ++ } ++ } ++ ++ private static int test1(int[] a, int start, int stop, boolean flag) { ++ int[] b = new int[2]; // non escaping allocation ++ System.arraycopy(a, 0, b, 0, 2); // optimized out ++ int v = 1; ++ int j = 0; ++ for (; j < 10; j++); ++ int inc = test_helper(j); // delay transformation to counted loop ++ // loop limit check here has loads pinned on unc branch ++ for (int i = start; i < stop; i += inc) { ++ v *= 2; ++ } ++ if (flag) { ++ v += b[0] + b[1]; ++ } ++ return v; ++ } ++ ++ private static int test2(A[] a, int start, int stop, boolean flag) { ++ A[] b = new A[2]; // non escaping allocation ++ System.arraycopy(a, 0, b, 0, 2); // optimized out ++ int v = 1; ++ int j = 0; ++ for (; j < 10; j++); ++ int inc = test_helper(j); // delay transformation to counted loop ++ // loop limit check here has loads pinned on unc branch ++ for (int i = start; i < stop; i += inc) { ++ v *= 2; ++ } ++ if (flag) { ++ v += b[0].f + b[1].f; ++ } ++ return v; ++ } ++ ++ static class A { ++ int f; ++ } ++ ++ static int test_helper(int j) { ++ return j == 10 ? 10 : 1; ++ } ++} diff --git a/SPECS/java-11-openjdk.spec b/SPECS/java-11-openjdk.spec index cf3a09f..5375ead 100644 --- a/SPECS/java-11-openjdk.spec +++ b/SPECS/java-11-openjdk.spec @@ -21,6 +21,18 @@ # Enable release builds by default on relevant arches. %bcond_without release +# Workaround for stripping of debug symbols from static libraries +# RHEL 7 doesn't have __brp_strip_static_archive so need to redefine +# the entire os_install_post macro +%define __os_install_post \ + /usr/lib/rpm/redhat/brp-compress \ + %{!?__debug_package:\ + /usr/lib/rpm/redhat/brp-strip %{__strip} \ + /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ + } \ + %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \ +%{nil} + # The -g flag says to use strip -g instead of full strip on DSOs or EXEs. # This fixes detailed NMT and other tools which need minimal debug info. # See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879 @@ -103,12 +115,12 @@ %endif %if %{bootstrap_build} -%global release_targets bootcycle-images docs-zip +%global release_targets bootcycle-images static-libs-image docs-zip %else -%global release_targets images docs-zip +%global release_targets images docs-zip static-libs-image %endif # No docs nor bootcycle for debug builds -%global debug_targets images +%global debug_targets images static-libs-image # Filter out flags from the optflags macro that cause problems with the OpenJDK build @@ -135,51 +147,63 @@ # 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 +# does not match that given by _target_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 i686 +%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 %{_target_cpu} %endif # 64 bit sparc %ifarch sparc64 %global archinstall sparcv9 +%global stapinstall %{_target_cpu} %endif -%ifnarch %{jit_arches} -%global archinstall %{_arch} +# Need to support noarch for srpm build +%ifarch noarch +%global archinstall %{nil} +%global stapinstall %{nil} %endif - - %ifarch %{jit_arches} %global with_systemtap 1 %else @@ -205,14 +229,17 @@ %global lts_designator_zip "" %endif +# Define IcedTea version used for SystemTap tapsets and desktop file +%global icedteaver 3.15.0 + # Standard JPackage naming and versioning defines %global origin openjdk %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global minorver 0 %global buildver 10 -%global rpmrelease 0 -#%%global tagsuffix %%{nil} +%global rpmrelease 1 +#%%global tagsuffix %%{nil} # priority must be 7 digits in total # setting to 1, so debug ones can have 0 %global priority 00000%{minorver}1 @@ -240,8 +267,9 @@ # parametrized macros are order-sensitive %global compatiblename java-%{majorver}-%{origin} %global fullversion %{compatiblename}-%{version}-%{release} -# images stub -%global jdkimage jdk +# images directories from upstream build +%global jdkimage jdk +%global static_libs_image static-libs # output dir stub %global buildoutputdir() %{expand:openjdk/build%1} # we can copy the javadoc to not arched dir, or make it not noarch @@ -269,10 +297,10 @@ # and 32 bit architectures we place the tapsets under the arch # specific dir (note that systemtap will only pickup the tapset # for the primary arch for now). Systemtap uses the machine name -# aka build_cpu as architecture specific directory name. +# aka target_cpu as architecture specific directory name. %global tapsetroot /usr/share/systemtap %global tapsetdirttapset %{tapsetroot}/tapset/ -%global tapsetdir %{tapsetdirttapset}/%{_build_cpu} +%global tapsetdir %{tapsetdirttapset}/%{stapinstall} %endif # not-duplicated scriptlets for normal/debug packages @@ -723,6 +751,25 @@ exit 0 %{_jvmdir}/%{sdkdir %%1}/lib/src.zip } +%define files_static_libs() %{expand: +%{_jvmdir}/%{sdkdir %%1}/lib/libj2pkcs11.a +%{_jvmdir}/%{sdkdir %%1}/lib/libj2pcsc.a +%{_jvmdir}/%{sdkdir %%1}/lib/libnio.a +%{_jvmdir}/%{sdkdir %%1}/lib/libprefs.a +%{_jvmdir}/%{sdkdir %%1}/lib/libjava.a +%{_jvmdir}/%{sdkdir %%1}/lib/libjli.a +%{_jvmdir}/%{sdkdir %%1}/lib/libnet.a +%{_jvmdir}/%{sdkdir %%1}/lib/libjimage.a +%{_jvmdir}/%{sdkdir %%1}/lib/libjaas.a +%{_jvmdir}/%{sdkdir %%1}/lib/libfdlibm.a +%{_jvmdir}/%{sdkdir %%1}/lib/libj2gss.a +%{_jvmdir}/%{sdkdir %%1}/lib/libsunec.a +%{_jvmdir}/%{sdkdir %%1}/lib/libjsig.a +%{_jvmdir}/%{sdkdir %%1}/lib/libextnet.a +%{_jvmdir}/%{sdkdir %%1}/lib/libverify.a +%{_jvmdir}/%{sdkdir %%1}/lib/libzip.a +} + %define files_javadoc() %{expand: %doc %{_javadocdir}/%{uniquejavadocdir %%1} %license %{buildoutputdir %%1}/images/%{jdkimage}/legal @@ -829,6 +876,11 @@ Provides: java-%{javaver}-%{origin}-devel%1 = %{epoch}:%{version} } +%define java_static_libs_rpo() %{expand: +Requires: %{name}-devel%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +} + %define java_jmods_rpo() %{expand: # Requires devel package # as jmods are bytecode, they should be OK without any _isa @@ -915,10 +967,14 @@ License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv URL: http://openjdk.java.net/ -# to regenerate source0 (jdk) and source8 (jdk's taspets) run update_package.sh +# to regenerate source0 (jdk) run update_package.sh # update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives Source0: shenandoah-jdk%{majorver}-shenandoah-jdk-%{newjavaver}+%{buildver}%{?tagsuffix:-%{tagsuffix}}-4curve.tar.xz -Source8: systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz + +# Use 'icedtea_sync.sh' to update the following +# They are based on code contained in the IcedTea project (3.x). +# Systemtap tapsets. Zipped up to keep it small. +Source8: tapsets-icedtea-%{icedteaver}.tar.xz # Desktop files. Adapted from IcedTea Source9: jconsole.desktop.in @@ -981,6 +1037,22 @@ Patch8: s390-8214206_fix.patch # ############################################# +############################################# +# +# Patches appearing in 11.0.9 +# +# This section includes patches which are present +# in the listed OpenJDK 8u release and should be +# able to be removed once that release is out +# and used by this RPM. +############################################# +# JDK-8227269, RH1826915: Slow class loading when running with JDWP +Patch11: jdk8227269-rh1826915-slow_class_loading_with_jdwp.patch +# JDK-8241750, RH1826915: x86_32 build failure after JDK-8227269 +Patch12: jdk8241750-rh1826915-x86-32_8227269_fix.patch +# JDK-8245714, RH1828845: "Bad graph detected in build_loop_late" when loads are pinned on loop limit check uncommon branch +Patch13: jdk8245714-rh1828845-build_loop_late_crash.patch + BuildRequires: autoconf BuildRequires: automake BuildRequires: alsa-lib-devel @@ -994,13 +1066,6 @@ BuildRequires: freetype-devel BuildRequires: giflib-devel BuildRequires: gcc-c++ BuildRequires: gdb -%ifarch %{arm} -BuildRequires: devtoolset-7-build -BuildRequires: devtoolset-7-binutils -BuildRequires: devtoolset-7-gcc -BuildRequires: devtoolset-7-gcc-c++ -BuildRequires: devtoolset-7-gdb -%endif BuildRequires: gtk2-devel # LCMS on rhel7 is older then LCMS in intree JDK BuildRequires: lcms2-devel @@ -1097,6 +1162,27 @@ The %{origin_nice} development tools %{majorver}. %endif %if %{include_normal_build} +%package static-libs +Summary: %{origin_nice} libraries for static linking %{majorver} + +%{java_static_libs_rpo %{nil}} + +%description static-libs +The %{origin_nice} libraries for static linking %{majorver}. +%endif + +%if %{include_debug_build} +%package static-libs-debug +Summary: %{origin_nice} libraries for static linking %{majorver} %{debug_on} + +%{java_static_libs_rpo -- %{debug_suffix_unquoted}} + +%description static-libs-debug +The %{origin_nice} libraries for static linking %{majorver}. +%{debug_warning} +%endif + +%if %{include_normal_build} %package jmods Summary: JMods for %{origin_nice} %{majorver} Group: Development/Tools @@ -1162,7 +1248,7 @@ Group: Development/Languages %{java_src_rpo -- %{debug_suffix_unquoted}} %description src-debug -The java-%{origin}-src-slowdebug sub-package contains the complete %{origin_nice} %{majorver} +The java-%{origin}-src-debug sub-package contains the complete %{origin_nice} %{majorver} class library source code for use by IDE indexers and debuggers. Debugging %{for_debug}. %endif @@ -1215,6 +1301,14 @@ The %{origin_nice} %{majorver} API documentation compressed in a single archive %endif %prep + +# Using the echo macro breaks rpmdev-bumpspec, as it parses the first line of stdout :-( +%if 0%{?stapinstall:1} + echo "CPU: %{_target_cpu}, arch install directory: %{archinstall}, SystemTap install directory: %{stapinstall}" +%else + %{error:Unrecognised architecture %{_target_cpu}} +%endif + if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then echo "include_normal_build is %{include_normal_build}" else @@ -1255,6 +1349,9 @@ pushd %{top_level_dir_name} %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 popd # openjdk %patch1000 @@ -1269,7 +1366,7 @@ cp -r tapset tapset%{debug_suffix} for suffix in %{build_loop} ; do for file in "tapset"$suffix/*.in; do - OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:%{version}-%{release}.%{_arch}.stp:g"` + OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:-%{version}-%{release}.%{_arch}.stp:g"` sed -e "s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir $suffix}/lib/server/libjvm.so:g" $file > $file.1 # TODO find out which architectures other than i686 have a client vm %ifarch %{ix86} @@ -1286,16 +1383,18 @@ done %endif # Prepare desktop files +# The _X_ syntax indicates variables that are replaced by make upstream +# The @X@ syntax indicates variables that are replaced by configure upstream for suffix in %{build_loop} ; do for file in %{SOURCE9}; do FILE=`basename $file | sed -e s:\.in$::g` EXT="${FILE##*.}" NAME="${FILE%.*}" OUTPUT_FILE=$NAME$suffix.$EXT - sed -e "s:@JAVA_HOME@:%{sdkbindir $suffix}:g" $file > $OUTPUT_FILE - sed -i -e "s:@JRE_HOME@:%{jrebindir $suffix}:g" $OUTPUT_FILE - sed -i -e "s:@ARCH@:%{version}-%{release}.%{_arch}$suffix:g" $OUTPUT_FILE - sed -i -e "s:@JAVA_MAJOR_VERSION@:%{majorver}:g" $OUTPUT_FILE + sed -e "s:_SDKBINDIR_:%{sdkbindir $suffix}:g" $file > $OUTPUT_FILE + sed -i -e "s:@target_cpu@:%{_arch}:g" $OUTPUT_FILE + sed -i -e "s:@OPENJDK_VER@:%{version}-%{release}.%{_arch}$suffix:g" $OUTPUT_FILE + sed -i -e "s:@JAVA_VER@:%{javaver}:g" $OUTPUT_FILE sed -i -e "s:@JAVA_VENDOR@:%{origin}:g" $OUTPUT_FILE done done @@ -1305,10 +1404,6 @@ sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg %build -%ifarch %{arm} -%{?enable_devtoolset7:%{enable_devtoolset7}} -%endif - # How many CPU's do we have? export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=${NUM_PROC:-1} @@ -1453,6 +1548,11 @@ $JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLev $JAVA_HOME/bin/javac -d . %{SOURCE14} $JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") +# Check debug symbols in static libraries (smoke test) +export STATIC_LIBS_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{static_libs_image} +readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep w_remainder.c +readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep e_remainder.c + # Check debug symbols are present and can identify code find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib do @@ -1593,6 +1693,9 @@ pushd %{buildoutputdir $suffix}/images/%{jdkimage} rm -rf $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/man popd +# Install static libs artefacts +cp -a %{buildoutputdir -- $suffix}/images/%{static_libs_image}/lib/*.a \ + $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib # Install Javadoc documentation @@ -1774,6 +1877,9 @@ require "copy_jdk_configs.lua" %files devel %{files_devel %{nil}} +%files static-libs +%{files_static_libs %{nil}} + %files jmods %{files_jmods %{nil}} @@ -1804,6 +1910,9 @@ require "copy_jdk_configs.lua" %files devel-debug %{files_devel -- %{debug_suffix_unquoted}} +%files static-libs-debug +%{files_static_libs -- %{debug_suffix_unquoted}} + %files jmods-debug %{files_jmods -- %{debug_suffix_unquoted}} @@ -1821,115 +1930,154 @@ require "copy_jdk_configs.lua" %endif %changelog -* Sat Jul 11 2020 Andrew Hughes - 1:11.0.8.10-0 +* Sat Jul 11 2020 Andrew Hughes - 1:11.0.8.10-1 - Update to shenandoah-jdk-11.0.8+10 (GA) - Switch to GA mode for final release. - Update release notes with last minute fix (JDK-8248505). - This tarball is embargoed until 2020-07-14 @ 1pm PT. - Resolves: rhbz#1838811 -* Fri Jul 10 2020 Andrew Hughes - 1:11.0.8.9-0.0.ea +* Fri Jul 10 2020 Andrew Hughes - 1:11.0.8.9-0.1.ea - Update to shenandoah-jdk-11.0.8+9 (EA) - Update release notes for 11.0.8 release. - This tarball is embargoed until 2020-07-14 @ 1pm PT. - Resolves: rhbz#1838811 -* Sun Jul 05 2020 Andrew Hughes - 1:11.0.8.8-0.0.ea +* Sun Jul 05 2020 Andrew Hughes - 1:11.0.8.8-0.1.ea - Update to shenandoah-jdk-11.0.8+8 (EA) - Resolves: rhbz#1838811 -* Sat Jul 04 2020 Andrew Hughes - 1:11.0.8.7-0.1.ea +* Sat Jul 04 2020 Andrew Hughes - 1:11.0.8.7-0.2.ea - java-11-openjdk doesn't have a JRE tree, so don't try and copy alt-java there... - Resolves: rhbz#1838811 -* Sat Jul 04 2020 Jiri Vanek - 1:11.0.8.7-0.1.ea +* Sat Jul 04 2020 Jiri Vanek - 1:11.0.8.7-0.2.ea - Create a copy of java as alt-java with alternatives and man pages - Resolves: rhbz#1838811 -* Fri Jul 03 2020 Andrew Hughes - 1:11.0.8.7-0.0.ea +* Fri Jul 03 2020 Andrew Hughes - 1:11.0.8.7-0.1.ea - Update to shenandoah-jdk-11.0.8+7 (EA) - Resolves: rhbz#1838811 -* Thu Jul 02 2020 Andrew Hughes - 1:11.0.8.6-0.0.ea +* Thu Jul 02 2020 Andrew Hughes - 1:11.0.8.6-0.1.ea - Update to shenandoah-jdk-11.0.8+6 (EA) - Resolves: rhbz#1838811 -* Thu Jun 25 2020 Andrew Hughes - 1:11.0.8.5-0.0.ea +* Tue Jun 30 2020 Severin Gehwolf - 1:11.0.8.5-0.2.ea +- Disable stripping of debug symbols for static libraries part of + the -static-libs sub-package. +- Resolves: rhbz#1838811 + +* Thu Jun 25 2020 Andrew Hughes - 1:11.0.8.5-0.1.ea - Update to shenandoah-jdk-11.0.8+5 (EA) - Resolves: rhbz#1838811 -* Mon May 25 2020 Andrew Hughes - 1:11.0.8.4-0.0.ea +* Tue Jun 23 2020 Andrew Hughes - 1:11.0.8.4-0.1.ea - Update to shenandoah-jdk-11.0.8+4 (EA) - Require tzdata 2020a due to resource changes in JDK-8243541 - Resolves: rhbz#1838811 -* Tue May 19 2020 Andrew Hughes - 1:11.0.8.3-0.0.ea +* Fri Jun 19 2020 Andrew Hughes - 1:11.0.8.3-0.1.ea - Update to shenandoah-jdk-11.0.8+3 (EA) - Resolves: rhbz#1838811 -* Mon May 18 2020 Andrew Hughes - 1:11.0.8.2-0.0.ea +* Mon Jun 08 2020 Andrew Hughes - 1:11.0.8.2-0.3.ea +- Add backport of JDK-8245714 to fix crash in build_loop_late_post(Node*) +- Resolves: rhbz#1828845 + +* Thu Jun 04 2020 Andrew Hughes - 1:11.0.8.2-0.2.ea +- Use RHEL 7 format for handling the debug argument to the files_static_libs macro. +- Fix warning about macro in comment. +- Resolves: rhbz#1839091 + +* Wed Jun 03 2020 Severin Gehwolf - 1:11.0.8.2-0.2.ea +- Build static-libs-image and add resulting files via -static-libs sub-package. +- Resolves: rhbz#1839091 + +* Tue Jun 02 2020 Andrew Hughes - 1:11.0.8.2-0.1.ea - Update to shenandoah-jdk-11.0.8+2 (EA) - Resolves: rhbz#1838811 -* Sun May 10 2020 Andrew Hughes - 1:11.0.8.1-0.0.ea +* Mon May 25 2020 Andrew Hughes - 1:11.0.8.1-0.1.ea - Update to shenandoah-jdk-11.0.8+1 (EA) - Switch to EA mode for 11.0.8 pre-release builds. - Drop JDK-8237396 & JDK-8228407 backports now applied upstream. - Resolves: rhbz#1838811 -* Wed Apr 15 2020 Andrew Hughes - 1:11.0.7.10-4 +* Sat May 23 2020 Andrew John Hughes - 1:11.0.7.10-7 +- Add backports of JDK-8227269 & JDK-8241750 to resolve slow class loading with JDWP enabled. +- Resolves: rhbz#1826915 + +* Mon Apr 20 2020 Andrew John Hughes - 1:11.0.7.10-6 +- Introduce stapinstall variable to set SystemTap arch directory correctly (e.g. arm64 on aarch64) +- Need to support noarch for creating source RPMs for non-scratch builds. +- Resolves: rhbz#1737114 + +* Mon Apr 20 2020 Andrew John Hughes - 1:11.0.7.10-6 +- Sync SystemTap & desktop files with upstream IcedTea release 3.15.0 +- Resolves: rhbz#1737114 + +* Mon Apr 20 2020 Andrew John Hughes - 1:11.0.7.10-6 +- Sync SystemTap & desktop files with upstream IcedTea release 3.11.0 using new script +- Resolves: rhbz#1737114 + +* Thu Apr 16 2020 Andrew Hughes - 1:11.0.7.10-5 - Add JDK-8228407 backport to resolve crashes during verification. - Resolves: rhbz#1810557 -* Tue Apr 14 2020 Andrew Hughes - 1:11.0.7.10-3 +* Thu Apr 16 2020 Andrew Hughes - 1:11.0.7.10-5 - Amend release notes, removing issue actually fixed in 11.0.6. - Resolves: rhbz#1810557 -* Mon Apr 13 2020 Andrew Hughes - 1:11.0.7.10-2 +* Thu Apr 16 2020 Andrew Hughes - 1:11.0.7.10-5 - Add release notes. - Resolves: rhbz#1810557 -* Mon Apr 13 2020 Andrew Hughes - 1:11.0.7.10-1 -- Make use of --with-extra-asflags introduced in jdk-11.0.6+1. -- Resolves: rhbz#1810557 - -* Tue Mar 31 2020 Andrew Hughes - 1:11.0.7.10-0 +* Thu Apr 16 2020 Andrew Hughes - 1:11.0.7.10-5 - Update to shenandoah-jdk-11.0.7+10 (GA) - Switch to GA mode for final release. - Resolves: rhbz#1810557 -* Sat Mar 28 2020 Andrew Hughes - 1:11.0.7.9-0.0.ea +* Mon Apr 13 2020 Andrew Hughes - 1:11.0.7.9-0.2.ea +- Make use of --with-extra-asflags introduced in jdk-11.0.6+1. +- Resolves: rhbz#1810557 + +* Sat Mar 28 2020 Andrew Hughes - 1:11.0.7.9-0.1.ea - Update to shenandoah-jdk-11.0.7+9 (EA) - Resolves: rhbz#1810557 -* Sat Mar 28 2020 Andrew Hughes - 1:11.0.7.8-0.0.ea +* Sat Mar 28 2020 Andrew Hughes - 1:11.0.7.8-0.1.ea - Update to shenandoah-jdk-11.0.7+8 (EA) - Resolves: rhbz#1810557 -* Sat Mar 28 2020 Andrew Hughes - 1:11.0.7.7-0.0.ea +* Sat Mar 28 2020 Andrew Hughes - 1:11.0.7.7-0.1.ea - Update to shenandoah-jdk-11.0.7+7 (EA) - Resolves: rhbz#1810557 -* Mon Mar 16 2020 Andrew Hughes - 1:11.0.7.6-0.0.ea +* Thu Mar 19 2020 Andrew Hughes - 1:11.0.7.6-0.1.ea - Update to shenandoah-jdk-11.0.7+6 (EA) - Resolves: rhbz#1810557 -* Sun Mar 15 2020 Andrew Hughes - 1:11.0.7.5-0.0.ea +* Thu Mar 19 2020 Andrew Hughes - 1:11.0.7.5-0.1.ea - Update to shenandoah-jdk-11.0.7+5 (EA) - Resolves: rhbz#1810557 -* Fri Feb 28 2020 Andrew Hughes - 1:11.0.7.4-0.0.ea +* Thu Mar 19 2020 Andrew Hughes - 1:11.0.7.4-0.1.ea - Update to shenandoah-jdk-11.0.7+4 (EA) - Resolves: rhbz#1810557 -* Tue Feb 18 2020 Andrew Hughes - 1:11.0.7.3-0.0.ea +* Thu Mar 19 2020 Andrew Hughes - 1:11.0.7.3-0.1.ea - Update to shenandoah-jdk-11.0.7+3 (EA) - Resolves: rhbz#1810557 -* Sun Feb 16 2020 Andrew Hughes - 1:11.0.7.2-0.0.ea +* Thu Mar 19 2020 Andrew Hughes - 1:11.0.7.2-0.1.ea - Update to shenandoah-jdk-11.0.7+2 (EA) - Resolves: rhbz#1810557 +* Thu Mar 19 2020 Andrew John Hughes - 1:11.0.7.1-0.1.ea +- Bump release for y-stream branch. +- Resolves: rhbz#1810557 + * Sun Feb 16 2020 Andrew Hughes - 1:11.0.7.1-0.0.ea - Update to shenandoah-jdk-11.0.7+1 (EA) - Switch to EA mode for 11.0.7 pre-release builds.