diff --git a/.gitignore b/.gitignore index 3bc325a..571ea50 100644 --- a/.gitignore +++ b/.gitignore @@ -119,3 +119,5 @@ /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u181-b04.tar.xz /aarch64-port-jdk8u-aarch64-jdk8u181-b13.tar.xz /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u181-b13.tar.xz +/systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz +/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u181-b15.tar.xz diff --git a/8165489-pr3589.patch b/8165489-pr3589.patch deleted file mode 100644 index 1674dec..0000000 --- a/8165489-pr3589.patch +++ /dev/null @@ -1,123 +0,0 @@ -# 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/8165852-pr3468.patch b/8165852-pr3468.patch deleted file mode 100644 index 6a9f643..0000000 --- a/8165852-pr3468.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java 2017-08-23 11:40:26.690809603 +0200 -+++ openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java 2017-08-23 11:44:28.314815334 +0200 -@@ -74,8 +74,16 @@ - } catch (UnixException x) { - x.rethrowAsIOException(parent); - } -- if (attrs.dev() != dev()) -- break; -+ if (attrs.dev() != dev()) { -+ -+ // step 3: lookup mounted file systems (use /proc/mounts to ensure we -+ // find the file system even when not in /etc/mtab) -+ byte[] dir = path.asByteArray(); -+ for (UnixMountEntry entry: fs.getMountEntries("/proc/mounts")) { -+ if (Arrays.equals(dir, entry.dir())) -+ return entry; -+ } -+ } - path = parent; - parent = parent.getParent(); - } diff --git a/8196516-pr3523-rh1538767.patch b/8196516-pr3523-rh1538767.patch deleted file mode 100644 index b321611..0000000 --- a/8196516-pr3523-rh1538767.patch +++ /dev/null @@ -1,33 +0,0 @@ -# HG changeset patch -# User sgehwolf -# Date 1523360781 -7200 -# Tue Apr 10 13:46:21 2018 +0200 -# Node ID 5f2401aef9acb6998f06cb82fdd8a84eda3e63ad -# Parent 656ab3b39178c1e4de644d490613bfd8212ae924 -8196516: libfontmanager must be built with LDFLAGS allowing unresolved symbols -Summary: Fixes build failures on some sustems with custom LDFLAGS settings. - -diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk ---- a/make/lib/Awt2dLibraries.gmk -+++ b/make/lib/Awt2dLibraries.gmk -@@ -927,6 +927,10 @@ ifeq ($(OPENJDK_TARGET_OS), linux) - BUILD_LIBFONTMANAGER_IndicRearrangementProcessor2.cpp_CXXFLAGS := -fno-strict-overflow - endif - -+# LDFLAGS clarification: -+# Filter relevant linker flags disallowing unresolved symbols as we cannot -+# build-time decide to which library to link against (libawt_headless or -+# libawt_xawt). See JDK-8196516 for details. - $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ - LIBRARY := fontmanager, \ - OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ -@@ -941,7 +945,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ - CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ - -DCC_NOEX, \ - MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ -- LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ -+ LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \ -+ $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \ - $(call SET_SHARED_LIBRARY_ORIGIN), \ - LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \ - LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \ diff --git a/generate_singlerepo_source_tarball.sh b/generate_singlerepo_source_tarball.sh new file mode 100644 index 0000000..62218ba --- /dev/null +++ b/generate_singlerepo_source_tarball.sh @@ -0,0 +1,145 @@ +#!/bin/bash +# Generates the 'source tarball' for JDK projects. +# +# Example: +# When used from local repo set REPO_ROOT pointing to file:// with your repo +# if your local repo follows upstream forests conventions, you may be enough by setting OPENJDK_URL +# if you wont to use local copy of patch PR2126 set path to it to PR2126 variable +# +# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg: +# PROJECT_NAME=jdk +# REPO_NAME=jdk +# VERSION=tip +# or to eg prepare systemtap: +# icedtea7's jstack and other tapsets +# VERSION=6327cf1cea9e +# REPO_NAME=icedtea7-2.6 +# PROJECT_NAME=release +# OPENJDK_URL=http://icedtea.classpath.org/hg/ +# TO_COMPRESS="*/tapset" +# +# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set) + +# This script creates a single source tarball out of the repository +# based on the given tag and removes code not allowed in fedora/rhel. For +# consistency, the source tarball will always contain 'openjdk' as the top +# level folder, name is created, based on parameter +# + +if [ ! "x$PR2126" = "x" ] ; then + if [ ! -f "$PR2126" ] ; then + echo "You have specified PR2126 as $PR2126 but it does not exists. exiting" + exit 1 + fi +fi + +set -e + +OPENJDK_URL_DEFAULT=http://hg.openjdk.java.net +COMPRESSION_DEFAULT=xz + +if [ "x$1" = "xhelp" ] ; then + echo -e "Behaviour may be specified by setting the following variables:\n" + echo "VERSION - the version of the specified OpenJDK project" + echo "PROJECT_NAME -- the name of the OpenJDK project being archived (optional; only needed by defaults)" + echo "REPO_NAME - the name of the OpenJDK repository (optional; only needed by defaults)" + echo "OPENJDK_URL - the URL to retrieve code from (optional; defaults to ${OPENJDK_URL_DEFAULT})" + echo "COMPRESSION - the compression type to use (optional; defaults to ${COMPRESSION_DEFAULT})" + echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to PROJECT_NAME-REPO_NAME-VERSION)" + echo "REPO_ROOT - the location of the Mercurial repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME)" + echo "TO_COMPRESS - what part of clone to pack (default is openjdk)" + echo "PR2126 - the path to the PR2126 patch to apply (optional; downloaded if unavailable)" + exit 1; +fi + + +if [ "x$VERSION" = "x" ] ; then + echo "No VERSION specified" + exit -2 +fi +echo "Version: ${VERSION}" + +# REPO_NAME is only needed when we default on REPO_ROOT and FILE_NAME_ROOT +if [ "x$FILE_NAME_ROOT" = "x" -o "x$REPO_ROOT" = "x" ] ; then + if [ "x$PROJECT_NAME" = "x" ] ; then + echo "No PROJECT_NAME specified" + exit -1 + fi + echo "Project name: ${PROJECT_NAME}" + if [ "x$REPO_NAME" = "x" ] ; then + echo "No REPO_NAME specified" + exit -3 + fi + echo "Repository name: ${REPO_NAME}" +fi + +if [ "x$OPENJDK_URL" = "x" ] ; then + OPENJDK_URL=${OPENJDK_URL_DEFAULT} + echo "No OpenJDK URL specified; defaulting to ${OPENJDK_URL}" +else + echo "OpenJDK URL: ${OPENJDK_URL}" +fi + +if [ "x$COMPRESSION" = "x" ] ; then + # rhel 5 needs tar.gz + COMPRESSION=${COMPRESSION_DEFAULT} +fi +echo "Creating a tar.${COMPRESSION} archive" + +if [ "x$FILE_NAME_ROOT" = "x" ] ; then + FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} + echo "No file name root specified; default to ${FILE_NAME_ROOT}" +fi +if [ "x$REPO_ROOT" = "x" ] ; then + REPO_ROOT="${OPENJDK_URL}/${PROJECT_NAME}/${REPO_NAME}" + echo "No repository root specified; default to ${REPO_ROOT}" +fi; + +if [ "x$TO_COMPRESS" = "x" ] ; then + TO_COMPRESS="openjdk" + echo "No to be compressed targets specified, ; default to ${TO_COMPRESS}" +fi; + +if [ -d ${FILE_NAME_ROOT} ] ; then + echo "exists exists exists exists exists exists exists " + echo "reusing reusing reusing reusing reusing reusing " + echo ${FILE_NAME_ROOT} +else + mkdir "${FILE_NAME_ROOT}" + pushd "${FILE_NAME_ROOT}" + echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" + hg clone ${REPO_ROOT} openjdk -r ${VERSION} + popd +fi +pushd "${FILE_NAME_ROOT}" + if [ -d openjdk/src ]; then + pushd openjdk + echo "Removing EC source code we don't build" + CRYPTO_PATH=src/jdk.crypto.ec/share/native/libsunec/impl + rm -vrf $CRYPTO_PATH + echo "Syncing EC list with NSS" + if [ "x$PR2126" = "x" ] ; then + # orriginally for 8: + # get pr2126.patch (from http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=8d2c9a898f50) from most correct tag + # Do not push it or publish it (see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2126) + # there is currnetly no "upstram version of this patch, hardcoding custom version + PR2126="../../pr2126-11.patch" + fi; + echo "Applying ${PR2126}" + patch -Np1 < $PR2126 + find . -name '*.orig' -exec rm -vf '{}' ';' + popd + fi + + echo "Compressing remaining forest" + if [ "X$COMPRESSION" = "Xxz" ] ; then + SWITCH=cJf + else + SWITCH=czf + fi + tar --exclude-vcs -$SWITCH ${FILE_NAME_ROOT}.tar.${COMPRESSION} $TO_COMPRESS + mv ${FILE_NAME_ROOT}.tar.${COMPRESSION} .. +popd +echo "Done. You may want to remove the uncompressed version - $FILE_NAME_ROOT." + + diff --git a/generate_tarballs.sh b/generate_tarballs.sh deleted file mode 100755 index 0c5930d..0000000 --- a/generate_tarballs.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -VERSION=3506c375241e -ICEDTEA_URL=http://icedtea.classpath.org/hg/icedtea7/ - -wget -O icedtea7.tar.gz ${ICEDTEA_URL}/archive/${VERSION}.tar.gz -tar xzf icedtea7.tar.gz -rm -f icedtea7.tar.gz -pushd icedtea7-${VERSION} - -# desktop files -#mv jconsole.desktop ../jconsole.desktop.in -#mv policytool.desktop ../policytool.desktop.in -# Icons were generally cloned fromicedtea, but now are mucvh more specific - -# tapsets -mv tapset/hotspot{,-1.8.0}.stp.in || exit 1 -mv tapset/hotspot_gc{,-1.8.0}.stp.in || exit 1 -mv tapset/hotspot_jni{,-1.8.0}.stp.in || exit 1 -mv tapset/jstack{,-1.8.0}.stp.in || exit 1 -tar cvzf systemtap-tapset.tar.gz tapset -mv systemtap-tapset.tar.gz ../ - -popd -rm -rf icedtea7-${VERSION} diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 3e3e9a0..5c33e7d 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -219,12 +219,13 @@ %global origin_nice OpenJDK %global top_level_dir_name %{origin} # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. -%global project aarch64-port -%global repo jdk8u -%global revision aarch64-jdk8u181-b13 %global shenandoah_project aarch64-port %global shenandoah_repo jdk8u-shenandoah -%global shenandoah_revision aarch64-shenandoah-jdk8u181-b13 +%global shenandoah_revision aarch64-shenandoah-jdk8u181-b15 +# Define old aarch64/jdk8u tree variables for compatibility +%global project %{shenandoah_project} +%global repo %{shenandoah_repo} +%global revision %{shenandoah_revision} # eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) %global whole_update %(VERSION=%{revision}; echo ${VERSION%%-*}) @@ -236,7 +237,6 @@ %global priority %(TIP=1800%{updatever}; echo ${TIP/tip/999}) %global javaver 1.%{majorver}.0 -%global systemtap_javaver 9 # parametrized macros are order-sensitive %global compatiblename %{name} @@ -961,7 +961,7 @@ Provides: java-%{javaver}-%{origin}-accessibility = %{epoch}:%{version}-%{releas Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: 7%{?dist} +Release: 0%{?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 @@ -989,31 +989,23 @@ Group: Development/Languages License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib URL: http://openjdk.java.net/ -# aarch64-port now contains integration forest of both aarch64 and normal jdk -# Source from upstream OpenJDK8 project. To regenerate, use -# VERSION=%%{revision} FILE_NAME_ROOT=%%{project}-%%{repo}-${VERSION} -# REPO_ROOT= generate_source_tarball.sh -# where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} -Source0: %{project}-%{repo}-%{revision}.tar.xz - # Shenandoah HotSpot # aarch64-port/jdk8u-shenandoah contains an integration forest of # OpenJDK 8u, the aarch64 port and Shenandoah # To regenerate, use: # VERSION=%%{shenandoah_revision} # FILE_NAME_ROOT=%%{shenandoah_project}-%%{shenandoah_repo}-${VERSION} -# REPO_ROOT= REPOS=hotspot generate_source_tarball.sh +# REPO_ROOT= generate_source_tarball.sh # where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} -Source1: %{shenandoah_project}-%{shenandoah_repo}-%{shenandoah_revision}.tar.xz +Source0: %{shenandoah_project}-%{shenandoah_repo}-%{shenandoah_revision}.tar.xz # Custom README for -src subpackage Source2: README.md -# Use 'generate_tarballs.sh' to generate the following tarballs -# 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 +# run update_systemtap.sh to regenerate or update systemtap sources +# update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives +Source8: systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz # Desktop files. Adapted from IcedTea Source9: jconsole.desktop.in @@ -1154,8 +1146,6 @@ Patch575: 8197981-pr3548.patch Patch576: 8064786-pr3599.patch # 8062808, PR3548: Turn on the -Wreturn-type warning Patch577: 8062808-pr3548.patch -# 8165852, PR3468: (fs) Mount point not found for a file which is present in overlayfs -Patch210: 8165852-pr3468.patch # 8207057, PR3613: Enable debug information for assembly code files Patch206: 8207057-pr3613-hotspot-assembler-debuginfo.patch @@ -1182,11 +1172,6 @@ Patch565: 8185723-pr3553.patch Patch566: 8186461-pr3557.patch # 8201509, PR3579: Zero: S390 31bit atomic_copy64 inline assembler is wrong Patch569: 8201509-pr3579.patch -# 8165489, PR3589: Missing G1 barrier in Unsafe_GetObjectVolatile -Patch570: 8165489-pr3589.patch -# 8196516, RH1538767: libfontmanager.so needs to be built with LDFLAGS so as to allow -# linking with unresolved symbols. -Patch531: 8196516-pr3523-rh1538767.patch # 8075942, PR3602: ArrayIndexOutOfBoundsException in sun.java2d.pisces.Dasher.goTo Patch578: 8075942-pr3602-rh1582032.patch # 8203182, PR3603: Release session if initialization of SunPKCS11 Signature fails @@ -1220,6 +1205,12 @@ Patch539: pr2888.patch # PR3575, RH1567204: System cacerts database handling should not affect jssecacerts Patch540: pr3575-rh1567204.patch +# Shenandoah fixes +# PR3619: Shenandoah broken on s390 +Patch582: pr3619.patch +# PR3620: Shenandoah broken on ppc64 +Patch583: pr3620.patch + ############################################# # # Non-OpenJDK fixes @@ -1530,17 +1521,7 @@ if [ $prioritylength -ne 7 ] ; then exit 14 fi # For old patches -ln -s openjdk jdk8 -%if %{use_shenandoah_hotspot} -# On Shenandoah-supported architectures, replace HotSpot with -# the Shenandoah version -pushd openjdk -tar -xf %{SOURCE1} -rm -rf hotspot -mv openjdk/hotspot . -rm -rf openjdk -popd -%endif +ln -s %{top_level_dir_name} jdk8 cp %{SOURCE2} . @@ -1565,7 +1546,6 @@ sh %{SOURCE12} %patch204 %patch205 %patch206 -%patch210 %patch300 @@ -1614,9 +1594,6 @@ sh %{SOURCE12} %patch530 %patch538 %patch560 -pushd openjdk/jdk -%patch531 -p1 -popd %patch561 %patch562 %patch563 @@ -1647,17 +1624,15 @@ popd %patch534 %endif -# Shenandoah-only patches -%if %{use_shenandoah_hotspot} -%else -%patch570 -%endif +# Shenandoah patches +%patch582 +%patch583 %patch1000 # Extract systemtap tapsets %if %{with_systemtap} -tar -x -I xz -f %{SOURCE8} +tar --strip-components=1 -x -I xz -f %{SOURCE8} %if %{include_debug_build} cp -r tapset tapset%{debug_suffix} %endif @@ -1665,7 +1640,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:%{systemtap_javaver}\.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}/jre/lib/%{archinstall}/server/libjvm.so:g" $file > $file.1 # TODO find out which architectures other than i686 have a client vm %ifarch %{ix86} @@ -2296,6 +2271,47 @@ require "copy_jdk_configs.lua" %endif %changelog +* Mon Aug 27 2018 Severin Gehwolf - 1:1.8.0.181.b13-9 +- Adjust system jpeg patch, system-libjpeg.patch, so as to filter + -Wl,--as-needed. Resolves RHBZ#1622186. + +* Mon Aug 27 2018 Severin Gehwolf - 1:1.8.0.181.b13-8 +- Adjust system NSS patch, pr1983-jdk.patch, so as to filter + -Wl,--as-needed. Resolves RHBZ#1622186. + +* Thu Aug 23 2018 Andrew Hughes - 1:1.8.0.181.b15-0 +- Move to single OpenJDK tarball build, based on aarch64/shenandoah-jdk8u. +- Update to aarch64-shenandoah-jdk8u181-b15. +- Drop 8165489-pr3589.patch which was only applied to aarch64/jdk8u builds. +- Move buildver to where it should be in the OpenJDK version. +- Split ppc64 Shenandoah fix into separate patch file with its own bug ID (PR3620). +- Update pr3539-rh1548475.patch to apply after 8187045. +- Resolves: rhbz#1594249 + +* Sat Aug 11 2018 Andrew Hughes - 1:1.8.0.181-8.b13 +- Remove unneeded functions from ppc shenandoahBarrierSet. +- Resolves: rhbz#1594249 + +* Wed Aug 08 2018 Andrew Hughes - 1:1.8.0.181-8.b13 +- Add missing shenandoahBarrierSet implementation for ppc64{be,le}. +- Resolves: rhbz#1594249 + +* Tue Aug 07 2018 Andrew Hughes - 1:1.8.0.181-8.b13 +- Fix wrong format specifiers in Shenandoah code. +- Resolves: rhbz#1594249 + +* Tue Aug 07 2018 Andrew Hughes - 1:1.8.0.181-8.b13 +- Avoid changing variable types to fix size_t, at least for now. +- Resolves: rhbz#1594249 + +* Tue Aug 07 2018 Andrew Hughes - 1:1.8.0.181-8.b13 +- More size_t fixes for Shenandoah. +- Resolves: rhbz#1594249 + +* Fri Aug 03 2018 Andrew Hughes - 1:1.8.0.181-8.b13 +- Add additional s390 size_t case for Shenandoah. +- Resolves: rhbz#1594249 + * Wed Aug 01 2018 Jiri Vanek - 1:1.8.0.181.b13-7 - build number moved from release to version diff --git a/pr1983-jdk.patch b/pr1983-jdk.patch index 673b8a9..31c285b 100644 --- a/pr1983-jdk.patch +++ b/pr1983-jdk.patch @@ -41,8 +41,13 @@ diff -r 984a4af2ed4e make/lib/SecurityLibraries.gmk LANG := C++, \ OPTIMIZATION := LOW, \ CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \ -@@ -248,8 +257,8 @@ - LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ +@@ -245,11 +254,12 @@ + CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \ + $(BUILD_LIBSUNEC_FLAGS), \ + MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsunec/mapfile-vers, \ +- LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ ++ LDFLAGS := $(subst -Xlinker --as-needed,, \ ++ $(subst -Wl$(COMMA)--as-needed,, $(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK), \ LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_SUFFIX := $(LIBCXX), \ - LDFLAGS_SUFFIX_linux := -lc, \ diff --git a/pr3539-rh1548475.patch b/pr3539-rh1548475.patch index 492a080..9b40a7f 100644 --- a/pr3539-rh1548475.patch +++ b/pr3539-rh1548475.patch @@ -85,8 +85,8 @@ diff --git openjdk.orig/hotspot/make/linux/makefiles/jsig.make openjdk/hotspot/m # 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 += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) $(LDFLAGS_NO_EXEC_STACK) ++LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) $(LDFLAGS_NO_EXEC_STACK) $(EXTRA_LDFLAGS) # DEBUG_BINARIES overrides everything, use full -g debug information ifeq ($(DEBUG_BINARIES), true) @@ -105,7 +105,7 @@ diff --git openjdk.orig/hotspot/make/linux/makefiles/saproc.make openjdk/hotspot 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 @@ +@@ -122,7 +122,7 @@ # Extra flags from gnumake's invocation or environment CFLAGS += $(EXTRA_CFLAGS) diff --git a/pr3619.patch b/pr3619.patch new file mode 100644 index 0000000..3c8631f --- /dev/null +++ b/pr3619.patch @@ -0,0 +1,45 @@ +diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp openjdk/hotspot/src/share/vm/gc_implementation/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp ++++ openjdk/hotspot/src/share/vm/gc_implementation/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp +@@ -108,7 +108,7 @@ + step = MIN2(step, (intx) MaxNormalStep); + + log_info(gc, ergo)("Capacity: " SIZE_FORMAT "M, Peak Occupancy: " SIZE_FORMAT +- "M, Lowest Free: " SIZE_FORMAT "M, Free Threshold: " UINTX_FORMAT "M", ++ "M, Lowest Free: " SIZE_FORMAT "M, Free Threshold: " SIZE_FORMAT "M", + capacity / M, _peak_occupancy / M, + (capacity - _peak_occupancy) / M, ShenandoahMinFreeThreshold * capacity / 100 / M); + +diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/shenandoah/heuristics/shenandoahStaticHeuristics.cpp openjdk/hotspot/src/share/vm/gc_implementation/shenandoah/heuristics/shenandoahStaticHeuristics.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/shenandoah/heuristics/shenandoahStaticHeuristics.cpp ++++ openjdk/hotspot/src/share/vm/gc_implementation/shenandoah/heuristics/shenandoahStaticHeuristics.cpp +@@ -36,7 +36,7 @@ + } + + void ShenandoahStaticHeuristics::print_thresholds() { +- log_info(gc, init)("Shenandoah heuristics thresholds: allocation "SIZE_FORMAT", free "SIZE_FORMAT", garbage "SIZE_FORMAT, ++ log_info(gc, init)("Shenandoah heuristics thresholds: allocation "UINTX_FORMAT", free "UINTX_FORMAT", garbage "UINTX_FORMAT, + ShenandoahAllocationThreshold, + ShenandoahFreeThreshold, + ShenandoahGarbageThreshold); +diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.cpp openjdk/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.cpp ++++ openjdk/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.cpp +@@ -539,7 +539,7 @@ + } + size_t average_heap_size = (initial_heap_size + max_heap_size) / 2; + region_size = MAX2(average_heap_size / ShenandoahTargetNumRegions, +- ShenandoahMinRegionSize); ++ (size_t) ShenandoahMinRegionSize); + + // Now make sure that we don't go over or under our limits. + region_size = MAX2(ShenandoahMinRegionSize, region_size); +@@ -573,7 +573,7 @@ + // Otherwise, mem-protecting one region may falsely protect the adjacent + // regions too. + if (UseLargePages) { +- region_size = MAX2(region_size, os::large_page_size()); ++ region_size = MAX2((size_t) region_size, os::large_page_size()); + } + + int region_size_log = log2_long((jlong) region_size); diff --git a/pr3620.patch b/pr3620.patch new file mode 100644 index 0000000..206828d --- /dev/null +++ b/pr3620.patch @@ -0,0 +1,70 @@ +diff --git openjdk.orig/hotspot/make/excludeSrc.make openjdk/hotspot/make/excludeSrc.make +--- openjdk.orig/hotspot/make/excludeSrc.make ++++ openjdk/hotspot/make/excludeSrc.make +@@ -121,6 +121,7 @@ + Src_Files_EXCLUDE += \ + shenandoahBarrierSet_x86.cpp \ + shenandoahBarrierSet_aarch64.cpp \ ++ shenandoahBarrierSet_ppc.cpp \ + shenandoahBarrierSet_sparc.cpp \ + shenandoahBarrierSet_zero.cpp + endif +diff --git openjdk.orig/hotspot/src/cpu/ppc/vm/shenandoahBarrierSet_ppc.cpp openjdk/hotspot/src/cpu/ppc/vm/shenandoahBarrierSet_ppc.cpp +new file mode 100644 +--- /dev/null ++++ openjdk/hotspot/src/cpu/ppc/vm/shenandoahBarrierSet_ppc.cpp +@@ -0,0 +1,54 @@ ++/* ++ * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "gc_implementation/shenandoah/brooksPointer.hpp" ++#include "gc_implementation/shenandoah/shenandoahBarrierSet.inline.hpp" ++ ++#include "asm/macroAssembler.hpp" ++#include "interpreter/interpreter.hpp" ++ ++#define __ masm-> ++ ++#ifndef CC_INTERP ++ ++void ShenandoahBarrierSet::interpreter_read_barrier(MacroAssembler* masm, Register dst) { ++ Unimplemented(); ++} ++ ++void ShenandoahBarrierSet::interpreter_read_barrier_not_null(MacroAssembler* masm, Register dst) { ++ Unimplemented(); ++} ++ ++void ShenandoahBarrierSet::interpreter_write_barrier(MacroAssembler* masm, Register dst) { ++ Unimplemented(); ++} ++ ++void ShenandoahBarrierSet::asm_acmp_barrier(MacroAssembler* masm, Register op1, Register op2) { ++ Unimplemented(); ++} ++ ++void ShenandoahHeap::compile_prepare_oop(MacroAssembler* masm, Register obj) { ++ Unimplemented(); ++} ++#endif diff --git a/sources b/sources index c3c111b..f10b98c 100644 --- a/sources +++ b/sources @@ -1,3 +1,2 @@ -SHA512 (systemtap-tapset-3.6.0pre02.tar.xz) = 848f42ef7ca751e723fd50e3a6da14c0965ad4da37ea3331568658e27497b7a7e4b9aad3dedd264ad0bb5566c37a92302b905f10258a4e2c89dc4ba609e55481 -SHA512 (aarch64-port-jdk8u-aarch64-jdk8u181-b13.tar.xz) = d22ddb8b0b76faa18067fe383a147345be5fe1bad77b50940ff2993f3356166143e5ac9e14d9ead4437c13b00c6b2a5c62093ad57645da15a3419238990a74ac -SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u181-b13.tar.xz) = b5611a5b13a8aa3c0e07e015e39b11241f96124bb9454d4151c54d4e9af004ea038cc3a27e3b9099b3061bb9225cb298551e0e726f79bc9bc9837aa912f1586c +SHA512 (systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz) = cf578221b77d8c7e019f69909bc86c419c5fb5e10bceba9592ff6e7f96887b0a7f07c9cefe90800975247a078785ca190fdec5c2d0f841bb447cee784b570f7d +SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u181-b15.tar.xz) = d8cdb9b7ef129ba8a07332ca3e4c56ad9e6cc84c4977cbad601b67deeecec44c0f3b95f219d603e063bd7b89bf6515151111fe021cf36132b9b4cc47c1d1d12c diff --git a/system-libjpeg.patch b/system-libjpeg.patch index fa01115..003f32b 100644 --- a/system-libjpeg.patch +++ b/system-libjpeg.patch @@ -51,7 +51,7 @@ diff -ruN jdk8/common/autoconf/libraries.m4 jdk8/common/autoconf/libraries.m4 diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries.gmk --- jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-10-31 19:44:18.000000000 -0400 +++ jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 21:56:01.020796703 -0500 -@@ -696,17 +696,17 @@ +@@ -693,17 +693,17 @@ ########################################################################################## ifdef OPENJDK @@ -75,7 +75,7 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. endif endif -@@ -721,37 +721,37 @@ +@@ -718,37 +718,38 @@ # $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \ # \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) ) # ifeq ($(CC_43_OR_NEWER), 1) @@ -101,7 +101,8 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. - MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \ - LDFLAGS := $(LDFLAGS_JDKLIB) \ + MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \ -+ LDFLAGS := $(LDFLAGS_JDKLIB) -ljpeg \ ++ LDFLAGS := $(subst -Xlinker --as-needed,, \ ++ $(subst -Wl$(COMMA)--as-needed,, $(LDFLAGS_JDKLIB))) -ljpeg \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \ LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \ @@ -126,7 +127,7 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. ########################################################################################## -@@ -1183,7 +1183,6 @@ +@@ -1127,7 +1128,6 @@ ifndef BUILD_HEADLESS_ONLY LIBSPLASHSCREEN_DIRS := \ @@ -134,7 +135,7 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \ $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen -@@ -1194,6 +1193,13 @@ +@@ -1138,6 +1138,13 @@ GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib endif @@ -148,7 +149,7 @@ diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries. ifneq ($(OPENJDK_TARGET_OS), macosx) LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen else -@@ -1256,11 +1262,13 @@ +@@ -1193,11 +1200,13 @@ EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \ LANG := C, \ OPTIMIZATION := LOW, \ diff --git a/update_main_sources.sh b/update_main_sources.sh new file mode 100755 index 0000000..e11001e --- /dev/null +++ b/update_main_sources.sh @@ -0,0 +1,182 @@ +#!/bin/bash -x +# Generates the 'source tarball' for JDK 8 projects and update spec infrastructure +# By default, this script regenerate source as they are currently used. +# so if the version of sources change, this file changes and is pushed +# +# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg: +# PROJECT_NAME=jdk8u OR aarch64-port +# REPO_NAME=jdk8u60 OR jdk8u60 +# VERSION=jdk8u60-b27 OR aarch64-jdk8u65-b17 OR for head, keyword 'tip' should do the job there +# +# If you don't, default are used and so already uploaded tarball regenerated +# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set) +# +# For other useful variables see generate_source_tarball.sh +# +# the used values are then substituted to spec and sources + +if [ ! "x$PR2126" = "x" ] ; then + if [ ! -f "$PR2126" ] ; then + echo "You have specified PR2126 as $PR2126 but it does not exists. exiting" + exit 1 + fi +fi + +set -e + +if [ "x$PROJECT_NAME" = "x" ] ; then + PROJECT_NAME="aarch64-port" +fi +if [ "x$REPO_NAME" = "x" ] ; then + REPO_NAME="jdk8u" +fi +if [ "x$VERSION" = "x" ] ; then + VERSION="aarch64-jdk8u181-b13" +fi + +if [ "x$COMPRESSION" = "x" ] ; then +# rhel 5 needs tar.gz + COMPRESSION=xz +fi +if [ "x$FILE_NAME_ROOT" = "x" ] ; then + FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} +fi +if [ "x$PKG" = "x" ] ; then + URL=`cat .git/config | grep url` + PKG=${URL##*/} +fi +if [ "x$SPEC" = "x" ] ; then + SPEC=${PKG}.spec +fi +if [ "x$RELEASE" = "x" ] ; then + RELEASE=1 +fi + +FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION} + +if [ ! -f ${FILENAME} ] ; then +echo "Generating ${FILENAME}" +. ./generate_source_tarball.sh +else +echo "${FILENAME} already exists, using" +fi + + +echo "Touching spec: $SPEC" +sed -i "s/^%global\s\+project.*/%global project ${PROJECT_NAME}/" $SPEC +sed -i "s/^%global\s\+repo.*/%global repo ${REPO_NAME}/" $SPEC +sed -i "s/^%global\s\+revision.*/%global revision ${VERSION}/" $SPEC +# updated sources, resetting release +sed -i "s/^Release:.*/Release: $RELEASE.%{buildver}%{?dist}/" $SPEC + +#https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Bash +function levenshtein { + if [ "$#" -ne "2" ]; then + echo "Usage: $0 word1 word2" >&2 + elif [ "${#1}" -lt "${#2}" ]; then + levenshtein "$2" "$1" + else + local str1len=$((${#1})) + local str2len=$((${#2})) + local d i j + for i in $(seq 0 $(((str1len+1)*(str2len+1)))); do + d[i]=0 + done + for i in $(seq 0 $((str1len))); do + d[$((i+0*str1len))]=$i + done + for j in $(seq 0 $((str2len))); do + d[$((0+j*(str1len+1)))]=$j + done + + for j in $(seq 1 $((str2len))); do + for i in $(seq 1 $((str1len))); do + [ "${1:i-1:1}" = "${2:j-1:1}" ] && local cost=0 || local cost=1 + local del=$((d[(i-1)+str1len*j]+1)) + local ins=$((d[i+str1len*(j-1)]+1)) + local alt=$((d[(i-1)+str1len*(j-1)]+cost)) + d[i+str1len*j]=$(echo -e "$del\n$ins\n$alt" | sort -n | head -1) + done + done + echo ${d[str1len+str1len*(str2len)]} + fi +} +# generate shenandoah hotspot +# that means supply the underlying script with new values +# to new filename. +MAIN_VERSION=$VERSION +if [ "x$VERSION" = "xtip" ] ; then + VERSION="tip" +else + #hardcoding version for anything else except tip + VERSION="aarch64-shenandoah-jdk8u181-b13" +fi +MAIN_REPO_NAME=$REPO_NAME +REPO_NAME=jdk8u-shenandoah +MAIN_FILE_NAME_ROOT=$FILE_NAME_ROOT +FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} +FILENAME_SH=${FILE_NAME_ROOT}.tar.${COMPRESSION} +REPOS="hotspot" + +if [ ! -f ${FILENAME_SH} ] ; then +echo "Generating ${FILENAME_SH}" +. ./generate_source_tarball.sh +else +echo "${FILENAME_SH} already exists, using" +fi + +sed -i "s/^Source1:.*/Source1: ${FILENAME_SH}/" $SPEC +git --no-pager diff $SPEC + +# find the most similar sources name and replace it by newly generated one. +echo "Old sources" +cat sources +a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"` +winner="" +winnerDistance=999999 +for x in $a_sources ; do + distance=`levenshtein $x ${FILENAME}` + if [ $distance -lt $winnerDistance ] ; then + winner=$x + winnerDistance=$distance + fi +done +sum=`md5sum ${FILENAME}` +sed -i "s;.*$winner;$sum;" sources +# now shenandoah hotspot +winner="" +winnerDistance=999999 +for x in $a_sources ; do + distance=`levenshtein $x ${FILENAME_SH}` + if [ $distance -lt $winnerDistance ] ; then + winner=$x + winnerDistance=$distance + fi +done +sum=`md5sum ${FILENAME_SH}` +sed -i "s;.*$winner;$sum;" sources + +echo "New sources" +cat sources +a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"` +echo " you can get inspired by following %changelog template:" +user_name=`whoami` +user_record=$(getent passwd $user_name) +user_gecos_field=$(echo "$user_record" | cut -d ':' -f 5) +user_full_name=$(echo "$user_gecos_field" | cut -d ',' -f 1) +spec_date=`date +"%a %b %d %Y"` +# See spec: +revision_helper=`echo ${MAIN_VERSION%-*}` +updatever=`echo ${revision_helper##*u}` +buildver=`echo ${MAIN_VERSION##*-}` +echo "* $spec_date $user_full_name <$user_name@redhat.com> - 1:1.8.0.$updatever-$RELEASE.$buildver" +echo "- updated to $MAIN_VERSION (from $PROJECT_NAME/$MAIN_REPO_NAME)" +echo "- updated to $VERSION (from $PROJECT_NAME/$REPO_NAME) of hotspot" +echo "- used $FILENAME as new sources" +echo "- used $FILENAME_SH as new sources for hotspot" + +echo " execute:" +echo "fedpkg/rhpkg new-sources "$a_sources +echo " to upload sources" +echo "you can verify by fedpkg/rhpkg prep --arch XXXX on all architectures: x86_64 i386 i586 i686 ppc ppc64 ppc64le s390 s390x aarch64 armv7hl" + diff --git a/update_package.sh b/update_package.sh deleted file mode 100755 index e11001e..0000000 --- a/update_package.sh +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/bash -x -# Generates the 'source tarball' for JDK 8 projects and update spec infrastructure -# By default, this script regenerate source as they are currently used. -# so if the version of sources change, this file changes and is pushed -# -# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg: -# PROJECT_NAME=jdk8u OR aarch64-port -# REPO_NAME=jdk8u60 OR jdk8u60 -# VERSION=jdk8u60-b27 OR aarch64-jdk8u65-b17 OR for head, keyword 'tip' should do the job there -# -# If you don't, default are used and so already uploaded tarball regenerated -# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set) -# -# For other useful variables see generate_source_tarball.sh -# -# the used values are then substituted to spec and sources - -if [ ! "x$PR2126" = "x" ] ; then - if [ ! -f "$PR2126" ] ; then - echo "You have specified PR2126 as $PR2126 but it does not exists. exiting" - exit 1 - fi -fi - -set -e - -if [ "x$PROJECT_NAME" = "x" ] ; then - PROJECT_NAME="aarch64-port" -fi -if [ "x$REPO_NAME" = "x" ] ; then - REPO_NAME="jdk8u" -fi -if [ "x$VERSION" = "x" ] ; then - VERSION="aarch64-jdk8u181-b13" -fi - -if [ "x$COMPRESSION" = "x" ] ; then -# rhel 5 needs tar.gz - COMPRESSION=xz -fi -if [ "x$FILE_NAME_ROOT" = "x" ] ; then - FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} -fi -if [ "x$PKG" = "x" ] ; then - URL=`cat .git/config | grep url` - PKG=${URL##*/} -fi -if [ "x$SPEC" = "x" ] ; then - SPEC=${PKG}.spec -fi -if [ "x$RELEASE" = "x" ] ; then - RELEASE=1 -fi - -FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION} - -if [ ! -f ${FILENAME} ] ; then -echo "Generating ${FILENAME}" -. ./generate_source_tarball.sh -else -echo "${FILENAME} already exists, using" -fi - - -echo "Touching spec: $SPEC" -sed -i "s/^%global\s\+project.*/%global project ${PROJECT_NAME}/" $SPEC -sed -i "s/^%global\s\+repo.*/%global repo ${REPO_NAME}/" $SPEC -sed -i "s/^%global\s\+revision.*/%global revision ${VERSION}/" $SPEC -# updated sources, resetting release -sed -i "s/^Release:.*/Release: $RELEASE.%{buildver}%{?dist}/" $SPEC - -#https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Bash -function levenshtein { - if [ "$#" -ne "2" ]; then - echo "Usage: $0 word1 word2" >&2 - elif [ "${#1}" -lt "${#2}" ]; then - levenshtein "$2" "$1" - else - local str1len=$((${#1})) - local str2len=$((${#2})) - local d i j - for i in $(seq 0 $(((str1len+1)*(str2len+1)))); do - d[i]=0 - done - for i in $(seq 0 $((str1len))); do - d[$((i+0*str1len))]=$i - done - for j in $(seq 0 $((str2len))); do - d[$((0+j*(str1len+1)))]=$j - done - - for j in $(seq 1 $((str2len))); do - for i in $(seq 1 $((str1len))); do - [ "${1:i-1:1}" = "${2:j-1:1}" ] && local cost=0 || local cost=1 - local del=$((d[(i-1)+str1len*j]+1)) - local ins=$((d[i+str1len*(j-1)]+1)) - local alt=$((d[(i-1)+str1len*(j-1)]+cost)) - d[i+str1len*j]=$(echo -e "$del\n$ins\n$alt" | sort -n | head -1) - done - done - echo ${d[str1len+str1len*(str2len)]} - fi -} -# generate shenandoah hotspot -# that means supply the underlying script with new values -# to new filename. -MAIN_VERSION=$VERSION -if [ "x$VERSION" = "xtip" ] ; then - VERSION="tip" -else - #hardcoding version for anything else except tip - VERSION="aarch64-shenandoah-jdk8u181-b13" -fi -MAIN_REPO_NAME=$REPO_NAME -REPO_NAME=jdk8u-shenandoah -MAIN_FILE_NAME_ROOT=$FILE_NAME_ROOT -FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} -FILENAME_SH=${FILE_NAME_ROOT}.tar.${COMPRESSION} -REPOS="hotspot" - -if [ ! -f ${FILENAME_SH} ] ; then -echo "Generating ${FILENAME_SH}" -. ./generate_source_tarball.sh -else -echo "${FILENAME_SH} already exists, using" -fi - -sed -i "s/^Source1:.*/Source1: ${FILENAME_SH}/" $SPEC -git --no-pager diff $SPEC - -# find the most similar sources name and replace it by newly generated one. -echo "Old sources" -cat sources -a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"` -winner="" -winnerDistance=999999 -for x in $a_sources ; do - distance=`levenshtein $x ${FILENAME}` - if [ $distance -lt $winnerDistance ] ; then - winner=$x - winnerDistance=$distance - fi -done -sum=`md5sum ${FILENAME}` -sed -i "s;.*$winner;$sum;" sources -# now shenandoah hotspot -winner="" -winnerDistance=999999 -for x in $a_sources ; do - distance=`levenshtein $x ${FILENAME_SH}` - if [ $distance -lt $winnerDistance ] ; then - winner=$x - winnerDistance=$distance - fi -done -sum=`md5sum ${FILENAME_SH}` -sed -i "s;.*$winner;$sum;" sources - -echo "New sources" -cat sources -a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"` -echo " you can get inspired by following %changelog template:" -user_name=`whoami` -user_record=$(getent passwd $user_name) -user_gecos_field=$(echo "$user_record" | cut -d ':' -f 5) -user_full_name=$(echo "$user_gecos_field" | cut -d ',' -f 1) -spec_date=`date +"%a %b %d %Y"` -# See spec: -revision_helper=`echo ${MAIN_VERSION%-*}` -updatever=`echo ${revision_helper##*u}` -buildver=`echo ${MAIN_VERSION##*-}` -echo "* $spec_date $user_full_name <$user_name@redhat.com> - 1:1.8.0.$updatever-$RELEASE.$buildver" -echo "- updated to $MAIN_VERSION (from $PROJECT_NAME/$MAIN_REPO_NAME)" -echo "- updated to $VERSION (from $PROJECT_NAME/$REPO_NAME) of hotspot" -echo "- used $FILENAME as new sources" -echo "- used $FILENAME_SH as new sources for hotspot" - -echo " execute:" -echo "fedpkg/rhpkg new-sources "$a_sources -echo " to upload sources" -echo "you can verify by fedpkg/rhpkg prep --arch XXXX on all architectures: x86_64 i386 i586 i686 ppc ppc64 ppc64le s390 s390x aarch64 armv7hl" - diff --git a/update_systemtap.sh b/update_systemtap.sh new file mode 100644 index 0000000..1a3e3c8 --- /dev/null +++ b/update_systemtap.sh @@ -0,0 +1,32 @@ +#!/bin/bash -x +# this file contains defaults for currently generated source tarball of systemtap + +set -e + +# TAPSET +export PROJECT_NAME="hg" +export REPO_NAME="icedtea8" +export VERSION="9d464368e06d" +export COMPRESSION=xz +export OPENJDK_URL=http://icedtea.classpath.org +export FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} +export TO_COMPRESS="*/tapset" +# warning, filename and filenameroot creation is duplicated here from generate_source_tarball.sh +CLONED_FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION} +TAPSET_VERSION=3.2 +TAPSET=systemtap_"$TAPSET_VERSION"_tapsets_$CLONED_FILENAME +if [ ! -f ${TAPSET} ] ; then + if [ ! -f ${CLONED_FILENAME} ] ; then + echo "Generating ${CLONED_FILENAME}" + sh ./generate_singlerepo_source_tarball.sh + else + echo "exists exists exists exists exists exists exists " + echo "reusing reusing reusing reusing reusing reusing " + echo ${CLONED_FILENAME} + fi + mv -v $CLONED_FILENAME $TAPSET +else + echo "exists exists exists exists exists exists exists " + echo "reusing reusing reusing reusing reusing reusing " + echo ${TAPSET} +fi