Restructure the build so a minimal initial build is then used for the final build (with docs)
This reduces pressure on the system JDK and ensures the JDK being built can do a full build Turn off bootstrapping for slow debug builds, which are particularly slow on ppc64le. Minor cosmetic improvements to make spec more comparable between variants
This commit is contained in:
parent
95f56114d8
commit
1cc9d59897
@ -12,10 +12,7 @@
|
||||
#
|
||||
# Only produce a release build on x86_64:
|
||||
# $ fedpkg mockbuild --without slowdebug --without fastdebug
|
||||
#
|
||||
# Only produce a debug build on x86_64:
|
||||
# $ fedpkg local --without release
|
||||
#
|
||||
|
||||
# Enable fastdebug builds by default on relevant arches.
|
||||
%bcond_without fastdebug
|
||||
# Enable slowdebug builds by default on relevant arches.
|
||||
@ -59,11 +56,11 @@
|
||||
%global staticlibs_suffix "%{staticlibs_suffix_unquoted}"
|
||||
|
||||
%global debug_warning This package is unoptimised with full debugging. Install only as needed and remove ASAP.
|
||||
%global debug_on with full debugging on
|
||||
%global fastdebug_on with minimal debugging on
|
||||
%global fastdebug_warning This package is optimised with full debugging. Install only as needed and remove ASAP.
|
||||
%global for_fastdebug_on for packages with minimal debugging on
|
||||
%global for_debug for packages with debugging on
|
||||
%global debug_on unoptimised with full debugging on
|
||||
%global fastdebug_on optimised with full debugging on
|
||||
%global for_fastdebug for packages with debugging on and optimisation
|
||||
%global for_debug for packages with debugging on and no optimisation
|
||||
|
||||
%if %{with release}
|
||||
%global include_normal_build 1
|
||||
@ -171,7 +168,7 @@
|
||||
|
||||
# If you disable both builds, then the build fails
|
||||
# Build and test slowdebug first as it provides the best diagnostics
|
||||
%global build_loop %{slowdebug_build} %{fastdebug_build} %{normal_build}
|
||||
%global build_loop %{slowdebug_build} %{fastdebug_build} %{normal_build}
|
||||
|
||||
%if %{include_staticlibs}
|
||||
%global staticlibs_loop %{staticlibs_suffix}
|
||||
@ -180,27 +177,30 @@
|
||||
%endif
|
||||
|
||||
%ifarch %{bootstrap_arches}
|
||||
%global bootstrap_build 1
|
||||
%global bootstrap_build true
|
||||
%else
|
||||
%global bootstrap_build 1
|
||||
%global bootstrap_build false
|
||||
%endif
|
||||
|
||||
%if %{bootstrap_build}
|
||||
%global release_targets bootcycle-images docs-zip
|
||||
%else
|
||||
%global release_targets images docs-zip
|
||||
%endif
|
||||
# No docs nor bootcycle for debug builds
|
||||
%global debug_targets images
|
||||
|
||||
%if %{include_staticlibs}
|
||||
# Extra target for producing the static-libraries. Separate from
|
||||
# other targets since this target is configured to use in-tree
|
||||
# AWT dependencies: lcms, libjpeg, libpng, libharfbuzz, giflib
|
||||
# and possibly others
|
||||
%global static_libs_target static-libs-image
|
||||
%else
|
||||
%global static_libs_target %{nil}
|
||||
%endif
|
||||
|
||||
# RPM JDK builds keep the debug symbols internal, to be later stripped by RPM
|
||||
%global debug_symbols internal
|
||||
|
||||
# unlike portables,the rpms have to use static_libs_target very dynamically
|
||||
%global bootstrap_targets images
|
||||
%global release_targets images docs-zip
|
||||
# No docs nor bootcycle for debug builds
|
||||
%global debug_targets images
|
||||
|
||||
|
||||
# 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
|
||||
@ -298,7 +298,7 @@
|
||||
%global top_level_dir_name %{origin}
|
||||
%global top_level_dir_name_backup %{top_level_dir_name}-backup
|
||||
%global buildver 12
|
||||
%global rpmrelease 3
|
||||
%global rpmrelease 4
|
||||
# Priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit
|
||||
%if %is_system_jdk
|
||||
# Using 10 digits may overflow the int used for priority, so we combine the patch and build versions
|
||||
@ -311,7 +311,7 @@
|
||||
# for techpreview, using 1, so slowdebugs can have 0
|
||||
%global priority %( printf '%08d' 1 )
|
||||
%endif
|
||||
%global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver}
|
||||
%global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver}
|
||||
%global javaver %{featurever}
|
||||
|
||||
# Strip up to 6 trailing zeros in newjavaver, as the JDK does, to get the correct version used in filenames
|
||||
@ -573,7 +573,7 @@ alternatives \\
|
||||
--slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext \\
|
||||
%{_mandir}/man1/jstatd-%{uniquesuffix -- %{?1}}.1$ext \\
|
||||
--slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\
|
||||
%{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1$ext
|
||||
%{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1$ext \\
|
||||
|
||||
for X in %{origin} %{javaver} ; do
|
||||
alternatives \\
|
||||
@ -754,7 +754,7 @@ exit 0
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.cfg
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.fips.cfg
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/jmxremote.access
|
||||
# these are config templates, thus not config-noreplace
|
||||
# This is a config template, thus not config-noreplace
|
||||
%config %{etcjavadir -- %{?1}}/conf/management/jmxremote.password.template
|
||||
%config %{etcjavadir -- %{?1}}/conf/sdp/sdp.conf.template
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties
|
||||
@ -777,6 +777,10 @@ exit 0
|
||||
%ghost %{_jvmdir}/jre-%{javaver}-%{origin}
|
||||
%endif
|
||||
%endif
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1820172
|
||||
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/
|
||||
%ghost %{_jvmdir}/%{sdkdir -- %{?1}}/conf.rpmmoved
|
||||
%ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/security.rpmmoved
|
||||
}
|
||||
|
||||
%define files_devel() %{expand:
|
||||
@ -933,7 +937,9 @@ Requires: libXcomposite%{?_isa}
|
||||
Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
|
||||
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
|
||||
# for java-X-openjdk package's desktop binding
|
||||
%if 0%{?rhel} >= 8
|
||||
Recommends: gtk3%{?_isa}
|
||||
%endif
|
||||
|
||||
Provides: java-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release}
|
||||
|
||||
@ -1003,9 +1009,9 @@ Provides: java-sdk-%{javaver}%{?1} = %{epoch}:%{version}-%{release}
|
||||
Provides: java-%{javaver}-devel%{?1} = %{epoch}:%{version}-%{release}
|
||||
Provides: java-%{javaver}-%{origin}-devel%{?1} = %{epoch}:%{version}-%{release}
|
||||
%if %is_system_jdk
|
||||
Provides: java-devel-%{origin}%{?1} = %{epoch}:%{version}-%{release}
|
||||
Provides: java-sdk-%{origin}%{?1} = %{epoch}:%{version}-%{release}
|
||||
Provides: java-devel%{?1} = %{epoch}:%{version}-%{release}
|
||||
Provides: java-%{origin}-devel%{?1} = %{epoch}:%{version}-%{release}
|
||||
Provides: java-sdk%{?1} = %{epoch}:%{version}-%{release}
|
||||
%endif
|
||||
}
|
||||
@ -1088,6 +1094,9 @@ Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}
|
||||
|
||||
Epoch: 1
|
||||
Summary: %{origin_nice} %{featurever} Runtime Environment
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
# HotSpot code is licensed under GPLv2
|
||||
# JDK library code is licensed under GPLv2 with the Classpath exception
|
||||
@ -1149,7 +1158,7 @@ Source17: nss.fips.cfg.in
|
||||
# NSS via SunPKCS11 Provider (disabled comment
|
||||
# due to memory leak).
|
||||
Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch
|
||||
# enable build of speculative store bypass hardened alt-java
|
||||
# RH1750419: enable build of speculative store bypass hardened alt-java (CVE-2018-3639)
|
||||
Patch600: rh1750419-redhat_alt_java.patch
|
||||
|
||||
# Ignore AWTError when assistive technologies are loaded
|
||||
@ -1246,6 +1255,9 @@ The %{origin_nice} %{featurever} runtime environment.
|
||||
%if %{include_debug_build}
|
||||
%package slowdebug
|
||||
Summary: %{origin_nice} %{featurever} Runtime Environment %{debug_on}
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_rpo -- %{debug_suffix_unquoted}}
|
||||
%description slowdebug
|
||||
@ -1256,7 +1268,9 @@ The %{origin_nice} %{featurever} runtime environment.
|
||||
%if %{include_fastdebug_build}
|
||||
%package fastdebug
|
||||
Summary: %{origin_nice} %{featurever} Runtime Environment %{fastdebug_on}
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_rpo -- %{fastdebug_suffix_unquoted}}
|
||||
%description fastdebug
|
||||
@ -1267,6 +1281,9 @@ The %{origin_nice} %{featurever} runtime environment.
|
||||
%if %{include_normal_build}
|
||||
%package headless
|
||||
Summary: %{origin_nice} %{featurever} Headless Runtime Environment
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_headless_rpo %{nil}}
|
||||
|
||||
@ -1277,6 +1294,7 @@ The %{origin_nice} %{featurever} runtime environment without audio and video sup
|
||||
%if %{include_debug_build}
|
||||
%package headless-slowdebug
|
||||
Summary: %{origin_nice} %{featurever} Runtime Environment %{debug_on}
|
||||
Group: Development/Languages
|
||||
|
||||
%{java_headless_rpo -- %{debug_suffix_unquoted}}
|
||||
|
||||
@ -1300,6 +1318,9 @@ The %{origin_nice} %{featurever} runtime environment without audio and video sup
|
||||
%if %{include_normal_build}
|
||||
%package devel
|
||||
Summary: %{origin_nice} %{featurever} Development Environment
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_devel_rpo %{nil}}
|
||||
|
||||
@ -1310,6 +1331,9 @@ The %{origin_nice} %{featurever} development tools.
|
||||
%if %{include_debug_build}
|
||||
%package devel-slowdebug
|
||||
Summary: %{origin_nice} %{featurever} Development Environment %{debug_on}
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_devel_rpo -- %{debug_suffix_unquoted}}
|
||||
|
||||
@ -1370,6 +1394,9 @@ The %{origin_nice} %{featurever} libraries for static linking.
|
||||
%if %{include_normal_build}
|
||||
%package jmods
|
||||
Summary: JMods for %{origin_nice} %{featurever}
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_jmods_rpo %{nil}}
|
||||
|
||||
@ -1380,6 +1407,9 @@ The JMods for %{origin_nice} %{featurever}.
|
||||
%if %{include_debug_build}
|
||||
%package jmods-slowdebug
|
||||
Summary: JMods for %{origin_nice} %{featurever} %{debug_on}
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_jmods_rpo -- %{debug_suffix_unquoted}}
|
||||
|
||||
@ -1400,10 +1430,12 @@ The JMods for %{origin_nice} %{featurever}.
|
||||
%{fastdebug_warning}
|
||||
%endif
|
||||
|
||||
|
||||
%if %{include_normal_build}
|
||||
%package demo
|
||||
Summary: %{origin_nice} %{featurever} Demos
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_demo_rpo %{nil}}
|
||||
|
||||
@ -1414,6 +1446,9 @@ The %{origin_nice} %{featurever} demos.
|
||||
%if %{include_debug_build}
|
||||
%package demo-slowdebug
|
||||
Summary: %{origin_nice} %{featurever} Demos %{debug_on}
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_demo_rpo -- %{debug_suffix_unquoted}}
|
||||
|
||||
@ -1437,6 +1472,9 @@ The %{origin_nice} %{featurever} demos.
|
||||
%if %{include_normal_build}
|
||||
%package src
|
||||
Summary: %{origin_nice} %{featurever} Source Bundle
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_src_rpo %{nil}}
|
||||
|
||||
@ -1448,6 +1486,9 @@ class library source code for use by IDE indexers and debuggers.
|
||||
%if %{include_debug_build}
|
||||
%package src-slowdebug
|
||||
Summary: %{origin_nice} %{featurever} Source Bundle %{for_debug}
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Development/Languages
|
||||
%endif
|
||||
|
||||
%{java_src_rpo -- %{debug_suffix_unquoted}}
|
||||
|
||||
@ -1468,10 +1509,12 @@ The %{compatiblename}-src-fastdebug sub-package contains the complete %{origin_n
|
||||
class library source code for use by IDE indexers and debuggers, %{for_fastdebug}.
|
||||
%endif
|
||||
|
||||
|
||||
%if %{include_normal_build}
|
||||
%package javadoc
|
||||
Summary: %{origin_nice} %{featurever} API documentation
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Documentation
|
||||
%endif
|
||||
Requires: javapackages-filesystem
|
||||
Obsoletes: javadoc-slowdebug < 1:13.0.0.33-1.rolling
|
||||
|
||||
@ -1484,6 +1527,9 @@ The %{origin_nice} %{featurever} API documentation.
|
||||
%if %{include_normal_build}
|
||||
%package javadoc-zip
|
||||
Summary: %{origin_nice} %{featurever} API documentation compressed in a single archive
|
||||
%if 0%{?rhel} <= 8
|
||||
Group: Documentation
|
||||
%endif
|
||||
Requires: javapackages-filesystem
|
||||
Obsoletes: javadoc-zip-slowdebug < 1:13.0.0.33-1.rolling
|
||||
|
||||
@ -1561,7 +1607,6 @@ cp -r tapset tapset%{debug_suffix}
|
||||
cp -r tapset tapset%{fastdebug_suffix}
|
||||
%endif
|
||||
|
||||
|
||||
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"`
|
||||
@ -1636,60 +1681,46 @@ EXTRA_CPP_FLAGS="$EXTRA_CPP_FLAGS -DSTAP_SDT_ARG_CONSTRAINT=g"
|
||||
%endif
|
||||
export EXTRA_CFLAGS EXTRA_CPP_FLAGS
|
||||
|
||||
for suffix in %{build_loop} ; do
|
||||
if [ "x$suffix" = "x" ] ; then
|
||||
debugbuild=release
|
||||
else
|
||||
# change --something to something
|
||||
debugbuild=`echo $suffix | sed "s/-//g"`
|
||||
fi
|
||||
function buildjdk() {
|
||||
local outputdir=${1}
|
||||
local buildjdk=${2}
|
||||
local maketargets="${3}"
|
||||
local debuglevel=${4}
|
||||
local link_opt=${5}
|
||||
|
||||
for loop in %{main_suffix} %{staticlibs_loop} ; do
|
||||
local top_dir_abs_src_path=$(pwd)/%{top_level_dir_name}
|
||||
local top_dir_abs_build_path=$(pwd)/${outputdir}
|
||||
|
||||
if test "x${loop}" = "x%{main_suffix}" ; then
|
||||
# Copy the source tree so we can remove all in-tree libraries
|
||||
cp -a %{top_level_dir_name} %{top_level_dir_name_backup}
|
||||
# Remove all libraries that are linked
|
||||
sh %{SOURCE12} %{top_level_dir_name} full
|
||||
# Variable used by configure and hs_err hook on build failures
|
||||
link_opt="system"
|
||||
# Debug builds don't need same targets as release for
|
||||
# build speed-up
|
||||
maketargets="%{release_targets}"
|
||||
if echo $debugbuild | grep -q "debug" ; then
|
||||
maketargets="%{debug_targets}"
|
||||
# The OpenJDK version file includes the current
|
||||
# upstream version information. For some reason,
|
||||
# configure does not automatically use the
|
||||
# default pre-version supplied there (despite
|
||||
# what the file claims), so we pass it manually
|
||||
# to configure
|
||||
VERSION_FILE=${top_dir_abs_src_path}/make/conf/version-numbers.conf
|
||||
if [ -f ${VERSION_FILE} ] ; then
|
||||
EA_DESIGNATOR=$(grep '^DEFAULT_PROMOTED_VERSION_PRE' ${VERSION_FILE} | cut -d '=' -f 2)
|
||||
else
|
||||
echo "Could not find OpenJDK version file.";
|
||||
exit 16
|
||||
fi
|
||||
if [ "x${EA_DESIGNATOR}" != "x%{expected_ea_designator}" ] ; then
|
||||
echo "Spec file is configured for a %{build_type} build, but upstream version-pre setting is ${EA_DESIGNATOR}";
|
||||
exit 17
|
||||
fi
|
||||
else
|
||||
# Variable used by configure and hs_err hook on build failures
|
||||
link_opt="bundled"
|
||||
# Static library cycle only builds the static libraries
|
||||
maketargets="%{static_libs_target}"
|
||||
fi
|
||||
|
||||
top_dir_abs_src_path=$(pwd)/%{top_level_dir_name}
|
||||
top_dir_abs_build_path=$(pwd)/%{buildoutputdir -- ${suffix}${loop}}
|
||||
# The OpenJDK version file includes the current
|
||||
# upstream version information. For some reason,
|
||||
# configure does not automatically use the
|
||||
# default pre-version supplied there (despite
|
||||
# what the file claims), so we pass it manually
|
||||
# to configure
|
||||
VERSION_FILE=${top_dir_abs_src_path}/make/conf/version-numbers.conf
|
||||
if [ -f ${VERSION_FILE} ] ; then
|
||||
EA_DESIGNATOR=$(grep '^DEFAULT_PROMOTED_VERSION_PRE' ${VERSION_FILE} | cut -d '=' -f 2)
|
||||
else
|
||||
echo "Could not find OpenJDK version file.";
|
||||
exit 16
|
||||
fi
|
||||
if [ "x${EA_DESIGNATOR}" != "x%{expected_ea_designator}" ] ; then
|
||||
echo "Spec file is configured for a %{build_type} build, but upstream version-pre setting is ${EA_DESIGNATOR}";
|
||||
exit 17
|
||||
fi
|
||||
echo "Using output directory: ${outputdir}";
|
||||
echo "Checking build JDK ${buildjdk} is operational..."
|
||||
${buildjdk}/bin/java -version
|
||||
echo "Using make targets: ${maketargets}"
|
||||
echo "Using debuglevel: ${debuglevel}"
|
||||
echo "Using link_opt: ${link_opt}"
|
||||
echo "Building %{newjavaver}-%{buildver}, pre=${EA_DESIGNATOR}, opt=%{lts_designator}"
|
||||
|
||||
mkdir -p ${top_dir_abs_build_path}
|
||||
pushd ${top_dir_abs_build_path}
|
||||
mkdir -p ${outputdir}
|
||||
pushd ${outputdir}
|
||||
|
||||
bash ${top_dir_abs_src_path}/configure \
|
||||
bash ${top_dir_abs_src_path}/configure \
|
||||
%ifnarch %{jit_arches}
|
||||
--with-jvm-variants=zero \
|
||||
%endif
|
||||
@ -1704,9 +1735,9 @@ bash ${top_dir_abs_src_path}/configure \
|
||||
--with-vendor-url="https://www.redhat.com/" \
|
||||
--with-vendor-bug-url="%{bugs}" \
|
||||
--with-vendor-vm-bug-url="%{bugs}" \
|
||||
--with-boot-jdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk \
|
||||
--with-debug-level=$debugbuild \
|
||||
--with-native-debug-symbols=internal \
|
||||
--with-boot-jdk=${buildjdk} \
|
||||
--with-debug-level=${debuglevel} \
|
||||
--with-native-debug-symbols="%{debug_symbols}" \
|
||||
--enable-sysconf-nss \
|
||||
--enable-unlimited-crypto \
|
||||
--with-zlib=system \
|
||||
@ -1727,53 +1758,105 @@ bash ${top_dir_abs_src_path}/configure \
|
||||
%endif
|
||||
--disable-warnings-as-errors
|
||||
|
||||
make \
|
||||
LOG=trace \
|
||||
WARNINGS_ARE_ERRORS="-Wno-error" \
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \
|
||||
$maketargets || ( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name "hs_err_pid*.log" | xargs cat && false )
|
||||
cat spec.gmk
|
||||
|
||||
popd >& /dev/null
|
||||
make \
|
||||
LOG=trace \
|
||||
WARNINGS_ARE_ERRORS="-Wno-error" \
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \
|
||||
$maketargets || ( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name "hs_err_pid*.log" | xargs cat && false )
|
||||
|
||||
# Restore original source tree if we modified it by removing full in-tree sources
|
||||
if [ -d %{top_level_dir_name_backup} ] ; then
|
||||
rm -rf %{top_level_dir_name}
|
||||
mv %{top_level_dir_name_backup} %{top_level_dir_name}
|
||||
fi
|
||||
popd
|
||||
}
|
||||
|
||||
done # end of main / staticlibs loop
|
||||
function installjdk() {
|
||||
local imagepath=${1}
|
||||
|
||||
top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}}
|
||||
# the build (erroneously) removes read permissions from some jars
|
||||
# this is a regression in OpenJDK 7 (our compiler):
|
||||
# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
|
||||
find ${imagepath} -iname '*.jar' -exec chmod ugo+r {} \;
|
||||
|
||||
# the build (erroneously) removes read permissions from some jars
|
||||
# this is a regression in OpenJDK 7 (our compiler):
|
||||
# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
|
||||
find ${top_dir_abs_main_build_path}/images/%{jdkimage} -iname '*.jar' -exec chmod ugo+r {} \;
|
||||
# Build screws up permissions on binaries
|
||||
# https://bugs.openjdk.java.net/browse/JDK-8173610
|
||||
find ${imagepath} -iname '*.so' -exec chmod +x {} \;
|
||||
find ${imagepath}/bin/ -exec chmod +x {} \;
|
||||
|
||||
# Build screws up permissions on binaries
|
||||
# https://bugs.openjdk.java.net/browse/JDK-8173610
|
||||
find ${top_dir_abs_main_build_path}/images/%{jdkimage} -iname '*.so' -exec chmod +x {} \;
|
||||
find ${top_dir_abs_main_build_path}/images/%{jdkimage}/bin/ -exec chmod +x {} \;
|
||||
# Install nss.cfg right away as we will be using the JRE above
|
||||
install -m 644 nss.cfg ${imagepath}/conf/security/
|
||||
|
||||
# Install nss.cfg right away as we will be using the JRE above
|
||||
export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage}
|
||||
# Install nss.fips.cfg: NSS configuration for global FIPS mode (crypto-policies)
|
||||
install -m 644 nss.fips.cfg ${imagepath}/conf/security/
|
||||
|
||||
# Install nss.cfg right away as we will be using the JRE above
|
||||
install -m 644 nss.cfg $JAVA_HOME/conf/security/
|
||||
# Use system-wide tzdata
|
||||
rm ${imagepath}/lib/tzdb.dat
|
||||
ln -s %{_datadir}/javazi-1.8/tzdb.dat ${imagepath}/lib/tzdb.dat
|
||||
|
||||
# Install nss.fips.cfg: NSS configuration for global FIPS mode (crypto-policies)
|
||||
install -m 644 nss.fips.cfg $JAVA_HOME/conf/security/
|
||||
# Create fake alt-java as a placeholder for future alt-java
|
||||
pushd ${imagepath}
|
||||
# add alt-java man page
|
||||
echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1
|
||||
cat man/man1/java.1 >> man/man1/%{alt_java_name}.1
|
||||
popd
|
||||
}
|
||||
|
||||
# Use system-wide tzdata
|
||||
rm $JAVA_HOME/lib/tzdb.dat
|
||||
ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/lib/tzdb.dat
|
||||
for suffix in %{build_loop} ; do
|
||||
|
||||
# Create fake alt-java as a placeholder for future alt-java
|
||||
pushd ${JAVA_HOME}
|
||||
# add alt-java man page
|
||||
echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1
|
||||
cat man/man1/java.1 >> man/man1/%{alt_java_name}.1
|
||||
popd
|
||||
if [ "x$suffix" = "x" ] ; then
|
||||
debugbuild=release
|
||||
else
|
||||
# change --something to something
|
||||
debugbuild=`echo $suffix | sed "s/-//g"`
|
||||
fi
|
||||
|
||||
systemjdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk
|
||||
|
||||
for loop in %{main_suffix} %{staticlibs_loop} ; do
|
||||
|
||||
builddir=%{buildoutputdir -- ${suffix}${loop}}
|
||||
bootbuilddir=boot${builddir}
|
||||
|
||||
if test "x${loop}" = "x%{main_suffix}" ; then
|
||||
# Copy the source tree so we can remove all in-tree libraries
|
||||
cp -a %{top_level_dir_name} %{top_level_dir_name_backup}
|
||||
# Remove all libraries that are linked
|
||||
sh %{SOURCE12} %{top_level_dir_name} full
|
||||
# Use system libraries
|
||||
link_opt="system"
|
||||
# Debug builds don't need same targets as release for
|
||||
# build speed-up. We also avoid bootstrapping these
|
||||
# slower builds.
|
||||
if echo $debugbuild | grep -q "debug" ; then
|
||||
maketargets="%{debug_targets}"
|
||||
run_bootstrap=false
|
||||
else
|
||||
maketargets="%{release_targets}"
|
||||
run_bootstrap=%{bootstrap_build}
|
||||
fi
|
||||
if ${run_bootstrap} ; then
|
||||
buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt}
|
||||
buildjdk ${builddir} $(pwd)/${bootbuilddir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt}
|
||||
rm -rf ${bootbuilddir}
|
||||
else
|
||||
buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt}
|
||||
fi
|
||||
# Restore original source tree we modified by removing full in-tree sources
|
||||
rm -rf %{top_level_dir_name}
|
||||
mv %{top_level_dir_name_backup} %{top_level_dir_name}
|
||||
else
|
||||
# Use bundled libraries for building statically
|
||||
link_opt="bundled"
|
||||
# Static library cycle only builds the static libraries
|
||||
maketargets="%{static_libs_target}"
|
||||
# Always just do the one build for the static libraries
|
||||
buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt}
|
||||
fi
|
||||
|
||||
done # end of main / staticlibs loop
|
||||
|
||||
# Final setup on the main image
|
||||
top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}}
|
||||
installjdk ${top_dir_abs_main_build_path}/images/%{jdkimage}
|
||||
|
||||
# build cycles
|
||||
done # end of release / debug cycle loop
|
||||
@ -1824,8 +1907,9 @@ 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
|
||||
%endif
|
||||
|
||||
so_suffix="so"
|
||||
# Check debug symbols are present and can identify code
|
||||
find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib
|
||||
find "$JAVA_HOME" -iname "*.$so_suffix" -print0 | while read -d $'\0' lib
|
||||
do
|
||||
if [ -f "$lib" ] ; then
|
||||
echo "Testing $lib for debug symbols"
|
||||
@ -1893,15 +1977,16 @@ quit
|
||||
end
|
||||
run -version
|
||||
EOF
|
||||
|
||||
%if 0%{?fedora} > 0
|
||||
# This fails on s390x for some reason. Disable for now. See:
|
||||
# https://koji.fedoraproject.org/koji/taskinfo?taskID=41499227
|
||||
%ifnarch s390x
|
||||
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Check src.zip has all sources. See RHBZ#1130490
|
||||
jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
|
||||
$JAVA_HOME/bin/jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
|
||||
|
||||
# Check class files include useful debugging information
|
||||
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
|
||||
@ -2282,6 +2367,14 @@ cjc.mainProgram(args)
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Nov 30 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.1.0.12-4.rolling
|
||||
- Restructure the build so a minimal initial build is then used for the final build (with docs)
|
||||
- This reduces pressure on the system JDK and ensures the JDK being built can do a full build
|
||||
- Turn off bootstrapping for slow debug builds, which are particularly slow on ppc64le.
|
||||
|
||||
* Tue Nov 30 2021 Jiri Vanek <jvanek@redhat.com> - 1:17.0.1.0.12-4.rolling
|
||||
- Minor cosmetic improvements to make spec more comparable between variants
|
||||
|
||||
* Mon Nov 29 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.1.0.12-3.rolling
|
||||
- Add -DSTAP_SDT_ARG_CONSTRAINT=g workaround on aarch32 to fix build
|
||||
- See https://bugzilla.redhat.com/show_bug.cgi?id=2026858
|
||||
|
Loading…
Reference in New Issue
Block a user