[packages/openjdk8] up to 1.8.0.302

atler atler at pld-linux.org
Sat Jul 31 20:19:03 CEST 2021


commit 0fa4da98159b34053bcd25e43c379df7a704f25f
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Jul 31 18:14:10 2021 +0000

    up to 1.8.0.302
    
    - dropped obsolete patches
    - system-lib*, x32 patches synced with debian
    - patch to fix build with gcc 11 taken from fedora
    - patch to fix libjpeg linking with --as-needed from debian
    - arm patch from debian
    - more alignment with current icedtea8
    - versioning in line with `java -version` (bumped epoch)

 aarch32.patch             | 179 +++++++++++++++++++++++++++++
 download.sh               |  32 ------
 gcc11.patch               |  74 ++++++++++++
 gcc6.patch                | 118 -------------------
 link-with-as-needed.patch |  40 +++++++
 openjdk8.spec             | 286 ++++++++++++++++++++++++----------------------
 protos.patch              |  24 ----
 system-lcms.patch         |  27 +++--
 system-libjpeg.patch      | 198 +++++---------------------------
 system-libpng.patch       |  32 +++---
 system-pcsclite.patch     |  47 ++++----
 x32.patch                 | 109 +++++-------------
 12 files changed, 549 insertions(+), 617 deletions(-)
---
diff --git a/openjdk8.spec b/openjdk8.spec
index af54df7..4d43f6f 100644
--- a/openjdk8.spec
+++ b/openjdk8.spec
@@ -1,52 +1,47 @@
-#
-# NOTE:	versioning and release status might not be clear
-#	http://openjdk.java.net/projects/jdk8u/ gives some information
-#	about current status of the 'updates'
-#
-# TODO:
-#	- use other system libs (libsctp?)
-#	- include icedtea-sound?
-#	- consider zeroshark (LLVM-based JIT) for x32
-
-%bcond_with bootstrap   # build a bootstrap version, using icedtea6
-%bcond_without cacerts	# don't include the default CA certificates
+%bcond_with	bootstrap	# build a bootstrap version, using icedtea6
+%bcond_without	cacerts		# don't include the default CA certificates
 
 %if %{with bootstrap}
-%define		use_jdk	icedtea7
+%define		use_jdk	icedtea8
 %else
 %define		use_jdk	openjdk8
 %endif
 
+%ifarch %{ix86} %{x8664} sparc ppc64 ppc64le %{arm} aarch64
+%define		with_jfr	1
+%endif
+
 # class data version seen with file(1) that this jvm is able to load
 %define		_classdataversion 52.0
-# JDK/JRE version, as returned with `java -version`, '_' replaced with '.'
-%define		_jdkversion 1.8.0.internal
 
-%define	ver_u	102
-%define	ver_b	14
+%define	ver_u	302
+
 Summary:	Open-source implementation of the Java Platform, Standard Edition
 Summary(pl.UTF-8):	Wolnoźródłowa implementacja Java 8 SE
 Name:		openjdk8
-Version:	8u%{ver_u}.b%{ver_b}
-Release:	2
+Version:	1.8.0.%{ver_u}
+Release:	1
+Epoch:		1
 License:	GPL v2
 Group:		Development/Languages/Java
-Source0:	%{name}-jdk8u%{ver_u}-b%{ver_b}.tar.bz2
-# Source0-md5:	04ecdce899eb3d6de9d5aadc438998c0
-Source1:	%{name}-corba-jdk8u%{ver_u}-b%{ver_b}.tar.bz2
-# Source1-md5:	6ea4a074a80d0ee4b6dcd50398835c49
-Source2:	%{name}-hotspot-jdk8u%{ver_u}-b%{ver_b}.tar.bz2
-# Source2-md5:	27b9e7e94fc6a47f452e8a94ba156395
-Source3:	%{name}-jaxp-jdk8u%{ver_u}-b%{ver_b}.tar.bz2
-# Source3-md5:	da82a91df3eb4c98ebaab4e71cbbcc4d
-Source4:	%{name}-jaxws-jdk8u%{ver_u}-b%{ver_b}.tar.bz2
-# Source4-md5:	8a91561bbc04f50a92032d82b78960e0
-Source5:	%{name}-jdk-jdk8u%{ver_u}-b%{ver_b}.tar.bz2
-# Source5-md5:	e65f6d029808a8b523e07d818c8ac9ad
-Source6:	%{name}-langtools-jdk8u%{ver_u}-b%{ver_b}.tar.bz2
-# Source6-md5:	61c645dbacfb925944f716ec50474821
-Source7:	%{name}-nashorn-jdk8u%{ver_u}-b%{ver_b}.tar.bz2
-# Source7-md5:	2c981235c1cbaba58197fd9b7ffd00e1
+Source0:	https://hg.openjdk.java.net/jdk8u/jdk8u/archive/jdk8u%{ver_u}-ga.tar.bz2?/%{name}-%{version}.tar.bz2
+# Source0-md5:	02c47e715966e341aec8d79655190310
+Source1:	https://hg.openjdk.java.net/jdk8u/jdk8u/corba/archive/jdk8u%{ver_u}-ga.tar.bz2?/%{name}-corba-%{version}.tar.bz2
+# Source1-md5:	5c11ab1b05ec1859a03212a90de49a6a
+Source2:	https://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/archive/jdk8u%{ver_u}-ga.tar.bz2?/%{name}-hotspot-%{version}.tar.bz2
+# Source2-md5:	091ed5f35e17cfe6e4da3ab4ae9b0049
+Source3:	https://hg.openjdk.java.net/jdk8u/jdk8u/jaxp/archive/jdk8u%{ver_u}-ga.tar.bz2?/%{name}-jaxp-%{version}.tar.bz2
+# Source3-md5:	cff4a3ece56aafccadbc693d1f51e89e
+Source4:	https://hg.openjdk.java.net/jdk8u/jdk8u/jaxws/archive/jdk8u%{ver_u}-ga.tar.bz2?/%{name}-jaxws-%{version}.tar.bz2
+# Source4-md5:	a3fa16f2308cc45db53baa49ef36750d
+Source5:	https://hg.openjdk.java.net/jdk8u/jdk8u/jdk/archive/jdk8u%{ver_u}-ga.tar.bz2?/%{name}-jdk-%{version}.tar.bz2
+# Source5-md5:	2d004bb1211f486d88c31fa36ff6f9ee
+Source6:	https://hg.openjdk.java.net/jdk8u/jdk8u/langtools/archive/jdk8u%{ver_u}-ga.tar.bz2?/%{name}-langtools-%{version}.tar.bz2
+# Source6-md5:	243cb6b32a6ba0a973d04005355063e7
+Source7:	https://hg.openjdk.java.net/jdk8u/jdk8u/nashorn/archive/jdk8u%{ver_u}-ga.tar.bz2?/%{name}-nashorn-%{version}.tar.bz2
+# Source7-md5:	551965757732e1d64044d9d7e2b95063
+Source8:	https://hg.openjdk.java.net/aarch32-port/jdk8u/hotspot/archive/jdk8u%{ver_u}-ga-aarch32-20210726.tar.bz2?/%{name}-hotspot-aarch32-%{version}.tar.bz2
+# Source8-md5:	81871eb325f93615f507d6a32d43db39
 Source10:	make-cacerts.sh
 Patch0:		adjust-mflags.patch
 Patch1:		format_strings.patch
@@ -57,8 +52,9 @@ Patch5:		system-libpng.patch
 Patch6:		system-lcms.patch
 Patch7:		system-pcsclite.patch
 Patch8:		x32.patch
-Patch9:		protos.patch
-Patch10:	gcc6.patch
+Patch9:		gcc11.patch
+Patch10:	link-with-as-needed.patch
+Patch11:	aarch32.patch
 URL:		http://openjdk.java.net/
 BuildRequires:	/usr/bin/jar
 BuildRequires:	alsa-lib-devel
@@ -67,11 +63,12 @@ BuildRequires:	autoconf
 BuildRequires:	bash
 %{?with_cacerts:BuildRequires:	ca-certificates-update}
 BuildRequires:	cups-devel
+BuildRequires:	elfutils-devel
 BuildRequires:	freetype-devel >= 2.3
 BuildRequires:	gawk
 BuildRequires:	giflib-devel >= 5.1
 BuildRequires:	glibc-misc
-%{?buildrequires_jdk}
+%buildrequires_jdk
 BuildRequires:	lcms2-devel
 BuildRequires:	libjpeg-devel
 BuildRequires:	libpng-devel
@@ -91,12 +88,13 @@ BuildRequires:	xorg-proto-printproto-devel
 BuildRequires:	xorg-proto-xproto-devel
 BuildRequires:	zip
 BuildRequires:	zlib-devel
-Requires:	%{name}-appletviewer = %{version}-%{release}
-Requires:	%{name}-jdk = %{version}-%{release}
+Requires:	%{name}-appletviewer = %{epoch}:%{version}-%{release}
+Requires:	%{name}-jdk = %{epoch}:%{version}-%{release}
 Suggests:	%{name}-jre-X11
 Suggests:	icedtea-web
 Obsoletes:	icedtea6
 Obsoletes:	icedtea7
+Obsoletes:	icedtea8
 Obsoletes:	java-gcj-compat
 Obsoletes:	java-gcj-compat-devel
 Obsoletes:	java-sun
@@ -134,6 +132,18 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %ifarch x32
 %define		jre_arch	x32
 %endif
+%ifarch aarch64
+%define		jre_arch	aarch64
+%endif
+%ifarch %{arm}
+%define		jre_arch	arm
+%endif
+
+%ifarch %{arm}
+%define		jvm_type	client
+%else
+%define		jvm_type	server
+%endif
 
 # to break artificial subpackage dependency loops
 %define		_noautoreq	'libmawt.so' java\\\\(ClassDataVersion\\\\)
@@ -156,15 +166,16 @@ wszystkie komponenty OpenJDK, w tym środowisko programistyczne
 Summary:	OpenJDK - software development kit
 Summary(pl.UTF-8):	OpenJDK - środowisko programistyczne
 Group:		Development/Languages/Java
-Requires:	%{name}-jar = %{version}-%{release}
-Requires:	%{name}-jdk-base = %{version}-%{release}
-Requires:	%{name}-jre = %{version}-%{release}
-Provides:	j2sdk = %{_jdkversion}
-Provides:	jdk = %{_jdkversion}
+Requires:	%{name}-jar = %{epoch}:%{version}-%{release}
+Requires:	%{name}-jdk-base = %{epoch}:%{version}-%{release}
+Requires:	%{name}-jre = %{epoch}:%{version}-%{release}
+Provides:	j2sdk = %{version}
+Provides:	jdk = %{version}
 Obsoletes:	blackdown-java-sdk
 Obsoletes:	ibm-java
 Obsoletes:	icedtea6-jdk
 Obsoletes:	icedtea7-jdk
+Obsoletes:	icedtea8-jdk
 Obsoletes:	java-blackdown
 Obsoletes:	java-gcj-compat-devel
 Obsoletes:	java-sun
@@ -188,8 +199,8 @@ OpenJDK staje się domyślnym JDK w systemie.
 Summary:	OpenJDK - software development kit
 Summary(pl.UTF-8):	Kod OpenJDK - środowisko programistyczne
 Group:		Development/Languages/Java
-Requires:	%{name}-jre-base = %{version}-%{release}
-Requires:	jpackage-utils >= 0:1.7.5-7
+Requires:	%{name}-jre-base = %{epoch}:%{version}-%{release}
+Requires:	jpackage-utils >= 0:1.7.5-8
 Provides:	jdk(%{name})
 
 %description jdk-base
@@ -202,7 +213,7 @@ OpenJDK skompilowane wyłącznie przy użyciu wolnego oprogramowania.
 Summary:	OpenJDK - runtime environment
 Summary(pl.UTF-8):	OpenJDK - środowisko uruchomieniowe
 Group:		Development/Languages/Java
-Requires:	%{name}-jre-base = %{version}-%{release}
+Requires:	%{name}-jre-base = %{epoch}:%{version}-%{release}
 Requires:	nss >= 1:3.13.4
 # Require zoneinfo data provided by java-tzdata subpackage.
 Requires:	java-tzdata
@@ -219,22 +230,23 @@ Provides:	java(jmx) = 1.4
 Provides:	java(jndi) = %{version}
 Provides:	java(jsse) = %{version}
 Provides:	java1.4
-Provides:	jre = %{_jdkversion}
+Provides:	jre = %{version}
 Obsoletes:	icedtea6-jre
 Obsoletes:	icedtea7-jre
-Obsoletes:	java(jaas)
-Obsoletes:	java(jaf)
-Obsoletes:	java(jaxp)
-Obsoletes:	java(jce)
-Obsoletes:	java(jdbc-stdext)
-Obsoletes:	java(jdbc-stdext)
-Obsoletes:	java(jmx)
-Obsoletes:	java(jndi)
-Obsoletes:	java(jsse)
+Obsoletes:	icedtea8-jre
+Obsoletes:	jaas
+Obsoletes:	jaf
 Obsoletes:	java-gcj-compat
+Obsoletes:	java-jaxp
+Obsoletes:	java-jdbc-stdext
 Obsoletes:	java-sun-jre
 Obsoletes:	java5-sun-jre
+Obsoletes:	jce
+Obsoletes:	jdbc-stdext
+Obsoletes:	jmx
+Obsoletes:	jndi
 Obsoletes:	jre
+Obsoletes:	jsse
 Obsoletes:	oracle-java7-jre
 
 %description jre
@@ -252,11 +264,12 @@ sprawiając tym samym, że OpenJDK staje się domyślnym JRE w systemie.
 Summary:	OpenJDK - runtime environment - X11 support
 Summary(pl.UTF-8):	OpenJDK - środowisko uruchomieniowe - obsługa X11
 Group:		Development/Languages/Java
-Requires:	%{name}-jre = %{version}-%{release}
-Requires:	%{name}-jre-base-X11 = %{version}-%{release}
-Provides:	jre-X11 = %{_jdkversion}
+Requires:	%{name}-jre = %{epoch}:%{version}-%{release}
+Requires:	%{name}-jre-base-X11 = %{epoch}:%{version}-%{release}
+Provides:	jre-X11 = %{version}
 Obsoletes:	icedtea6-jre-X11
 Obsoletes:	icedtea7-jre-X11
+Obsoletes:	icedtea8-jre-X11
 Obsoletes:	java-sun-jre-X11
 Obsoletes:	oracle-java7-jre-X11
 
@@ -272,7 +285,7 @@ wolnego oprogramowania.
 Summary:	OpenJDK - runtime environment
 Summary(pl.UTF-8):	OpenJDK - środowisko uruchomieniowe
 Group:		Development/Languages/Java
-Requires:	jpackage-utils >= 0:1.7.5-7
+Requires:	jpackage-utils >= 0:1.7.5-8
 Provides:	jre(%{name})
 
 %description jre-base
@@ -286,8 +299,8 @@ wolnego oprogramowania.
 Summary:	OpenJDK - runtime environment - X11 support
 Summary(pl.UTF-8):	OpenJDK - środowisko uruchomieniowe - obsługa X11
 Group:		Development/Languages/Java
-Requires:	%{name}-jre-base = %{version}-%{release}
-Requires:	%{name}-jre-base-freetype = %{version}-%{release}
+Requires:	%{name}-jre-base = %{epoch}:%{version}-%{release}
+Requires:	%{name}-jre-base-freetype = %{epoch}:%{version}-%{release}
 
 %description jre-base-X11
 X11 support for OpenJDK runtime environment built using free software
@@ -301,7 +314,7 @@ wolnego oprogramowania.
 Summary:	OpenJDK - runtime environment - ALSA support
 Summary(pl.UTF-8):	OpenJDK - środowisko uruchomieniowe - obsługa ALSA
 Group:		Development/Languages/Java
-Requires:	%{name}-jre-base = %{version}-%{release}
+Requires:	%{name}-jre-base = %{epoch}:%{version}-%{release}
 
 %description jre-base-alsa
 ALSA sound support for OpenJDK runtime environment build using free
@@ -315,7 +328,7 @@ zbudowane przy uzyciu wyłącznie wolnego oprogramowania.
 Summary:	OpenJDK - runtime environment - font support
 Summary(pl.UTF-8):	OpenJDK - środowisko uruchomieniowe - obsługa fontów
 Group:		Development/Languages/Java
-Requires:	%{name}-jre-base = %{version}-%{release}
+Requires:	%{name}-jre-base = %{epoch}:%{version}-%{release}
 
 %description jre-base-freetype
 Font handling library for OpenJDK runtime environment built using free
@@ -329,7 +342,7 @@ użyciu wolnego oprogramowania.
 Summary:	OpenJDK - runtime environment - GTK support
 Summary(pl.UTF-8):	OpenJDK - środowisko uruchomieniowe - obsługa GTK
 Group:		Development/Languages/Java
-Requires:	%{name}-jre-base = %{version}-%{release}
+Requires:	%{name}-jre-base = %{epoch}:%{version}-%{release}
 
 %description jre-base-gtk
 GTK support for OpenJDK runtime environment.
@@ -341,11 +354,12 @@ Biblioteki GTK dla OpenJDK.
 Summary:	OpenJDK - JAR tool
 Summary(pl.UTF-8):	OpenJDK - narzędzie JAR
 Group:		Development/Languages/Java
-Requires:	%{name}-jdk-base = %{version}-%{release}
+Requires:	%{name}-jdk-base = %{epoch}:%{version}-%{release}
 Provides:	jar
 Obsoletes:	fastjar
 Obsoletes:	icedtea6-jar
 Obsoletes:	icedtea7-jar
+Obsoletes:	icedtea8-jar
 Obsoletes:	jar
 
 %description jar
@@ -365,10 +379,11 @@ archiwów.
 Summary:	OpenJDK - appletviewer tool
 Summary(pl.UTF-8):	OpenJDK - narzędzie appletviewer
 Group:		Development/Languages/Java
-Requires:	%{name}-jdk-base = %{version}-%{release}
-Requires:	%{name}-jre-X11 = %{version}-%{release}
+Requires:	%{name}-jdk-base = %{epoch}:%{version}-%{release}
+Requires:	%{name}-jre-X11 = %{epoch}:%{version}-%{release}
 Obsoletes:	icedtea6-appletviewer
 Obsoletes:	icedtea7-appletviewer
+Obsoletes:	icedtea8-appletviewer
 Obsoletes:	java-sun-appletviewer
 Obsoletes:	oracle-java7-appletviewer
 
@@ -406,10 +421,15 @@ Code examples for OpenJDK.
 Przykłady dla OpenJDK.
 
 %prep
-%setup -qn jdk8u-jdk8u%{ver_u}-b%{ver_b} -a1 -a2 -a3 -a4 -a5 -a6 -a7
+%setup -qn jdk8u-jdk8u%{ver_u}-ga -a1 -a3 -a4 -a5 -a6 -a7
+%ifarch %{arm}
+tar xf %{SOURCE8}
+%else
+tar xf %{SOURCE2}
+%endif
 
-for d in *-jdk8u*-b* ; do
-	mv "$d" "${d%%-jdk8u*-b*}"
+for d in *-jdk8u%{ver_u}-ga*; do
+	mv "$d" "${d%%-jdk8u%{ver_u}-ga*}"
 done
 
 %patch0 -p1
@@ -423,6 +443,9 @@ done
 %patch8 -p1
 %patch9 -p1
 %patch10 -p1
+%ifarch %{arm}
+%patch11 -p1
+%endif
 
 %build
 # Make sure we have /proc mounted - otherwise idlc will fail later.
@@ -431,20 +454,17 @@ if [ ! -f /proc/self/stat ]; then
 	exit 1
 fi
 
+unset JAVA_HOME
+unset CLASSPATH
+
+mkdir -p build-bin
+export PATH="$(pwd)/build-bin:$PATH"
+
 cd common/autoconf
 rm generated-configure.sh
 %{__autoconf} -o generated-configure.sh
 cd ../..
 
-mkdir -p build-bin
-
-# use the specified %%use_jdk
-export JAVA_HOME=%{java_home}
-export PATH="$JAVA_HOME/bin:$PATH"
-
-# unset CLASSPATH to be safe, gnustep puts garbage there, which openjdk hates
-unset CLASSPATH
-
 export SHELL=/bin/bash
 
 chmod a+x configure
@@ -454,16 +474,25 @@ chmod a+x configure
 %ifarch x32
 	--with-jvm-variants=zero \
 %endif
-	--with-extra-cflags="%{rpmcflags} -Wno-error=deprecated-declarations" \
-	--with-extra-cxxflags="%{rpmcxxflags} -Wno-error=deprecated-declarations" \
+	--with-boot-jdk="%{java_home}" \
+	--with-extra-cflags="%{rpmcppflags} %{rpmcflags}" \
+	--with-extra-cxxflags="%{rpmcppflags} %{rpmcxxflags}" \
 	--with-extra-ldflags="%{rpmldflags}" \
-	--disable-debug-symbols \
+	--with-native-debug-symbols=none \
+	--with-jobs="%{__jobs}" \
 	--with-giflib=system \
 	--with-libjpeg=system \
 	--with-libpng=system \
 	--with-lcms=system \
 	--with-libpcsclite=system \
-	--with-zlib=system
+	--with-zlib=system \
+	--with-update-version="%{ver_u}" \
+	--with-build-number="%{release}" \
+	--with-milestone="ga" \
+	--with-vendor-name="PLD-Linux" \
+	--with-vendor-url="https://www.pld-linux.org" \
+	--with-vendor-bug-url="https://bugs.pld-linux.org" \
+	--with-vendor-vm-bug-url="https://bugs.openjdk.java.net"
 
 specdir="$(dirname build/*-release/spec.gmk)"
 cat > $specdir/custom-spec.gmk <<EOF
@@ -472,8 +501,8 @@ SHELL=/bin/bash
 EOF
 [ -L tmp-bin ] || ln -s "$specdir/jdk/bin" tmp-bin
 
-%{__make} all \
-	-j1 JOBS=%{__jobs} \
+%{__make} -j1 all \
+	SCTP_WERROR= \
 	LOG=debug \
 	# these are normally set when --disable-debug-symbols is not used \
 	LIBMANAGEMENT_OPTIMIZATION=LOW \
@@ -483,7 +512,6 @@ EOF
 # smoke test
 tmp-bin/java -version
 
-export PATH="$(pwd)/build-bin:$PATH"
 %{?with_cacerts:%{__sh} %{SOURCE10}}
 
 %install
@@ -495,9 +523,11 @@ install -d $RPM_BUILD_ROOT{%{_bindir},%{dstdir},%{_mandir}/ja} \
 # install the 'JDK image', it contains the JRE too
 cp -a build/*-release/images/j2sdk-image/* $RPM_BUILD_ROOT%{dstdir}
 
+find $RPM_BUILD_ROOT%{dstdir} -name '*.diz' -delete
+
 # convenience symlinks without version number
 ln -s %{dstreldir} $RPM_BUILD_ROOT%{_jvmdir}/%{name}
-ln -s %{jrereldir} $RPM_BUILD_ROOT%{_jvmdir}/%{name}-jre
+ln -s %{dstreldir} $RPM_BUILD_ROOT%{_jvmdir}/%{name}-jre
 
 ln -s %{dstreldir} $RPM_BUILD_ROOT%{_jvmdir}/java
 
@@ -516,38 +546,17 @@ rmdir $RPM_BUILD_ROOT%{dstdir}/man
 # replace duplicates with symlinks, link to %{_bindir}
 for path in $RPM_BUILD_ROOT%{dstdir}/bin/*; do
 	filename=$(basename $path)
-	if diff -q "$path" "$RPM_BUILD_ROOT%{jredir}/bin/$filename" > /dev/null; then
-		ln -sf "../jre/bin/$filename" "$path"
-		ln -sf "%{jredir}/bin/$filename" $RPM_BUILD_ROOT%{_bindir}
-	else
-		ln -sf "%{dstdir}/bin/$filename" $RPM_BUILD_ROOT%{_bindir}
-	fi
+        ln -sf "%{dstdir}/bin/$filename" $RPM_BUILD_ROOT%{_bindir}
 done
-ln -sf ../jre/lib/jexec $RPM_BUILD_ROOT%{dstdir}/lib/jexec
 
 # keep configuration in %{_sysconfdir} (not all *.properties go there)
-for config in management security content-types.properties \
+for config in management security \
 		logging.properties net.properties sound.properties; do
 
 	mv $RPM_BUILD_ROOT%{jredir}/lib/$config $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$config
 	ln -s %{_sysconfdir}/%{name}/$config $RPM_BUILD_ROOT%{jredir}/lib/$config
 done
 
-ln -sf %{jredir}/lib/jsse.jar $RPM_BUILD_ROOT%{jvmjardir}/jsse.jar
-ln -sf %{jredir}/lib/jsse.jar $RPM_BUILD_ROOT%{jvmjardir}/jcert.jar
-ln -sf %{jredir}/lib/jsse.jar $RPM_BUILD_ROOT%{jvmjardir}/jnet.jar
-ln -sf %{jredir}/lib/jce.jar $RPM_BUILD_ROOT%{jvmjardir}/jce.jar
-for f in jndi jndi-ldap jndi-cos jndi-rmi jaas jdbc-stdext jdbc-stdext-3.0 \
-	sasl jaxp_parser_impl jaxp_transform_impl jaxp jmx activation xml-commons-apis \
-	jndi-dns jndi-rmi; do
-	ln -sf %{jredir}/lib/rt.jar $RPM_BUILD_ROOT%{jvmjardir}/$f.jar
-done
-
-# some apps (like opera) looks for it in different place
-ln -s server/libjvm.so $RPM_BUILD_ROOT%{jredir}/lib/%{jre_arch}/libjvm.so
-
-%{__rm} $RPM_BUILD_ROOT%{dstdir}/{,jre/}{ASSEMBLY_EXCEPTION,LICENSE,THIRD_PARTY_README}
-
 %{?with_cacerts:install cacerts $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/security}
 
 %clean
@@ -555,7 +564,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc THIRD_PARTY_README ASSEMBLY_EXCEPTION
+%doc README
 
 %files jdk
 %defattr(644,root,root,755)
@@ -573,6 +582,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/jdeps
 %attr(755,root,root) %{_bindir}/jhat
 %attr(755,root,root) %{_bindir}/jinfo
+%attr(755,root,root) %{_bindir}/jjs
 %attr(755,root,root) %{_bindir}/jmap
 %attr(755,root,root) %{_bindir}/jps
 %attr(755,root,root) %{_bindir}/jrunscript
@@ -587,7 +597,6 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/wsgen
 %attr(755,root,root) %{_bindir}/wsimport
 %attr(755,root,root) %{_bindir}/xjc
-%{_jvmdir}/java
 %{_mandir}/man1/extcheck.1*
 %{_mandir}/man1/idlj.1*
 %{_mandir}/man1/jarsigner.1*
@@ -601,6 +610,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/jdeps.1*
 %{_mandir}/man1/jhat.1*
 %{_mandir}/man1/jinfo.1*
+%{_mandir}/man1/jjs.1*
 %{_mandir}/man1/jmap.1*
 %{_mandir}/man1/jps.1*
 %{_mandir}/man1/jrunscript.1*
@@ -628,6 +638,7 @@ rm -rf $RPM_BUILD_ROOT
 %lang(ja) %{_mandir}/ja/man1/jdeps.1*
 %lang(ja) %{_mandir}/ja/man1/jhat.1*
 %lang(ja) %{_mandir}/ja/man1/jinfo.1*
+%lang(ja) %{_mandir}/ja/man1/jjs.1*
 %lang(ja) %{_mandir}/ja/man1/jmap.1*
 %lang(ja) %{_mandir}/ja/man1/jps.1*
 %lang(ja) %{_mandir}/ja/man1/jrunscript.1*
@@ -649,6 +660,7 @@ rm -rf $RPM_BUILD_ROOT
 %doc build/*-release/images/j2sdk-image/ASSEMBLY_EXCEPTION
 %dir %{dstdir}
 %{_jvmdir}/%{name}
+%dir %{dstdir}/bin
 %attr(755,root,root) %{dstdir}/bin/appletviewer
 %attr(755,root,root) %{dstdir}/bin/extcheck
 %attr(755,root,root) %{dstdir}/bin/idlj
@@ -687,18 +699,20 @@ rm -rf $RPM_BUILD_ROOT
 %{dstdir}/lib/jconsole.jar
 %attr(755,root,root) %{dstdir}/lib/jexec
 %{dstdir}/lib/orb.idl
-%ifnarch x32
+%ifnarch %{arm} x32
 %{dstdir}/lib/sa-jdi.jar
 %endif
 %{dstdir}/lib/tools.jar
 %dir %{dstdir}/lib/%{jre_arch}
 %dir %{dstdir}/lib/%{jre_arch}/jli
 %attr(755,root,root) %{dstdir}/lib/%{jre_arch}/jli/*.so
+%{?with_systemtap:%{dstdir}/tapset}
 
 %files jre
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/clhsdb
 %attr(755,root,root) %{_bindir}/java
-%attr(755,root,root) %{_bindir}/jjs
+%{?with_jfr:%attr(755,root,root) %{_bindir}/jfr}
 %attr(755,root,root) %{_bindir}/keytool
 %attr(755,root,root) %{_bindir}/orbd
 %attr(755,root,root) %{_bindir}/pack200
@@ -708,7 +722,6 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/tnameserv
 %attr(755,root,root) %{_bindir}/unpack200
 %{_mandir}/man1/java.1*
-%{_mandir}/man1/jjs.1*
 %{_mandir}/man1/keytool.1*
 %{_mandir}/man1/orbd.1*
 %{_mandir}/man1/pack200.1*
@@ -718,7 +731,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/tnameserv.1*
 %{_mandir}/man1/unpack200.1*
 %lang(ja) %{_mandir}/ja/man1/java.1*
-%lang(ja) %{_mandir}/ja/man1/jjs.1*
 %lang(ja) %{_mandir}/ja/man1/keytool.1*
 %lang(ja) %{_mandir}/ja/man1/orbd.1*
 %lang(ja) %{_mandir}/ja/man1/pack200.1*
@@ -727,11 +739,12 @@ rm -rf $RPM_BUILD_ROOT
 %lang(ja) %{_mandir}/ja/man1/servertool.1*
 %lang(ja) %{_mandir}/ja/man1/tnameserv.1*
 %lang(ja) %{_mandir}/ja/man1/unpack200.1*
+%{_jvmdir}/java
 
 %files jre-base
 %defattr(644,root,root,755)
-%doc THIRD_PARTY_README
-%doc ASSEMBLY_EXCEPTION
+%doc build/*-release/images/j2sdk-image/jre/THIRD_PARTY_README
+%doc build/*-release/images/j2sdk-image/jre/ASSEMBLY_EXCEPTION
 %dir %{_sysconfdir}/%{name}
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*
 %dir %{dstdir}
@@ -740,8 +753,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_jvmdir}/%{name}-jre
 %dir %{jredir}/bin
 %dir %{dstdir}/bin
+%attr(755,root,root) %{dstdir}/bin/clhsdb
 %attr(755,root,root) %{jredir}/bin/java
 %attr(755,root,root) %{dstdir}/bin/java
+%{?with_jfr:%attr(755,root,root) %{dstdir}/bin/jfr}
 %attr(755,root,root) %{jredir}/bin/jjs
 %attr(755,root,root) %{dstdir}/bin/jjs
 %attr(755,root,root) %{jredir}/bin/keytool
@@ -764,12 +779,17 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{jredir}/lib/applet
 %{jredir}/lib/cmm
 %{jredir}/lib/ext
+%if %{with jfr}
+%{jredir}/lib/jfr.jar
+%dir %{jredir}/lib/jfr
+%{jredir}/lib/jfr/*.jfc
+%endif
 %dir %{jredir}/lib/%{jre_arch}
 %dir %{jredir}/lib/%{jre_arch}/jli
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/jli/*.so
-%dir %{jredir}/lib/%{jre_arch}/server
-%{jredir}/lib/%{jre_arch}/server/Xusage.txt
-%attr(755,root,root) %{jredir}/lib/%{jre_arch}/server/*.so
+%dir %{jredir}/lib/%{jre_arch}/%{jvm_type}
+%{jredir}/lib/%{jre_arch}/%{jvm_type}/Xusage.txt
+%attr(755,root,root) %{jredir}/lib/%{jre_arch}/%{jvm_type}/*.so
 %{jredir}/lib/%{jre_arch}/jvm.cfg
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libattach.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libawt.so
@@ -783,7 +803,6 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjaas_unix.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjava.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libsctp.so
-%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libsunec.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjava_crw_demo.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjavajpeg.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjavalcms.so
@@ -791,22 +810,24 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjsdt.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjsig.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjsound.so
-%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjvm.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libmanagement.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libmlib_image.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libnet.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libnio.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libnpt.so
-%ifnarch x32
+%ifnarch %{arm} x32
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libsaproc.so
 %endif
-%{?with_sunec:%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libsunec.so}
+%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libsunec.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libunpack.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libverify.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libzip.so
 %{jredir}/lib/images
 %{jredir}/lib/management
 %{jredir}/lib/security
+%{jredir}/lib/hijrah-config-umalqura.properties
+%{jredir}/lib/tzdb.dat
+
 %if %{with webstart}
 %{jredir}/lib/about.jar
 %{jredir}/lib/about.jnlp
@@ -817,7 +838,6 @@ rm -rf $RPM_BUILD_ROOT
 %{jredir}/lib/content-types.properties
 %{jredir}/lib/currency.data
 %{jredir}/lib/flavormap.properties
-%{jredir}/lib/hijrah-config-umalqura.properties
 %{jredir}/lib/jce.jar
 %attr(755, root, root) %{jredir}/lib/jexec
 %{jredir}/lib/jsse.jar
@@ -831,23 +851,24 @@ rm -rf $RPM_BUILD_ROOT
 %{jredir}/lib/resources.jar
 %{jredir}/lib/rt.jar
 %{jredir}/lib/sound.properties
-%{jredir}/lib/tzdb.dat
 %{jvmjardir}
 
 %files jre-X11
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/hsdb
 %attr(755,root,root) %{_bindir}/policytool
 %{_mandir}/man1/policytool.1*
 %lang(ja) %{_mandir}/ja/man1/policytool.1*
 
 %files jre-base-X11
 %defattr(644,root,root,755)
+%attr(755,root,root) %{dstdir}/bin/hsdb
 %attr(755,root,root) %{jredir}/bin/policytool
 %attr(755,root,root) %{dstdir}/bin/policytool
-%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libsplashscreen.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libawt_xawt.so
 %attr(755,root,root) %{dstdir}/lib/%{jre_arch}/libjawt.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjawt.so
+%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libsplashscreen.so
 
 %files jre-base-alsa
 %defattr(644,root,root,755)
@@ -857,11 +878,8 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libfontmanager.so
 
-%if 0
 %files jre-base-gtk
 %defattr(644,root,root,755)
-%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjavagtk.so
-%endif
 
 %files jar
 %defattr(644,root,root,755)
diff --git a/aarch32.patch b/aarch32.patch
new file mode 100644
index 0000000..4d0b3ec
--- /dev/null
+++ b/aarch32.patch
@@ -0,0 +1,179 @@
+--- a/common/autoconf/jdk-options.m4
++++ b/common/autoconf/jdk-options.m4
+@@ -98,7 +98,11 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS
+ 	[JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark, core) @<:@server@:>@])])
+ 
+   if test "x$with_jvm_variants" = x; then
+-    with_jvm_variants="server"
++    if test "x$OPENJDK_TARGET_CPU" = xaarch32; then
++      with_jvm_variants="client";
++    else
++      with_jvm_variants="server";
++    fi
+   fi
+ 
+   JVM_VARIANTS=",$with_jvm_variants,"
+@@ -161,6 +165,9 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS
+   if test "x$VAR_CPU" = xppc64 -o "x$VAR_CPU" = xppc64le ; then
+     INCLUDE_SA=false
+   fi
++  if test "x$OPENJDK_TARGET_CPU" = xaarch32; then
++    INCLUDE_SA=false
++  fi
+   AC_SUBST(INCLUDE_SA)
+ 
+   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
+--- a/common/autoconf/platform.m4
++++ b/common/autoconf/platform.m4
+@@ -56,8 +56,8 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU
+       VAR_CPU_ENDIAN=little
+       ;;
+     arm*)
+-      VAR_CPU=arm
+-      VAR_CPU_ARCH=arm
++      VAR_CPU=aarch32
++      VAR_CPU_ARCH=aarch32
+       VAR_CPU_BITS=32
+       VAR_CPU_ENDIAN=little
+       ;;
+@@ -346,6 +346,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
+   elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
+     # On all platforms except MacOSX replace x86_64 with amd64.
+     OPENJDK_TARGET_CPU_LEGACY="amd64"
++  elif test "x$OPENJDK_TARGET_CPU" = xaarch32; then
++    OPENJDK_TARGET_CPU_LEGACY="arm"
+   fi
+   AC_SUBST(OPENJDK_TARGET_CPU_LEGACY)
+ 
+@@ -356,6 +358,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
+     OPENJDK_TARGET_CPU_LEGACY_LIB="i386"
+   elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
+     OPENJDK_TARGET_CPU_LEGACY_LIB="amd64"
++  elif test "x$OPENJDK_TARGET_CPU" = xaarch32; then
++    OPENJDK_TARGET_CPU_LEGACY_LIB="arm"
+   fi
+   AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB)
+ 
+@@ -389,6 +393,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
+   elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
+     # On all platforms except macosx, we replace x86_64 with amd64.
+     OPENJDK_TARGET_CPU_OSARCH="amd64"
++  elif test "x$OPENJDK_TARGET_CPU" = xaarch32; then
++    OPENJDK_TARGET_CPU_OSARCH="arm"
+   fi
+   AC_SUBST(OPENJDK_TARGET_CPU_OSARCH)
+ 
+@@ -398,6 +404,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
+   elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
+     # On all platforms except macosx, we replace x86_64 with amd64.
+     OPENJDK_TARGET_CPU_JLI="amd64"
++  elif test "x$OPENJDK_TARGET_CPU" = xaarch32; then
++    OPENJDK_TARGET_CPU_JLI="arm"
+   fi
+   # Now setup the -D flags for building libjli.
+   OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'"
+--- a/hotspot/make/defs.make
++++ b/hotspot/make/defs.make
+@@ -335,6 +335,11 @@ ifneq ($(OSNAME),windows)
+   LIBARCH/ppc64   = ppc64
+   LIBARCH/aarch32 = aarch32
+ 
++  # Override LIBARCH for aarch32
++  ifeq ($(ARCH), aarch32)
++    LIBARCH = arm
++  endif
++
+   LP64_ARCH += sparcv9 amd64 ia64 ppc64 aarch64 zero
+ endif
+ 
+--- a/jdk/make/CopyFiles.gmk
++++ b/jdk/make/CopyFiles.gmk
+@@ -328,9 +328,15 @@ else
+   ifeq ($(CLIENT_AND_SERVER), true)
+     COPY_JVM_CFG_FILE := true
+   else
+-    # For zero, the default jvm.cfg file is sufficient
++    # For zero, the default jvm.cfg file is sufficient.
+     ifeq ($(JVM_VARIANT_ZERO), true)
+       COPY_JVM_CFG_FILE := true
++    else
++      ifeq ($(OPENJDK_TARGET_CPU), aarch32)
++        ifeq ($(JVM_VARIANT_CORE), true)
++          COPY_JVM_CFG_FILE := true
++        endif
++      endif
+     endif
+   endif
+ endif
+--- a/jdk/make/lib/NioLibraries.gmk
++++ b/jdk/make/lib/NioLibraries.gmk
+@@ -174,6 +174,9 @@ ifeq ($(OPENJDK_TARGET_OS_API), posix)
+     ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
+       SCTP_WERROR :=
+     endif
++    ifeq ($(OPENJDK_TARGET_CPU_ARCH), aarch32)
++      SCTP_WERROR :=
++    endif
+ 
+     $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \
+         LIBRARY := sctp, \
+--- a/jdk/make/lib/SoundLibraries.gmk
++++ b/jdk/make/lib/SoundLibraries.gmk
+@@ -147,6 +147,10 @@ else
+   ifeq ($(OPENJDK_TARGET_CPU), aarch64)
+ 	LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH64
+   endif
++
++  ifeq ($(OPENJDK_TARGET_CPU), aarch32)
++    LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH32
++  endif
+ endif
+ 
+ LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
+--- a/jdk/src/share/native/com/sun/media/sound/SoundDefs.h
++++ b/jdk/src/share/native/com/sun/media/sound/SoundDefs.h
+@@ -46,6 +46,7 @@
+ #define X_PPC64         9
+ #define X_PPC64LE      10
+ #define X_AARCH64      11
++#define X_AARCH32      12
+ 
+ // **********************************
+ // Make sure you set X_PLATFORM and X_ARCH defines correctly.
+--- /dev/null
++++ b/jdk/src/solaris/bin/aarch32/jvm.cfg
+@@ -0,0 +1,34 @@
++# Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++#
++# This code is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License version 2 only, as
++# published by the Free Software Foundation.  Oracle designates this
++# particular file as subject to the "Classpath" exception as provided
++# by Oracle in the LICENSE file that accompanied this code.
++#
++# 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.
++#
++# List of JVMs that can be used as an option to java, javac, etc.
++# Order is important -- first in this list is the default JVM.
++# NOTE that this both this file and its format are UNSUPPORTED and
++# WILL GO AWAY in a future release.
++#
++# You may also select a JVM in an arbitrary location with the
++# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
++# and may not be available in a future release.
++#
++-server KNOWN
++-client IGNORE
diff --git a/download.sh b/download.sh
deleted file mode 100755
index da27b2a..0000000
--- a/download.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh -e
-
-tag="$1"
-
-if [ -z "$tag" -a -x /usr/bin/rpm-specdump ] ; then
-	version=$(rpm-specdump openjdk8.spec | awk '/^h PACKAGE_VERSION/ { sub(/.b/, "-b", $3); print $3 }')
-	if [ -n "$version" ] ; then
-		tag="jdk$version"
-		echo "Using spec version: $tag"
-	fi
-fi
-
-
-if [ -z "$tag" -o "${tag#jdk8}" = "${tag}" ] ; then
-	echo "Usage:" >&2
-	echo "   $0 <tag>" >&2
-	echo "e.g:" >&2
-	echo "   $0 jdk8u66-b02" >&2
-	exit 1
-fi
-
-if [ "${tag#jdk8u}" != "${tag}" ] ; then
-	repo="jdk8u"
-else
-	repo="jdk8"
-fi
-
-curl -o "openjdk8-${tag}.tar.bz2" "http://hg.openjdk.java.net/$repo/$repo/archive/${tag}.tar.bz2"
-
-for component in corba hotspot jaxp jaxws jdk langtools nashorn ; do
-	curl -o "openjdk8-${component}-${tag}.tar.bz2" "http://hg.openjdk.java.net/$repo/$repo/${component}/archive/${tag}.tar.bz2"
-done
diff --git a/gcc11.patch b/gcc11.patch
new file mode 100644
index 0000000..2d0820d
--- /dev/null
+++ b/gcc11.patch
@@ -0,0 +1,74 @@
+diff --git a/openjdk/hotspot/src/share/vm/adlc/adlparse.cpp b/openjdk/hotspot/src/share/vm/adlc/adlparse.cpp
+index 31955ff7..6dcd90ac 100644
+--- openjdk/hotspot/src/share/vm/adlc/adlparse.cpp
++++ openjdk/hotspot/src/share/vm/adlc/adlparse.cpp
+@@ -4564,7 +4564,7 @@ char *ADLParser::get_paren_expr(const char *description, bool include_location)
+ // string(still inside the file buffer).  Returns a pointer to the string or
+ // NULL if some other token is found instead.
+ char *ADLParser::get_ident_common(bool do_preproc) {
+-  register char c;
++  char c;
+   char *start;                    // Pointer to start of token
+   char *end;                      // Pointer to end of token
+ 
+@@ -4762,7 +4762,7 @@ char *ADLParser::get_unique_ident(FormDict& dict, const char* nameDescription){
+ // invokes a parse_err if the next token is not an integer.
+ // This routine does not leave the integer null-terminated.
+ int ADLParser::get_int(void) {
+-  register char c;
++  char c;
+   char         *start;            // Pointer to start of token
+   char         *end;              // Pointer to end of token
+   int           result;           // Storage for integer result
+diff --git a/openjdk/hotspot/src/share/vm/adlc/arena.cpp b/openjdk/hotspot/src/share/vm/adlc/arena.cpp
+index d7e4fc6e..406187ae 100644
+--- openjdk/hotspot/src/share/vm/adlc/arena.cpp
++++ openjdk/hotspot/src/share/vm/adlc/arena.cpp
+@@ -79,7 +79,7 @@ Arena::Arena( Arena *a )
+ // Total of all Chunks in arena
+ size_t Arena::used() const {
+   size_t sum = _chunk->_len - (_max-_hwm); // Size leftover in this Chunk
+-  register Chunk *k = _first;
++  Chunk *k = _first;
+   while( k != _chunk) {         // Whilst have Chunks in a row
+     sum += k->_len;             // Total size of this Chunk
+     k = k->_next;               // Bump along to next Chunk
+@@ -93,7 +93,7 @@ void* Arena::grow( size_t x ) {
+   // Get minimal required size.  Either real big, or even bigger for giant objs
+   size_t len = max(x, Chunk::size);
+ 
+-  register Chunk *k = _chunk;   // Get filled-up chunk address
++  Chunk *k = _chunk;   // Get filled-up chunk address
+   _chunk = new (len) Chunk(len);
+ 
+   if( k ) k->_next = _chunk;    // Append new chunk to end of linked list
+diff --git a/openjdk/hotspot/src/share/vm/adlc/dict2.cpp b/openjdk/hotspot/src/share/vm/adlc/dict2.cpp
+index f341a2b6..2dc60b25 100644
+--- openjdk/hotspot/src/share/vm/adlc/dict2.cpp
++++ openjdk/hotspot/src/share/vm/adlc/dict2.cpp
+@@ -283,9 +283,9 @@ void Dict::print(PrintKeyOrValue print_key, PrintKeyOrValue print_value) {
+ // limited to MAXID characters in length.  Experimental evidence on 150K of
+ // C text shows excellent spreading of values for any size hash table.
+ int hashstr(const void *t) {
+-  register char c, k = 0;
+-  register int sum = 0;
+-  register const char *s = (const char *)t;
++  char c, k = 0;
++  int sum = 0;
++  const char *s = (const char *)t;
+ 
+   while (((c = s[k]) != '\0') && (k < MAXID-1)) { // Get characters till nul
+     c = (char) ((c << 1) + 1);    // Characters are always odd!
+diff --git a/openjdk/hotspot/src/share/vm/adlc/main.cpp b/openjdk/hotspot/src/share/vm/adlc/main.cpp
+index 52044f12..40bcda74 100644
+--- openjdk/hotspot/src/share/vm/adlc/main.cpp
++++ openjdk/hotspot/src/share/vm/adlc/main.cpp
+@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
+ 
+   // Read command line arguments and file names
+   for( int i = 1; i < argc; i++ ) { // For all arguments
+-    register char *s = argv[i]; // Get option/filename
++    char *s = argv[i]; // Get option/filename
+ 
+     if( *s++ == '-' ) {         // It's a flag? (not a filename)
+       if( !*s ) {               // Stand-alone `-' means stdin
diff --git a/gcc6.patch b/gcc6.patch
deleted file mode 100644
index ec832a5..0000000
--- a/gcc6.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-diff -r 86030362b0c5 common/autoconf/hotspot-spec.gmk.in
---- openjdk/common/autoconf/hotspot-spec.gmk.in	Mon Feb 29 06:45:20 2016 +0000
-+++ openjdk/common/autoconf/hotspot-spec.gmk.in	Fri Mar 11 18:01:42 2016 +0000
-@@ -109,7 +109,7 @@
- MT:=@HOTSPOT_MT@
- RC:=@HOTSPOT_RC@
- 
--EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@
-+EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(NO_NULL_POINTER_CHECK_FLAG) $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
- EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@
- EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@
- 
-diff -r 86030362b0c5 common/autoconf/spec.gmk.in
---- openjdk/common/autoconf/spec.gmk.in	Mon Feb 29 06:45:20 2016 +0000
-+++ openjdk/common/autoconf/spec.gmk.in	Fri Mar 11 18:01:42 2016 +0000
-@@ -320,6 +320,10 @@
- C_FLAG_DEPS:=@C_FLAG_DEPS@
- CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
- 
-+NO_NULL_POINTER_CHECK_FLAG=@NO_NULL_POINTER_CHECK_CFLAG@
-+NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@
-+CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@
-+
- # Tools that potentially need to be cross compilation aware.
- CC:=@FIXPATH@ @CCACHE@ @CC@
- 
-diff -r 86030362b0c5 common/autoconf/toolchain.m4
---- openjdk/common/autoconf/toolchain.m4	Mon Feb 29 06:45:20 2016 +0000
-+++ openjdk/common/autoconf/toolchain.m4	Fri Mar 11 18:01:42 2016 +0000
-@@ -784,6 +784,10 @@
-             CFLAGS_DEBUG_SYMBOLS="-g1"
-             CXXFLAGS_DEBUG_SYMBOLS="-g1"
-           fi
-+	  CXXSTD_CXXFLAG="-std=gnu++98"
-+	  TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS([$CXXSTD_CXXFLAG -Werror], [], [CXXSTD_CXXFLAG=""])
-+	  CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}"
-+	  AC_SUBST([CXXSTD_CXXFLAG])
-           ;;
-         ossc )
-           #
-@@ -973,6 +977,16 @@
-           CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
-           ;;
-       esac
-+      # These flags are required for GCC 6 builds but may not be available on earlier versions
-+      NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks"
-+      TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$NO_NULL_POINTER_CHECK_CFLAG -Werror], [],
-+    					 [NO_NULL_POINTER_CHECK_CFLAG=""])
-+      AC_SUBST([NO_NULL_POINTER_CHECK_CFLAG])
-+      NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
-+      TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$NO_LIFETIME_DSE_CFLAG -Werror], [],
-+    					 [NO_LIFETIME_DSE_CFLAG=""])
-+      CFLAGS_JDK="${CFLAGS_JDK} ${NO_NULL_POINTER_CHECK_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
-+      AC_SUBST([NO_LIFETIME_DSE_CFLAG])
-       ;;
-     ossc )
-       CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
-@@ -1200,9 +1214,9 @@
- #                                   [RUN-IF-FALSE])
- # ------------------------------------------------------------
- # Check that the c and c++ compilers support an argument
--AC_DEFUN([TOOLCHAIN_COMPILER_CHECK_ARGUMENTS],
-+AC_DEFUN([TOOLCHAIN_C_COMPILER_CHECK_ARGUMENTS],
- [
--  AC_MSG_CHECKING([if compiler supports "$1"])
-+  AC_MSG_CHECKING([if the C compiler supports "$1"])
-   supports=yes
- 
-   saved_cflags="$CFLAGS"
-@@ -1213,6 +1227,19 @@
-   AC_LANG_POP([C])
-   CFLAGS="$saved_cflags"
- 
-+  AC_MSG_RESULT([$supports])
-+  if test "x$supports" = "xyes" ; then
-+    m4_ifval([$2], [$2], [:])
-+  else
-+    m4_ifval([$3], [$3], [:])
-+  fi
-+])
-+
-+AC_DEFUN([TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS],
-+[
-+  AC_MSG_CHECKING([if the C++ compiler supports "$1"])
-+  supports=yes
-+
-   saved_cxxflags="$CXXFLAGS"
-   CXXFLAGS="$CXXFLAG $1"
-   AC_LANG_PUSH([C++])
-@@ -1220,7 +1247,28 @@
-       [supports=no])
-   AC_LANG_POP([C++])
-   CXXFLAGS="$saved_cxxflags"
-+  
-+  AC_MSG_RESULT([$supports])
-+  if test "x$supports" = "xyes" ; then
-+    m4_ifval([$2], [$2], [:])
-+  else
-+    m4_ifval([$3], [$3], [:])
-+  fi
-+])
- 
-+# TOOLCHAIN_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
-+#                                   IF_FALSE: [RUN-IF-FALSE])
-+# ------------------------------------------------------------
-+# Check that the c and c++ compilers support an argument
-+AC_DEFUN([TOOLCHAIN_COMPILER_CHECK_ARGUMENTS],
-+[
-+  TOOLCHAIN_C_COMPILER_CHECK_ARGUMENTS([$1], [C_COMP_SUPPORTS="yes"], [C_COMP_SUPPORTS="no"])
-+  TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS([$1], [CXX_COMP_SUPPORTS="yes"], [CXX_COMP_SUPPORTS="no"])
-+
-+  AC_MSG_CHECKING([if both compilers support "$1"])
-+  supports=no
-+  if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
-+  
-   AC_MSG_RESULT([$supports])
-   if test "x$supports" = "xyes" ; then
-     m4_ifval([$2], [$2], [:])
diff --git a/link-with-as-needed.patch b/link-with-as-needed.patch
new file mode 100644
index 0000000..fe78c8a
--- /dev/null
+++ b/link-with-as-needed.patch
@@ -0,0 +1,40 @@
+# DP: Fix build failures with -Wl,--as-needed, don't explicitly link with -lc
+
+--- a/jdk/make/CompileLaunchers.gmk
++++ b/jdk/make/CompileLaunchers.gmk
+@@ -464,7 +464,7 @@ endif
+ # binary (at least on linux) which causes the size to differ between old and new build.
+ ifeq ($(USE_EXTERNAL_LIBZ), true)
+   UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
+-  UNPACKEXE_ZIPOBJS := -lz
++  UNPACKEXE_LIBS := -lz
+ else
+   UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib
+   UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
+@@ -524,9 +524,9 @@ $(eval $(call SetupNativeCompilation,BUI
+     LDFLAGS_posix := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
+         $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
+         $(call SET_SHARED_LIBRARY_ORIGIN), \
+-    LDFLAGS_linux := -lc, \
++    LDFLAGS_linux := , \
+     LDFLAGS_solaris := $(UNPACKEXE_LDFLAGS_solaris) -lc, \
+-    LDFLAGS_SUFFIX := $(LIBCXX), \
++    LDFLAGS_SUFFIX := $(UNPACKEXE_LIBS) $(LIBCXX), \
+     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR), \
+     OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR), \
+     PROGRAM := unpack200, \
+--- a/jdk/make/lib/Awt2dLibraries.gmk
++++ b/jdk/make/lib/Awt2dLibraries.gmk
+@@ -759,10 +759,10 @@ $(eval $(call SetupNativeCompilation,BUI
+         $(BUILD_LIBJAVAJPEG_CLOSED_INCLUDES) \
+         $(BUILD_LIBJAVAJPEG_HEADERS), \
+     MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
+-    LDFLAGS := $(LDFLAGS_JDKLIB) $(LIBJPEG_LIBS) \
++    LDFLAGS := $(LDFLAGS_JDKLIB) \
+         $(call SET_SHARED_LIBRARY_ORIGIN), \
+     LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
+-    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
++    LDFLAGS_SUFFIX := $(LIBJPEG_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
+     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
+     RC_FLAGS := $(RC_FLAGS) \
+         -D "JDK_FNAME=javajpeg.dll" \
diff --git a/protos.patch b/protos.patch
deleted file mode 100644
index 251a48a..0000000
--- a/protos.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- jdk8u-jdk8u92-b31/jdk/src/share/native/sun/misc/URLClassPath.c.orig	2016-07-29 15:33:17.499988085 +0200
-+++ jdk8u-jdk8u92-b31/jdk/src/share/native/sun/misc/URLClassPath.c	2016-07-29 15:35:59.085075633 +0200
-@@ -24,6 +24,7 @@
-  */
- 
- #include <string.h>
-+#include <stdlib.h>
- 
- #include "jni.h"
- #include "jni_util.h"
-@@ -36,6 +37,12 @@
- extern char*
- getUTF(JNIEnv *env, jstring str, char* localBuf, int bufSize);
- 
-+extern JNIEXPORT jboolean
-+VerifyClassname(char *name, jboolean allowArrayClass);
-+
-+extern JNIEXPORT jboolean
-+VerifyFixClassname(char *name);
-+
- 
- JNIEXPORT jboolean JNICALL
- Java_sun_misc_URLClassPath_knownToNotExist0(JNIEnv *env, jclass cls, jobject loader,
-
diff --git a/system-lcms.patch b/system-lcms.patch
index 67a1baa..e7cc998 100644
--- a/system-lcms.patch
+++ b/system-lcms.patch
@@ -1,7 +1,8 @@
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u-jdk8u66-b02/common/autoconf/libraries.m4
---- jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4	2015-09-18 13:16:52.000000000 +0200
-+++ jdk8u-jdk8u66-b02/common/autoconf/libraries.m4	2015-09-18 13:18:24.000000000 +0200
-@@ -666,6 +666,46 @@
+# DP: taken from http://icedtea.classpath.org/wiki/IcedTea_Patches_for_OpenJDK_8
+
+--- a/common/autoconf/libraries.m4
++++ b/common/autoconf/libraries.m4
+@@ -845,6 +845,46 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
  
    ###############################################################################
    #
@@ -48,11 +49,10 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u
    # Check for the png library
    #
  
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk
---- jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk	2015-09-18 13:16:52.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk	2015-09-18 13:18:24.000000000 +0200
-@@ -667,8 +667,8 @@
- ##########################################################################################
+--- a/jdk/make/lib/Awt2dLibraries.gmk
++++ b/jdk/make/lib/Awt2dLibraries.gmk
+@@ -666,8 +666,8 @@ ifeq ($(TOOLCHAIN_TYPE), clang)
+ endif
  
  # TODO: Update awt lib path when awt is converted
 -$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
@@ -62,7 +62,7 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
      LANG := C, \
-@@ -686,19 +686,19 @@
+@@ -686,19 +686,19 @@ $(eval $(call SetupNativeCompilation,BUI
      LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
      LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
      LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
@@ -88,10 +88,9 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
  
  ##########################################################################################
  
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java jdk8u-jdk8u66-b02/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java
---- jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java	2015-09-18 13:18:24.000000000 +0200
-@@ -207,7 +207,7 @@
+--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java
++++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java
+@@ -207,7 +207,7 @@ public class LCMS implements PCMM {
                           * disposer frameworks
                           */
                          System.loadLibrary("awt");
diff --git a/system-libjpeg.patch b/system-libjpeg.patch
index 37294ca..9d51870 100644
--- a/system-libjpeg.patch
+++ b/system-libjpeg.patch
@@ -1,149 +1,10 @@
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/generated-configure.sh jdk8u-jdk8u66-b02/common/autoconf/generated-configure.sh
---- jdk8u-jdk8u66-b02.orig/common/autoconf/generated-configure.sh	2015-07-17 09:35:23.000000000 +0200
-+++ jdk8u-jdk8u66-b02/common/autoconf/generated-configure.sh	2015-09-18 13:13:58.000000000 +0200
-@@ -1065,6 +1065,7 @@
- with_alsa
- with_alsa_include
- with_alsa_lib
-+with_libjpeg
- with_giflib
- with_zlib
- with_stdc__lib
-@@ -1838,6 +1839,8 @@
-                           headers under PATH/include)
-   --with-alsa-include     specify directory for the alsa include files
-   --with-alsa-lib         specify directory for the alsa library
-+  --with-libjpeg          use libjpeg from build system or OpenJDK source
-+                          (system, bundled) [bundled]
-   --with-giflib           use giflib from build system or OpenJDK source
-                           (system, bundled) [bundled]
-   --with-zlib             use zlib from build system or OpenJDK source
-@@ -8092,6 +8095,11 @@
-     HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
-   fi
- 
-+  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
-+    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-+      as_fn_error $? "You cannot build a client JVM for a 64-bit machine." "$LINENO" 5
-+    fi
-+  fi
-   if test "x$JVM_VARIANT_KERNEL" = xtrue; then
-     HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
-   fi
-@@ -34837,10 +34845,43 @@
-   # Check for the jpeg library
-   #
- 
--  USE_EXTERNAL_LIBJPEG=true
--  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5
--$as_echo_n "checking for main in -ljpeg... " >&6; }
--if ${ac_cv_lib_jpeg_main+:} false; then :
-+
-+# Check whether --with-libjpeg was given.
-+if test "${with_libjpeg+set}" = set; then :
-+  withval=$with_libjpeg;
-+fi
-+
-+
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which libjpeg to use" >&5
-+$as_echo_n "checking for which libjpeg to use... " >&6; }
-+
-+  # default is bundled
-+  DEFAULT_LIBJPEG=bundled
-+
-+  #
-+  # if user didn't specify, use DEFAULT_LIBJPEG
-+  #
-+  if test "x${with_libjpeg}" = "x"; then
-+    with_libjpeg=${DEFAULT_LIBJPEG}
-+  fi
-+
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libjpeg}" >&5
-+$as_echo "${with_libjpeg}" >&6; }
-+
-+  if test "x${with_libjpeg}" = "xbundled"; then
-+    USE_EXTERNAL_LIBJPEG=false
-+  elif test "x${with_libjpeg}" = "xsystem"; then
-+    ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
-+if test "x$ac_cv_header_jpeglib_h" = xyes; then :
-+
-+else
-+   as_fn_error $? "--with-libjpeg=system specified, but jpeglib.h not found!" "$LINENO" 5
-+fi
-+
-+
-+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5
-+$as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; }
-+if ${ac_cv_lib_jpeg_jpeg_CreateDecompress+:} false; then :
-   $as_echo_n "(cached) " >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
-@@ -34848,27 +34889,33 @@
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
--
-+/* Override any GCC internal prototype to avoid an error.
-+   Use char because int might match the return type of a GCC
-+   builtin and then its argument prototype would still apply.  */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char jpeg_CreateDecompress ();
- int
- main ()
- {
--return main ();
-+return jpeg_CreateDecompress ();
-   ;
-   return 0;
- }
- _ACEOF
- if ac_fn_cxx_try_link "$LINENO"; then :
--  ac_cv_lib_jpeg_main=yes
-+  ac_cv_lib_jpeg_jpeg_CreateDecompress=yes
- else
--  ac_cv_lib_jpeg_main=no
-+  ac_cv_lib_jpeg_jpeg_CreateDecompress=no
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
- LIBS=$ac_check_lib_save_LIBS
- fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5
--$as_echo "$ac_cv_lib_jpeg_main" >&6; }
--if test "x$ac_cv_lib_jpeg_main" = xyes; then :
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5
-+$as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; }
-+if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = xyes; then :
-   cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBJPEG 1
- _ACEOF
-@@ -34876,13 +34923,16 @@
-   LIBS="-ljpeg $LIBS"
- 
- else
--   USE_EXTERNAL_LIBJPEG=false
--      { $as_echo "$as_me:${as_lineno-$LINENO}: Will use jpeg decoder bundled with the OpenJDK source" >&5
--$as_echo "$as_me: Will use jpeg decoder bundled with the OpenJDK source" >&6;}
--
-+   as_fn_error $? "--with-libjpeg=system specified, but no libjpeg found" "$LINENO" 5
- fi
- 
- 
-+    USE_EXTERNAL_LIBJPEG=true
-+  else
-+    as_fn_error $? "Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'" "$LINENO" 5
-+  fi
-+
-+
- 
-   ###############################################################################
-   #
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u-jdk8u66-b02/common/autoconf/libraries.m4
---- jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4	2015-07-17 09:35:23.000000000 +0200
-+++ jdk8u-jdk8u66-b02/common/autoconf/libraries.m4	2015-09-18 13:13:58.000000000 +0200
-@@ -595,11 +595,36 @@
+# DP: S8043805: Allow using a system-installed libjpeg
+# DP:   http://hg.openjdk.java.net/jdk9/client/rev/bfd9a3e1aeb5
+# DP:   http://hg.openjdk.java.net/jdk9/client/jdk/rev/320743f0b4fc
+
+--- a/common/autoconf/libraries.m4
++++ b/common/autoconf/libraries.m4
+@@ -774,11 +774,36 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
    # Check for the jpeg library
    #
  
@@ -185,10 +46,9 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u
    AC_SUBST(USE_EXTERNAL_LIBJPEG)
  
    ###############################################################################
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk
---- jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk	2015-09-18 13:13:58.000000000 +0200
-@@ -702,21 +702,24 @@
+--- a/jdk/make/lib/Awt2dLibraries.gmk
++++ b/jdk/make/lib/Awt2dLibraries.gmk
+@@ -702,21 +702,24 @@ $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
  
  ##########################################################################################
  
@@ -219,7 +79,7 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
  # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
  # or 'vfork'": this warning indicates that some variable is placed to
  # a register by optimized compiler and it's value might be lost on longjmp().
-@@ -728,37 +731,50 @@
+@@ -728,37 +731,50 @@ endif
  #      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
  #          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
  #  ifeq ($(CC_43_OR_NEWER), 1)
@@ -256,14 +116,14 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
 -        $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
 -        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
 -    MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
+-    LDFLAGS := $(LDFLAGS_JDKLIB) \
 +        $(BUILD_LIBJAVAJPEG_CLOSED_INCLUDES) \
 +        $(BUILD_LIBJAVAJPEG_HEADERS), \
 +    MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
-     LDFLAGS := $(LDFLAGS_JDKLIB) \
++    LDFLAGS := $(LDFLAGS_JDKLIB) $(LIBJPEG_LIBS) \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
--    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
-+    LDFLAGS_SUFFIX := $(LIBJPEG_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
+     LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
      RC_FLAGS := $(RC_FLAGS) \
 -        -D "JDK_FNAME=jpeg.dll" \
@@ -284,7 +144,7 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
  
  ##########################################################################################
  
-@@ -1198,6 +1214,13 @@
+@@ -1149,6 +1165,13 @@ ifndef BUILD_HEADLESS_ONLY
      GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
    endif
  
@@ -298,7 +158,7 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
    ifneq ($(OPENJDK_TARGET_OS), macosx)
      LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
    else
-@@ -1258,11 +1281,13 @@
+@@ -1205,11 +1228,13 @@ ifndef BUILD_HEADLESS_ONLY
        EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
        LANG := C, \
        OPTIMIZATION := LOW, \
@@ -314,10 +174,9 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
        LDFLAGS_SUFFIX_solaris := -lc, \
        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
        RC_FLAGS := $(RC_FLAGS) \
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java jdk8u-jdk8u66-b02/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
---- jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	2015-09-18 13:13:58.000000000 +0200
-@@ -89,7 +89,7 @@
+--- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
++++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
+@@ -89,7 +89,7 @@ public class JPEGImageReader extends Ima
          java.security.AccessController.doPrivileged(
              new java.security.PrivilegedAction<Void>() {
                  public Void run() {
@@ -326,10 +185,9 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imag
                      return null;
                  }
              });
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java jdk8u-jdk8u66-b02/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
---- jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	2015-09-18 13:13:58.000000000 +0200
-@@ -177,7 +177,7 @@
+--- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
++++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
+@@ -177,7 +177,7 @@ public class JPEGImageWriter extends Ima
          java.security.AccessController.doPrivileged(
              new java.security.PrivilegedAction<Void>() {
                  public Void run() {
@@ -338,10 +196,9 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imag
                      return null;
                  }
              });
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java jdk8u-jdk8u66-b02/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java
---- jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java	2015-09-18 13:13:58.000000000 +0200
-@@ -56,7 +56,7 @@
+--- a/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java
++++ b/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java
+@@ -56,7 +56,7 @@ public class JPEGImageDecoder extends Im
          java.security.AccessController.doPrivileged(
              new java.security.PrivilegedAction<Void>() {
                  public Void run() {
@@ -350,9 +207,8 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/sun/awt/imag
                      return null;
                  }
              });
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c jdk8u-jdk8u66-b02/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
---- jdk8u-jdk8u66-b02.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2015-09-18 13:13:58.000000000 +0200
+--- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
++++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
 @@ -51,7 +51,7 @@
  
  /* headers from the JPEG library */
diff --git a/system-libpng.patch b/system-libpng.patch
index e8259b4..3704489 100644
--- a/system-libpng.patch
+++ b/system-libpng.patch
@@ -1,7 +1,8 @@
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u-jdk8u66-b02/common/autoconf/libraries.m4
---- jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4	2015-09-18 13:13:58.000000000 +0200
-+++ jdk8u-jdk8u66-b02/common/autoconf/libraries.m4	2015-09-18 13:16:52.000000000 +0200
-@@ -666,6 +666,47 @@
+# DP: taken from http://icedtea.classpath.org/wiki/IcedTea_Patches_for_OpenJDK_8
+
+--- a/common/autoconf/libraries.m4
++++ b/common/autoconf/libraries.m4
+@@ -845,6 +845,47 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
  
    ###############################################################################
    #
@@ -49,10 +50,9 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u
    # Check for the zlib library
    #
  
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in jdk8u-jdk8u66-b02/common/autoconf/spec.gmk.in
---- jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in	2015-07-17 09:35:23.000000000 +0200
-+++ jdk8u-jdk8u66-b02/common/autoconf/spec.gmk.in	2015-09-18 13:16:52.000000000 +0200
-@@ -563,6 +563,7 @@
+--- a/common/autoconf/spec.gmk.in
++++ b/common/autoconf/spec.gmk.in
+@@ -603,6 +603,7 @@ endif
  ENABLE_JFR=@ENABLE_JFR@
  ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
  USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
@@ -60,10 +60,9 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in jdk8u-
  USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
  USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
  LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk
---- jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk	2015-09-18 13:13:58.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk	2015-09-18 13:16:52.000000000 +0200
-@@ -1204,7 +1204,6 @@
+--- a/jdk/make/lib/Awt2dLibraries.gmk
++++ b/jdk/make/lib/Awt2dLibraries.gmk
+@@ -1155,7 +1155,6 @@ endif
  ifndef BUILD_HEADLESS_ONLY
    LIBSPLASHSCREEN_DIRS := \
      $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
@@ -71,7 +70,7 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
      $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
  
    ifeq ($(USE_EXTERNAL_LIBGIF), true)
-@@ -1221,6 +1220,13 @@
+@@ -1172,6 +1171,13 @@ ifndef BUILD_HEADLESS_ONLY
      LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg
    endif
  
@@ -85,7 +84,7 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
    ifneq ($(OPENJDK_TARGET_OS), macosx)
      LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
    else
-@@ -1282,12 +1288,12 @@
+@@ -1229,12 +1235,12 @@ ifndef BUILD_HEADLESS_ONLY
        LANG := C, \
        OPTIMIZATION := LOW, \
        CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
@@ -100,9 +99,8 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jd
        LDFLAGS_SUFFIX_solaris := -lc, \
        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
        RC_FLAGS := $(RC_FLAGS) \
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c jdk8u-jdk8u66-b02/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
---- jdk8u-jdk8u66-b02.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2015-09-18 13:16:52.000000000 +0200
+--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
++++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
 @@ -25,8 +25,7 @@
  
  #include "splashscreen_impl.h"
diff --git a/system-pcsclite.patch b/system-pcsclite.patch
index dd487a5..f2da438 100644
--- a/system-pcsclite.patch
+++ b/system-pcsclite.patch
@@ -1,7 +1,6 @@
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u-jdk8u66-b02/common/autoconf/libraries.m4
---- jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4	2015-09-18 13:18:24.000000000 +0200
-+++ jdk8u-jdk8u66-b02/common/autoconf/libraries.m4	2015-09-18 13:19:49.000000000 +0200
-@@ -747,6 +747,53 @@
+--- a/common/autoconf/libraries.m4
++++ b/common/autoconf/libraries.m4
+@@ -926,6 +926,53 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
  
    ###############################################################################
    #
@@ -55,10 +54,9 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u
    # Check for the zlib library
    #
  
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in jdk8u-jdk8u66-b02/common/autoconf/spec.gmk.in
---- jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in	2015-09-18 13:16:52.000000000 +0200
-+++ jdk8u-jdk8u66-b02/common/autoconf/spec.gmk.in	2015-09-18 13:19:49.000000000 +0200
-@@ -565,6 +565,7 @@
+--- a/common/autoconf/spec.gmk.in
++++ b/common/autoconf/spec.gmk.in
+@@ -605,6 +605,7 @@ ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
  USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
  USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@
  USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
@@ -66,10 +64,9 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in jdk8u-
  USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
  LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
  MSVCR_DLL:=@MSVCR_DLL@
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/SecurityLibraries.gmk jdk8u-jdk8u66-b02/jdk/make/lib/SecurityLibraries.gmk
---- jdk8u-jdk8u66-b02.orig/jdk/make/lib/SecurityLibraries.gmk	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/make/lib/SecurityLibraries.gmk	2015-09-18 13:19:49.000000000 +0200
-@@ -75,11 +75,11 @@
+--- a/jdk/make/lib/SecurityLibraries.gmk
++++ b/jdk/make/lib/SecurityLibraries.gmk
+@@ -75,11 +75,11 @@ $(eval $(call SetupNativeCompilation,BUI
      CFLAGS := $(CFLAGS_JDKLIB) \
          -I$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio \
@@ -83,9 +80,8 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/SecurityLibraries.gmk
      LDFLAGS_SUFFIX_windows := winscard.lib, \
      LDFLAGS_SUFFIX_solaris := -lc, \
      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c jdk8u-jdk8u66-b02/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c
---- jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c	2015-09-18 13:19:49.000000000 +0200
+--- a/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c
++++ b/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c
 @@ -36,6 +36,7 @@
  
  #include "pcsc_md.h"
@@ -94,7 +90,7 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/securit
  void *hModule;
  FPTR_SCardEstablishContext scardEstablishContext;
  FPTR_SCardConnect scardConnect;
-@@ -47,6 +48,7 @@
+@@ -47,6 +48,7 @@ FPTR_SCardListReaders scardListReaders;
  FPTR_SCardBeginTransaction scardBeginTransaction;
  FPTR_SCardEndTransaction scardEndTransaction;
  FPTR_SCardControl scardControl;
@@ -102,7 +98,7 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/securit
  
  /*
   * Throws a Java Exception by name
-@@ -75,7 +77,9 @@
+@@ -75,7 +77,9 @@ void throwIOException(JNIEnv *env, const
      throwByName(env, "java/io/IOException", msg);
  }
  
@@ -112,7 +108,7 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/securit
      void *fAddress = dlsym(hModule, functionName);
      if (fAddress == NULL) {
          char errorMessage[256];
-@@ -85,9 +89,11 @@
+@@ -85,9 +89,11 @@ void *findFunction(JNIEnv *env, void *hM
      }
      return fAddress;
  }
@@ -124,25 +120,24 @@ diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/securit
      const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL);
      if (libName == NULL) {
          throwNullPointerException(env, "PCSC library name is null");
-@@ -141,4 +147,5 @@
+@@ -141,4 +147,5 @@ JNIEXPORT void JNICALL Java_sun_security
  #else
      scardControl          = (FPTR_SCardControl)         findFunction(env, hModule, "SCardControl132");
  #endif // __APPLE__
 +#endif
  }
-diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h jdk8u-jdk8u66-b02/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h
---- jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h	2015-09-18 13:19:49.000000000 +0200
+--- a/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h
++++ b/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h
 @@ -23,6 +23,8 @@
   * questions.
   */
  
 +#ifndef USE_SYSTEM_LIBPCSCLITE
 +
- typedef LONG (*FPTR_SCardEstablishContext)(ULONG dwScope,
-                 const void *pvReserved1,
-                 const void *pvReserved2,
-@@ -110,3 +112,41 @@
+ typedef LONG (*FPTR_SCardEstablishContext)(DWORD dwScope,
+                 LPCVOID pvReserved1,
+                 LPCVOID pvReserved2,
+@@ -111,3 +113,41 @@ extern FPTR_SCardListReaders scardListRe
  extern FPTR_SCardBeginTransaction scardBeginTransaction;
  extern FPTR_SCardEndTransaction scardEndTransaction;
  extern FPTR_SCardControl scardControl;
diff --git a/x32.patch b/x32.patch
index 34fdef3..49a5cb6 100644
--- a/x32.patch
+++ b/x32.patch
@@ -1,7 +1,8 @@
-diff -durN jdk8u-jdk8u66-b02.orig/common/autoconf/platform.m4 jdk8u-jdk8u66-b02/common/autoconf/platform.m4
---- jdk8u-jdk8u66-b02.orig/common/autoconf/platform.m4	2015-07-17 09:35:23.000000000 +0200
-+++ jdk8u-jdk8u66-b02/common/autoconf/platform.m4	2015-09-21 13:18:18.439165925 +0200
-@@ -31,10 +31,20 @@
+# DP: Add support for x32
+
+--- a/common/autoconf/platform.m4
++++ b/common/autoconf/platform.m4
+@@ -31,10 +31,17 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU
    # First argument is the cpu name from the trip/quad
    case "$1" in
      x86_64)
@@ -9,45 +10,38 @@ diff -durN jdk8u-jdk8u66-b02.orig/common/autoconf/platform.m4 jdk8u-jdk8u66-b02/
 -      VAR_CPU_ARCH=x86
 -      VAR_CPU_BITS=64
 -      VAR_CPU_ENDIAN=little
-+      case "$target_os" in
-+        *x32)
-+          VAR_CPU=x32
-+          VAR_CPU_ARCH=x86
-+          VAR_CPU_BITS=32
-+          VAR_CPU_ENDIAN=little
-+          ;;
-+        *)
-+          VAR_CPU=x86_64
-+          VAR_CPU_ARCH=x86
-+          VAR_CPU_BITS=64
-+          VAR_CPU_ENDIAN=little
-+          ;;
-+      esac
++      if test "`dpkg-architecture -qDEB_HOST_ARCH`" = x32 ; then
++        VAR_CPU=x32
++        VAR_CPU_ARCH=x86
++        VAR_CPU_BITS=32
++        VAR_CPU_ENDIAN=little
++      else
++        VAR_CPU=x86_64
++        VAR_CPU_ARCH=x86
++        VAR_CPU_BITS=64
++        VAR_CPU_ENDIAN=little
++      fi
        ;;
      i?86)
        VAR_CPU=x86
-@@ -375,7 +385,16 @@
+@@ -451,7 +458,13 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
      ppc64)   ZERO_ARCHDEF=PPC64 ;;
      s390*)   ZERO_ARCHDEF=S390  ;;
      sparc*)  ZERO_ARCHDEF=SPARC ;;
 -    x86_64*) ZERO_ARCHDEF=AMD64 ;;
 +    x86_64*)
-+      case "$target_os" in
-+        *x32)
-+          ZERO_ARCHDEF=X32
-+          ;;
-+        *)
-+          ZERO_ARCHDEF=AMD64
-+          ;;
-+      esac
++      if test "`dpkg-architecture -qDEB_HOST_ARCH`" = x32 ; then
++        ZERO_ARCHDEF=X32
++      else
++        ZERO_ARCHDEF=AMD64
++      fi
 +      ;;
      x86)     ZERO_ARCHDEF=IA32  ;;
      *)      ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z)
    esac
-diff -durN jdk8u-jdk8u66-b02.orig/hotspot/src/os/linux/vm/os_linux.cpp jdk8u-jdk8u66-b02/hotspot/src/os/linux/vm/os_linux.cpp
---- jdk8u-jdk8u66-b02.orig/hotspot/src/os/linux/vm/os_linux.cpp	2015-09-21 13:05:51.883678088 +0200
-+++ jdk8u-jdk8u66-b02/hotspot/src/os/linux/vm/os_linux.cpp	2015-09-21 13:12:58.665870862 +0200
-@@ -1902,7 +1902,7 @@
+--- a/hotspot/src/os/linux/vm/os_linux.cpp
++++ b/hotspot/src/os/linux/vm/os_linux.cpp
+@@ -1980,7 +1980,7 @@ void * os::dll_load(const char *filename
  
    #if  (defined IA32)
      static  Elf32_Half running_arch_code=EM_386;
@@ -56,10 +50,9 @@ diff -durN jdk8u-jdk8u66-b02.orig/hotspot/src/os/linux/vm/os_linux.cpp jdk8u-jdk
      static  Elf32_Half running_arch_code=EM_X86_64;
    #elif  (defined IA64)
      static  Elf32_Half running_arch_code=EM_IA_64;
-diff -durN jdk8u-jdk8u66-b02.orig/jdk/make/gensrc/GensrcX11Wrappers.gmk jdk8u-jdk8u66-b02/jdk/make/gensrc/GensrcX11Wrappers.gmk
---- jdk8u-jdk8u66-b02.orig/jdk/make/gensrc/GensrcX11Wrappers.gmk	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/make/gensrc/GensrcX11Wrappers.gmk	2015-09-21 13:13:00.339291213 +0200
-@@ -87,9 +87,11 @@
+--- a/jdk/make/gensrc/GensrcX11Wrappers.gmk
++++ b/jdk/make/gensrc/GensrcX11Wrappers.gmk
+@@ -91,9 +91,11 @@ ifneq ($(COMPILE_TYPE), cross)
  	$(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $*
  
    # use -m32/-m64 only if the compiler supports it
@@ -71,49 +64,3 @@ diff -durN jdk8u-jdk8u66-b02.orig/jdk/make/gensrc/GensrcX11Wrappers.gmk jdk8u-jd
  
    # Compile the C code into an executable.
    $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
-diff -durN jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c jdk8u-jdk8u66-b02/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
---- jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	2015-09-21 13:13:00.335957707 +0200
-@@ -35,7 +35,6 @@
- #endif
- #ifdef __linux__
- #include <unistd.h>
--#include <sys/sysctl.h>
- #include <sys/utsname.h>
- #include <netinet/ip.h>
- 
-diff -durN jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c jdk8u-jdk8u66-b02/jdk/src/solaris/native/java/net/PlainSocketImpl.c
---- jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c	2015-07-23 16:17:35.000000000 +0200
-+++ jdk8u-jdk8u66-b02/jdk/src/solaris/native/java/net/PlainSocketImpl.c	2015-09-21 13:13:00.335957707 +0200
-@@ -43,7 +43,6 @@
- #endif
- #ifdef __linux__
- #include <unistd.h>
--#include <sys/sysctl.h>
- #endif
- 
- #include "jvm.h"
- 
---- jdk8u-jdk8u66-b02.orig/common/autoconf/toolchain.m4	2015-07-17 09:35:23.000000000 +0200
-+++ jdk8u-jdk8u66-b02/common/autoconf/toolchain.m4	2015-09-21 16:00:30.328673989 +0200
-@@ -361,6 +361,7 @@
-   # Option used to tell the compiler whether to create 32- or 64-bit executables
-   # Notice that CC contains the full compiler path at this point.
-   case $CC in
-+    *x32-*) COMPILER_TARGET_BITS_FLAG="-mx";;
-     *xlc_r) COMPILER_TARGET_BITS_FLAG="-q";;
-     *)      COMPILER_TARGET_BITS_FLAG="-m";;
-   esac
-
-
---- jdk8u-jdk8u92-b31/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp.orig	2016-07-29 15:08:03.457784497 +0200
-+++ jdk8u-jdk8u92-b31/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp	2016-07-29 15:10:09.380999329 +0200
-@@ -34,7 +34,7 @@
-  * _LP64 can be explicitly set (used on Linux).
-  * Solaris compilers will define __sparcv9 or __x86_64 on 64bit compilations.
-  */
--#if defined(_LP64) || defined(__sparcv9) || defined(__x86_64)
-+#if defined(_LP64) || defined(__sparcv9) || (defined(__x86_64) && !defined(__ILP32__))
-   #define LONG_LONG_FORMAT "%ld"
-   #define LONG_LONG_HEX_FORMAT "%lx"
- #else
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/openjdk8.git/commitdiff/0fa4da98159b34053bcd25e43c379df7a704f25f



More information about the pld-cvs-commit mailing list