Switch to static builds, reducing system dependencies and making build more portable
Resolves: rhbz#2121273
This commit is contained in:
parent
d9d44a0f3a
commit
b53bb40201
@ -26,6 +26,8 @@
|
|||||||
%bcond_with artifacts
|
%bcond_with artifacts
|
||||||
# Build a fresh libjvm.so for use in a copy of the bootstrap JDK
|
# Build a fresh libjvm.so for use in a copy of the bootstrap JDK
|
||||||
%bcond_without fresh_libjvm
|
%bcond_without fresh_libjvm
|
||||||
|
# Build with system libraries
|
||||||
|
%bcond_with system_libs
|
||||||
|
|
||||||
# Define whether to use the bootstrap JDK directly or with a fresh libjvm.so
|
# Define whether to use the bootstrap JDK directly or with a fresh libjvm.so
|
||||||
%if %{with fresh_libjvm}
|
%if %{with fresh_libjvm}
|
||||||
@ -34,6 +36,16 @@
|
|||||||
%global build_hotspot_first 0
|
%global build_hotspot_first 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with system_libs}
|
||||||
|
%global system_libs 1
|
||||||
|
%global link_type system
|
||||||
|
%global jpeg_lib |libjavajpeg[.]so.*
|
||||||
|
%else
|
||||||
|
%global system_libs 0
|
||||||
|
%global link_type bundled
|
||||||
|
%global jpeg_lib |libjpeg[.]so.*
|
||||||
|
%endif
|
||||||
|
|
||||||
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
|
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
|
||||||
# This fixes detailed NMT and other tools which need minimal debug info.
|
# This fixes detailed NMT and other tools which need minimal debug info.
|
||||||
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879
|
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879
|
||||||
@ -331,7 +343,7 @@
|
|||||||
%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u})
|
%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u})
|
||||||
# eg jdk8u60-b27 -> b27
|
# eg jdk8u60-b27 -> b27
|
||||||
%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-})
|
%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-})
|
||||||
%global rpmrelease 3
|
%global rpmrelease 4
|
||||||
# Define milestone (EA for pre-releases, GA ("fcs") for releases)
|
# Define milestone (EA for pre-releases, GA ("fcs") for releases)
|
||||||
# Release will be (where N is usually a number starting at 1):
|
# Release will be (where N is usually a number starting at 1):
|
||||||
# - 0.N%%{?extraver}%%{?dist} for EA releases,
|
# - 0.N%%{?extraver}%%{?dist} for EA releases,
|
||||||
@ -375,7 +387,7 @@
|
|||||||
# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349
|
# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1655938
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1655938
|
||||||
%global _privatelibs libattach[.]so.*|libawt_headless[.]so.*|libawt[.]so.*|libawt_xawt[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libhprof[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas_unix[.]so.*|libjava_crw_demo[.]so.*|libjavajpeg[.]so.*|libjdwp[.]so.*|libjli[.]so.*|libjsdt[.]so.*|libjsoundalsa[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libnpt[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsplashscreen[.]so.*|libsunec[.]so.*|libsystemconf[.]so.*|libunpack[.]so.*|libzip[.]so.*|lib[.]so\\(SUNWprivate_.*
|
%global _privatelibs libattach[.]so.*|libawt_headless[.]so.*|libawt[.]so.*|libawt_xawt[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libhprof[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas_unix[.]so.*|libjava_crw_demo[.]so.*|libjdwp[.]so.*|libjli[.]so.*|libjsdt[.]so.*|libjsoundalsa[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libnpt[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsplashscreen[.]so.*|libsunec[.]so.*|libsystemconf[.]so.*|libunpack[.]so.*|libzip[.]so.*|lib[.]so\\(SUNWprivate_.*%{jpeg_lib}
|
||||||
%global _publiclibs libjawt[.]so.*|libjava[.]so.*|libjvm[.]so.*|libverify[.]so.*|libjsig[.]so.*
|
%global _publiclibs libjawt[.]so.*|libjava[.]so.*|libjvm[.]so.*|libverify[.]so.*|libjsig[.]so.*
|
||||||
%if %is_system_jdk
|
%if %is_system_jdk
|
||||||
%global __provides_exclude ^(%{_privatelibs})$
|
%global __provides_exclude ^(%{_privatelibs})$
|
||||||
@ -899,7 +911,11 @@ exit 0
|
|||||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjaas_unix.so
|
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjaas_unix.so
|
||||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjava.so
|
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjava.so
|
||||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjava_crw_demo.so
|
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjava_crw_demo.so
|
||||||
|
%if %{system_libs}
|
||||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjavajpeg.so
|
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjavajpeg.so
|
||||||
|
%else
|
||||||
|
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjpeg.so
|
||||||
|
%endif
|
||||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjdwp.so
|
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjdwp.so
|
||||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjsdt.so
|
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjsdt.so
|
||||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjsig.so
|
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libjsig.so
|
||||||
@ -1570,12 +1586,8 @@ BuildRequires: desktop-file-utils
|
|||||||
BuildRequires: elfutils-devel
|
BuildRequires: elfutils-devel
|
||||||
BuildRequires: fontconfig-devel
|
BuildRequires: fontconfig-devel
|
||||||
BuildRequires: freetype-devel
|
BuildRequires: freetype-devel
|
||||||
BuildRequires: giflib-devel
|
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: gdb
|
BuildRequires: gdb
|
||||||
BuildRequires: lcms2-devel
|
|
||||||
BuildRequires: libjpeg-devel
|
|
||||||
BuildRequires: libpng-devel
|
|
||||||
BuildRequires: libxslt
|
BuildRequires: libxslt
|
||||||
BuildRequires: libX11-devel
|
BuildRequires: libX11-devel
|
||||||
BuildRequires: libXext-devel
|
BuildRequires: libXext-devel
|
||||||
@ -1607,6 +1619,24 @@ BuildRequires: gcc >= 4.8.3-8
|
|||||||
BuildRequires: systemtap-sdt-devel
|
BuildRequires: systemtap-sdt-devel
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{system_libs}
|
||||||
|
BuildRequires: giflib-devel
|
||||||
|
BuildRequires: lcms2-devel
|
||||||
|
BuildRequires: libjpeg-devel
|
||||||
|
BuildRequires: libpng-devel
|
||||||
|
%else
|
||||||
|
# Version in jdk/src/share/native/sun/awt/giflib/gif_lib.h
|
||||||
|
Provides: bundled(giflib) = 5.2.1
|
||||||
|
# Version in jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h
|
||||||
|
Provides: bundled(lcms2) = 2.10.0
|
||||||
|
# Version in jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h
|
||||||
|
Provides: bundled(libjpeg) = 6b
|
||||||
|
# Version in jdk/src/share/native/sun/awt/libpng/png.h
|
||||||
|
Provides: bundled(libpng) = 1.6.37
|
||||||
|
# We link statically against libstdc++ to increase portability
|
||||||
|
BuildRequires: libstdc++-static
|
||||||
|
%endif
|
||||||
|
|
||||||
# this is always built, also during debug-only build
|
# this is always built, also during debug-only build
|
||||||
# when it is built in debug-only this package is just placeholder
|
# when it is built in debug-only this package is just placeholder
|
||||||
%{java_rpo %{nil}}
|
%{java_rpo %{nil}}
|
||||||
@ -1859,14 +1889,18 @@ cp %{SOURCE101} %{top_level_dir_name}/common/autoconf/build-aux/
|
|||||||
|
|
||||||
# OpenJDK patches
|
# OpenJDK patches
|
||||||
|
|
||||||
|
%if %{system_libs}
|
||||||
# Remove libraries that are linked
|
# Remove libraries that are linked
|
||||||
sh %{SOURCE12}
|
sh %{SOURCE12}
|
||||||
|
%endif
|
||||||
|
|
||||||
# System library fixes
|
# System library fixes
|
||||||
|
%if %{system_libs}
|
||||||
%patch201
|
%patch201
|
||||||
%patch202
|
%patch202
|
||||||
%patch203
|
%patch203
|
||||||
%patch204
|
%patch204
|
||||||
|
%endif
|
||||||
|
|
||||||
%patch5
|
%patch5
|
||||||
|
|
||||||
@ -2004,11 +2038,18 @@ function buildjdk() {
|
|||||||
local buildjdk=${2}
|
local buildjdk=${2}
|
||||||
local maketargets="${3}"
|
local maketargets="${3}"
|
||||||
local debuglevel=${4}
|
local debuglevel=${4}
|
||||||
|
local link_opt=${5}
|
||||||
|
|
||||||
local top_srcdir_abs_path=$(pwd)/%{top_level_dir_name}
|
local top_srcdir_abs_path=$(pwd)/%{top_level_dir_name}
|
||||||
# Variable used in hs_err hook on build failures
|
# Variable used in hs_err hook on build failures
|
||||||
local top_builddir_abs_path=$(pwd)/${outputdir}
|
local top_builddir_abs_path=$(pwd)/${outputdir}
|
||||||
|
|
||||||
|
if [ "x${link_opt}" = "xbundled" ] ; then
|
||||||
|
libc_link_opt="static";
|
||||||
|
else
|
||||||
|
libc_link_opt="dynamic";
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Checking build JDK ${buildjdk} is operational..."
|
echo "Checking build JDK ${buildjdk} is operational..."
|
||||||
${buildjdk}/bin/java -version
|
${buildjdk}/bin/java -version
|
||||||
echo "Building 8u%{updatever}-%{buildver}, milestone %{milestone}"
|
echo "Building 8u%{updatever}-%{buildver}, milestone %{milestone}"
|
||||||
@ -2037,12 +2078,14 @@ function buildjdk() {
|
|||||||
--with-debug-level=${debuglevel} \
|
--with-debug-level=${debuglevel} \
|
||||||
--disable-sysconf-nss \
|
--disable-sysconf-nss \
|
||||||
--enable-unlimited-crypto \
|
--enable-unlimited-crypto \
|
||||||
--with-zlib=system \
|
--with-zlib=${link_opt} \
|
||||||
--with-libjpeg=system \
|
--with-giflib=${link_opt} \
|
||||||
--with-giflib=system \
|
%if %{with system_libs}
|
||||||
--with-libpng=system \
|
--with-libjpeg=${link_opt} \
|
||||||
--with-lcms=system \
|
--with-libpng=${link_opt} \
|
||||||
--with-stdc++lib=dynamic \
|
--with-lcms=${link_opt} \
|
||||||
|
%endif
|
||||||
|
--with-stdc++lib=${libc_link_opt} \
|
||||||
--with-extra-cxxflags="$EXTRA_CPP_FLAGS" \
|
--with-extra-cxxflags="$EXTRA_CPP_FLAGS" \
|
||||||
--with-extra-cflags="$EXTRA_CFLAGS" \
|
--with-extra-cflags="$EXTRA_CFLAGS" \
|
||||||
--with-extra-asflags="$EXTRA_ASFLAGS" \
|
--with-extra-asflags="$EXTRA_ASFLAGS" \
|
||||||
@ -2148,6 +2191,7 @@ builddir=%{buildoutputdir -- $suffix}
|
|||||||
bootbuilddir=boot${builddir}
|
bootbuilddir=boot${builddir}
|
||||||
installdir=%{installoutputdir -- $suffix}
|
installdir=%{installoutputdir -- $suffix}
|
||||||
bootinstalldir=boot${installdir}
|
bootinstalldir=boot${installdir}
|
||||||
|
link_opt="%{link_type}"
|
||||||
|
|
||||||
# Debug builds don't need same targets as release for
|
# Debug builds don't need same targets as release for
|
||||||
# build speed-up. We also avoid bootstrapping these
|
# build speed-up. We also avoid bootstrapping these
|
||||||
@ -2161,13 +2205,13 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ${run_bootstrap} ; then
|
if ${run_bootstrap} ; then
|
||||||
buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild}
|
buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt}
|
||||||
installjdk ${bootbuilddir} ${bootinstalldir}
|
installjdk ${bootbuilddir} ${bootinstalldir}
|
||||||
buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild}
|
buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt}
|
||||||
installjdk ${builddir} ${installdir}
|
installjdk ${builddir} ${installdir}
|
||||||
%{!?with_artifacts:rm -rf ${bootinstalldir}}
|
%{!?with_artifacts:rm -rf ${bootinstalldir}}
|
||||||
else
|
else
|
||||||
buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild}
|
buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt}
|
||||||
installjdk ${builddir} ${installdir}
|
installjdk ${builddir} ${installdir}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -2664,6 +2708,10 @@ cjc.mainProgram(args)
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 30 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.345.b01-4
|
||||||
|
- Switch to static builds, reducing system dependencies and making build more portable
|
||||||
|
- Resolves: rhbz#2121273
|
||||||
|
|
||||||
* Mon Aug 29 2022 Stephan Bergmann <sbergman@redhat.com> - 1:1.8.0.345.b01-3
|
* Mon Aug 29 2022 Stephan Bergmann <sbergman@redhat.com> - 1:1.8.0.345.b01-3
|
||||||
- Disable copy-jdk-configs for Flatpak builds
|
- Disable copy-jdk-configs for Flatpak builds
|
||||||
- Fix flatpak builds by exempting them from bootstrap
|
- Fix flatpak builds by exempting them from bootstrap
|
||||||
|
Loading…
Reference in New Issue
Block a user