@ -131,6 +131,8 @@
%global ssbd_arches x86_64
# Set of architectures where we verify backtraces with gdb
%global gdb_arches %{jit_arches} %{zero_arches}
# Set of architectures for which we have a portable build
%global portable_build_arches %{aarch64} %{ix86} %{power64} x86_64
# By default, we build a debug build during main build on JIT architectures
%if %{with slowdebug}
@ -200,6 +202,9 @@
# See RHBZ#1861401
%define _lto_cflags %{nil}
# debugedit tool for rewriting ELF file paths
%global debugedit %{_rpmconfigdir}/debugedit
# Filter out flags from the optflags macro that cause problems with the OpenJDK build
# We filter out -O flags so that the optimization 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)
@ -294,6 +299,13 @@
# New Version-String scheme-style defines
%global majorver 8
# Define IcedTea version used for SystemTap tapsets and desktop file
%global icedteaver 3.15.0
# Define current Git revision for the FIPS support patches
%global fipsver 6d1aade0648
# Define current Git revision for the cacerts patch
%global cacertsver 8139f2361c2
# Standard JPackage naming and versioning defines
%global origin openjdk
%global origin_nice OpenJDK
@ -332,12 +344,7 @@
%global project %{shenandoah_project}
%global repo %{shenandoah_repo}
%global revision %{shenandoah_revision}
# Define IcedTea version used for SystemTap tapsets and desktop files
%global icedteaver 3.15.0
# Define current Git revision for the FIPS support patches
%global fipsver 6d1aade0648
# Define current Git revision for the cacerts patch
%global cacertsver 8139f2361c2
# e.g. aarch64-shenandoah-jdk8u212-b04-shenandoah-merge-2019-04-30 -> aarch64-shenandoah-jdk8u212-b04
%global version_tag %(VERSION=%{revision}; echo ${VERSION%%-shenandoah-merge*})
@ -347,7 +354,12 @@
%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u})
# eg jdk8u60-b27 -> b27
%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-})
%global rpmrelease 1
%global rpmrelease 2
# Settings used by the portable build
%global portablerelease 2
%global portablesuffix el8
%global portablebuilddir /builddir/build/BUILD
# Define milestone (EA for pre-releases, GA ("fcs") for releases)
# Release will be (where N is usually a number starting at 1):
# - 0.N%%{?extraver}%%{?dist} for EA releases,
@ -829,6 +841,8 @@ exit 0
%license %{_jvmdir}/%{jredir -- %{?1}}/LICENSE
%license %{_jvmdir}/%{jredir -- %{?1}}/THIRD_PARTY_README
%doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/NEWS
%doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/README.md
%doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/java-1.%{majorver}.0-openjdk-portable.specfile
%dir %{_jvmdir}/%{sdkdir -- %{?1}}
%{_jvmdir}/%{jrelnk -- %{?1}}
%dir %{_jvmdir}/%{jredir -- %{?1}}/lib/security
@ -1174,7 +1188,6 @@ exit 0
%define files_src() %{expand:
%defattr(-,root,root,-)
%doc README.md
%{_jvmdir}/%{sdkdir -- %{?1}}/src.zip
}
@ -1182,7 +1195,11 @@ exit 0
%defattr(-,root,root,-)
%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}
#javadoc is in jdk8 noarch, so also licnese file must be treated like it
%ifarch %{portable_build_arches}
%license %{installoutputdir -- %{?1}}/jre/LICENSE
%else
%license %{installoutputdir -- %{?1}}/images/%{jdkimage}/jre/LICENSE
%endif
%if %is_system_jdk
%if %{is_release_build -- %{?1}}
%ghost %{_javadocdir}/java
@ -1194,7 +1211,11 @@ exit 0
%defattr(-,root,root,-)
%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip
#javadoc is in jdk8 noarch, so also licnese file must be treated like it
%ifarch %{portable_build_arches}
%license %{installoutputdir -- %{?1}}/jre/LICENSE
%else
%license %{installoutputdir -- %{?1}}/images/%{jdkimage}/jre/LICENSE
%endif
%if %is_system_jdk
%if %{is_release_build -- %{?1}}
%ghost %{_javadocdir}/java-zip
@ -1380,9 +1401,6 @@ URL: http://openjdk.java.net/
# where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo}
Source0: %{shenandoah_project}-%{shenandoah_repo}-%{shenandoah_revision}-4curve.tar.xz
# Custom README for -src subpackage
Source2: README.md
# Release notes
Source7: NEWS
@ -1419,12 +1437,22 @@ Source17: nss.fips.cfg.in
# Ensure translations are available for new timezones
Source18: TestTranslations.java
Source20 : repackReproduciblePolycies.sh
Source21 : repackReproduciblePolycies.sh
# New versions of config files with aarch64 support. This is not upstream yet.
Source100: config.guess
Source101: config.sub
# Include portable spec and instructions on how to rebuild
Source19: README.md
Source20: java-1.%{majorver}.0-openjdk-portable.specfile
# Setup variables to reference correct sources
%global releasezip %{_jvmdir}/%{name}-portable-%{version}-%{portablerelease}.portable.unstripped.jdk.%{_arch}.tar.xz
%global docszip %{_jvmdir}/%{name}-portable-%{version}-%{portablerelease}.portable.docs.%{_arch}.tar.xz
%global misczip %{_jvmdir}/%{name}-portable-%{version}-%{portablerelease}.portable.misc.%{_arch}.tar.xz
%global slowdebugzip %{_jvmdir}/%{name}-portable-%{version}-%{portablerelease}.portable.slowdebug.jdk.%{_arch}.tar.xz
%global fastdebugzip %{_jvmdir}/%{name}-portable-%{version}-%{portablerelease}.portable.fastdebug.jdk.%{_arch}.tar.xz
############################################
#
@ -1612,10 +1640,27 @@ BuildRequires: pkgconfig
BuildRequires: xorg-x11-proto-devel
BuildRequires: zip
BuildRequires: unzip
# For definitions and macros like jvmdir
BuildRequires: javapackages-filesystem
%ifarch %{portable_build_arches}
%if %{include_normal_build}
BuildRequires: java-1.%{majorver}.0-openjdk-portable-unstripped = %{epoch}:%{version}-%{portablerelease}.%{portablesuffix}
%endif
%if %{include_fastdebug_build}
BuildRequires: java-1.%{majorver}.0-openjdk-portable-devel-fastdebug = %{epoch}:%{version}-%{portablerelease}.%{portablesuffix}
%endif
%if %{include_debug_build}
BuildRequires: java-1.%{majorver}.0-openjdk-portable-devel-slowdebug = %{epoch}:%{version}-%{portablerelease}.%{portablesuffix}
%endif
BuildRequires: java-1.%{majorver}.0-openjdk-portable-docs = %{epoch}:%{version}-%{portablerelease}.%{portablesuffix}
BuildRequires: java-1.%{majorver}.0-openjdk-portable-misc = %{epoch}:%{version}-%{portablerelease}.%{portablesuffix}
%else
# Require a boot JDK which doesn't fail due to RH1482244
BuildRequires: java-%{buildjdkver}-openjdk-devel >= 1.7.0.151-2.6.11.3
%endif
# Zero-assembler build requirement
%ifarch %{zero_arches}
BuildRequires: libffi
BuildRequires: libffi-devel
%endif
# 2023c required as of JDK-8305113
@ -1641,9 +1686,11 @@ Provides: bundled(lcms2) = 2.10.0
Provides: bundled(libjpeg) = 6b
# Version in jdk/src/share/native/sun/awt/libpng/png.h
Provides: bundled(libpng) = 1.6.37
%ifnarch %{portable_build_arches}
# We link statically against libstdc++ to increase portability
BuildRequires: libstdc++-static
%endif
%endif
# this is always built, also during debug-only build
# when it is built in debug-only this package is just placeholder
@ -1886,8 +1933,6 @@ fi
# For old patches
ln -s %{top_level_dir_name} jdk8
cp %{SOURCE2} .
# replace outdated configure guess script
#
# the configure macro will do this too, but it also passes a few flags not
@ -2013,6 +2058,8 @@ sed -i -e "s:^security.systemCACerts=.*:security.systemCACerts=%{cacerts_file}:"
%build
%ifnarch %{portable_build_arches}
# How many CPU's do we have?
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
export NUM_PROC=${NUM_PROC:-1}
@ -2161,19 +2208,6 @@ function installjdk() {
# Install nss.fips.cfg: NSS configuration for global FIPS mode (crypto-policies)
install -m 644 nss.fips.cfg ${imagepath}/jre/lib/security/
# Turn on system security properties
sed -i -e "s:^security.useSystemPropertiesFile=.*:security.useSystemPropertiesFile=true:" \
${imagepath}/jre/lib/security/java.security
# Use system-wide tzdata
mv ${imagepath}/jre/lib/tzdb.dat{,.upstream}
ln -sv %{_datadir}/javazi-1.8/tzdb.dat ${imagepath}/jre/lib/tzdb.dat
# Rename OpenJDK cacerts database
mv ${imagepath}/jre/lib/security/cacerts{,.upstream}
# Install cacerts symlink needed by some apps which hard-code the path
ln -sv %{cacerts_file} ${imagepath}/jre/lib/security
# add alt-java man page
pushd ${imagepath}
echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1
@ -2196,7 +2230,57 @@ function installjdk() {
systemjdk=%{bootjdk}
%endif
%endif # portable_builds
function customisejdk() {
local imagepath=${1}
if [ -d ${imagepath} ] ; then
# Turn on system security properties
sed -i -e "s:^security.useSystemPropertiesFile=.*:security.useSystemPropertiesFile=true:" \
${imagepath}/jre/lib/security/java.security
# Use system-wide tzdata
mv ${imagepath}/jre/lib/tzdb.dat{,.upstream}
ln -sv %{_datadir}/javazi-1.8/tzdb.dat ${imagepath}/jre/lib/tzdb.dat
# Rename OpenJDK cacerts database
mv ${imagepath}/jre/lib/security/cacerts{,.upstream}
# Install cacerts symlink needed by some apps which hard-code the path
ln -sv %{cacerts_file} ${imagepath}/jre/lib/security
fi
}
for suffix in %{build_loop} ; do
%ifarch %{portable_build_arches}
if [ "x$suffix" = "x" ] ; then
jdkzip=%{releasezip}
elif [ "x$suffix" = "x%{fastdebug_suffix_unquoted}" ] ; then
jdkzip=%{fastdebugzip}
else # slowdebug
jdkzip=%{slowdebugzip}
debugbuild=release
fi
installdir=%{installoutputdir -- ${suffix}}
imagedir=${installdir}
# TODO: should verify checksums when using packages from buildroot
tar -xJf ${jdkzip}
mkdir -p $(dirname ${installdir})
mv %{name}* ${installdir}
# Fix build paths in ELF files so it looks like we built them
portablenvr="%{name}-portable-%{version}-%{portablerelease}.%{portablesuffix}.%{_arch}"
for file in $(find ${installdir} -type f) ; do
if file ${file} | grep -q 'ELF'; then
%{debugedit} -b %{portablebuilddir}/${portablenvr} -d $(pwd) -n ${file}
fi
done
%else
if [ "x$suffix" = "x" ] ; then
debugbuild=release
else
@ -2208,6 +2292,7 @@ builddir=%{buildoutputdir -- $suffix}
bootbuilddir=boot${builddir}
installdir=%{installoutputdir -- $suffix}
bootinstalldir=boot${installdir}
imagedir=${installdir}/images/%{jdkimage}
link_opt="%{link_type}"
# Debug builds don't need same targets as release for
@ -2232,15 +2317,39 @@ else
installjdk ${builddir} ${installdir}
fi
%endif # portable_builds
# Final setup on the main image
customisejdk ${imagedir}
# Print release information
cat ${imagedir}/release
# build cycles
done
%ifarch %{portable_build_arches}
docdir=%{installoutputdir -- "-docs"}
tar -xJf %{docszip}
mv %{name}*.docs.* ${docdir}
miscdir=%{installoutputdir -- "-misc"}
tar -xJf %{misczip}
mv %{name}*.misc.* ${miscdir}
%endif
%check
# We test debug first as it will give better diagnostics on a crash
for suffix in %{build_loop} ; do
%ifarch %{portable_build_arches}
export JAVA_HOME=$(pwd)/%{installoutputdir -- $suffix}
%else
export JAVA_HOME=$(pwd)/%{installoutputdir -- $suffix}/images/%{jdkimage}
%endif
# Check unlimited policy has been used
$JAVA_HOME/bin/javac -d . %{SOURCE13}
@ -2269,14 +2378,14 @@ nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation
if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi
%endif
# Check translations are available for new timezones
$JAVA_HOME/bin/javac -d . %{SOURCE18}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE
# Check correct vendor values have been set
$JAVA_HOME/bin/javac -d . %{SOURCE16}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" %{oj_vendor_url} %{oj_vendor_bug_url}
# Check translations are available for new timezones
$JAVA_HOME/bin/javac -d . %{SOURCE18}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE
# Check debug symbols are present and can identify code
find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib
do
@ -2344,7 +2453,7 @@ grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
%endif
# Check src.zip has all sources. See RHBZ#1130490
jar -tf $JAVA_HOME/src.zip | grep 'sun.misc.Unsafe'
unzip -l $JAVA_HOME/src.zip | grep 'sun.misc.Unsafe'
# Check class files include useful debugging information
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
@ -2364,8 +2473,29 @@ STRIP_KEEP_SYMTAB=libjvm*
for suffix in %{build_loop} ; do
# Should match same definitions in build section
%ifarch %{portable_build_arches}
jdk_image=%{installoutputdir -- $suffix}
docdir=$(pwd)/%{installoutputdir -- "-docs"}
miscdir=%{installoutputdir -- "-misc"}
%else
jdk_image=%{installoutputdir -- $suffix}/images/%{jdkimage}
docdir=%{installoutputdir -- $suffix}
miscdir=%{top_level_dir_name}/jdk/src/solaris/classes/sun/awt/X11
%endif
# Install release notes and rebuild instructions
commondocdir=${RPM_BUILD_ROOT}%{_defaultdocdir}/%{uniquejavadocdir -- $suffix}
install -d -m 755 ${commondocdir}
%ifarch %{portable_build_arches}
mv ${jdk_image}/NEWS ${commondocdir}
%else
cp -a %{SOURCE7} ${commondocdir}
%endif
cp -a %{SOURCE19} %{SOURCE20} ${commondocdir}
# Install the jdk
pushd %{installoutputdir -- $suffix}/images/%{jdkimage}
pushd ${jdk_ image}
# Install jsa directories so we can owe them
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir -- $suffix}/lib/%{archinstall}/server/
@ -2425,20 +2555,19 @@ popd
if ! echo $suffix | grep -q "debug" ; then
# Install Javadoc documentation
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
cp -a %{installoutputdir -- $suffix}/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}
built_doc_archive=`echo "jdk-%{javaver}_%{updatever}%{milestone_version}$suffix-%{buildver}-docs.zip" | sed s/slowdebug/debug/`
cp -a ${docdir}/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}
built_doc_archive=jdk-%{javaver}_%{updatever}%{milestone_version}$suffix-%{buildver}-docs.zip
%ifarch %{portable_build_arches}
cp -a ${docdir}/$built_doc_archive $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip
%else
cp -a %{installoutputdir -- $suffix}/bundles/$built_doc_archive $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip
%endif
fi
# Install release notes
commondocdir=${RPM_BUILD_ROOT}%{_defaultdocdir}/%{uniquejavadocdir -- $suffix}
install -d -m 755 ${commondocdir}
cp -a %{SOURCE7} ${commondocdir}
# Install icons and menu entries
for s in 16 24 32 48 ; do
install -D -p -m 644 \
%{top_level_dir_name}/jdk/src/solaris/classes/sun/awt/X11 /java-icon${s}.png \
${miscdir}/java-icon${s}.png \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/java-%{javaver}-%{origin}.png
done
@ -2479,7 +2608,7 @@ find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/demo \
| sed 's|^|%dir |' \
>> %{name}-demo.files"$suffix"
bash %{SOURCE20 } $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir -- $suffix} %{javaver}
bash %{SOURCE21 } $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir -- $suffix} %{javaver}
# https://bugzilla.redhat.com/show_bug.cgi?id=1183793
touch -t 201401010000 $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir -- $suffix}/lib/security/java.security
@ -2721,26 +2850,44 @@ cjc.mainProgram(args)
%endif
%changelog
* Tue Apr 18 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.372.b07-1
* Tue Apr 18 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.372.b07-2
- Update to shenandoah-jdk8u372-b07 (GA)
- Update release notes for shenandoah-8u372-b07.
- Require tzdata 2023c due to inclusion of JDK-8305113 in 8u372-b07
- Reintroduce jconsole-plugin.patch from RHEL 9
- Update generate_tarball.sh to add support for passing a boot JDK to the configure run
- Add POSIX-friendly error codes to generate_tarball.sh and fix whitespace
- Remove .jcheck and GitHub support when generating tarballs, as done in upstream release tarballs
- Drop JDK-8275535/RH2053256 patch which is now upstream
- Include JDK-8271199 backport early ahead of 8u382 (RH2175317)
- Drop hack for difference in local and portable build version
- Replace local copies of JDK portable binaries with build dependencies
- Include the java-1.8.0-openjdk-portable.spec file with instructions on how to rebuild.
- Remove duplicate use of README.md inside the *-src package (it is no longer about sources)
- Use portable build on x86_32 now one is available
- ** This tarball is embargoed until 2023-04-18 @ 1pm PT. **
- Resolves: rhbz#2185182
- Resolves: rhbz#2189329
* Tue Feb 28 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b09-4
- Drop use of portable build on s390x due to libffi compatibility issue (needs libffi.so.6)
- Related: rhbz#2150202
* Tue Feb 28 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b09-4
- Add explicit libffi dependency for s390x build
- Related: rhbz#2150202
* Tue Jan 24 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b09-2
* Tue Feb 28 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b09-4
- On portable architectures, replace build section with extraction of existing builds from portables
- Rewrite ELF files so the source file path is correct and debugsources can be assembled
- Resolves: rhbz#2150202
* Tue Jan 24 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b09-3
- Update cacerts patch to fix OPENJDK-1433 SecurityManager issue
- Update to shenandoah-jdk8u352-b09 (GA)
- Update release notes for shenandoah-8u352-b09.
- Resolves: rhbz#2163594
- Resolves: rhbz#216271 4
* Fri Jan 13 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b08-2
* Fri Jan 13 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b08-3
- Update to shenandoah-jdk8u352-b08 (GA)
- Update release notes for shenandoah-8u352-b08.
- Fix broken links and missing release notes in older releases.
@ -2750,24 +2897,36 @@ cjc.mainProgram(args)
- Fedora now appears to be using RSA and the JDK now supports ECC in preference to large DH keys
- Resolves: rhbz#2160111
* Wed Jan 11 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b07-0.2 .ea
* Wed Jan 11 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b07-0.3 .ea
- Update to shenandoah-jdk8u362-b07 (EA)
- Update release notes for shenandoah-8u362-b07.
- Switch to EA mode for 8u362 pre-release builds.
- Drop JDK-8195607/PR3776/RH1760437 now this is upstream
- Require tzdata 2022g due to inclusion of JDK-8296108, JDK-8296715 & JDK-8297804
- Drop tzdata patches for 2022d & 2022e (JDK-8294357 & JDK-8295173) which are now upstream
- Update TestTranslations.java to test the new America/Ciudad_Juarez zone
- Resolves: rhbz#2159912
- Resolves: rhbz#2150196
* Sun Oct 16 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.352.b08-2
* Tue Jan 10 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.362.b01-0.3.ea
- Update to shenandoah-jdk8u362-b01 (EA)
- Update release notes for shenandoah-8u362-b01.
- Switch to EA mode for 8u362 pre-release builds.
- Drop JDK-8195607/PR3776/RH1760437 now this is upstream
- Related: rhbz#2150196
* Wed Oct 19 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.352.b08-2
- Update to shenandoah-jdk8u352-b08 (GA)
- Update release notes for shenandoah-8u352-b08.
- Rebase FIPS patch against 8u352-b07
- Switch to GA mode for final release.
- Update in-tree tzdata to 2022e with JDK-8294357 & JDK-8295173
- Add test to ensure timezones can be translated
- Resolves: rhbz#2133695
* Wed Oct 12 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.352.b07-0.2.ea
- Update to shenandoah-jdk8u352-b07 (EA)
- Update release notes for shenandoah-8u352-b07.
- Switch to EA mode for 8u352 pre-release builds.
- Rebase FIPS patch against 8u352-b07
- Resolves: rhbz#2130623
* Tue Aug 30 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.345.b01-5
- Allow the default keystore to be configured using security.systemCACerts
- Use of the property can now be disabled using -Dsecurity.systemCACerts=