aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Frankenberger <simon@fraho.eu>2020-03-25 08:05:09 +0100
committerRasmus Thomsen <oss@cogitri.dev>2020-03-25 12:41:13 +0000
commitd15675a7a0fc230ab4d248c581a64156b82ee123 (patch)
treeab70276a7f9125c9b148a69170a2f259cf737d32
parent5cb479411e9b004b218542f128e5c0aff4705528 (diff)
downloadaports-d15675a7a0fc230ab4d248c581a64156b82ee123.tar.gz
aports-d15675a7a0fc230ab4d248c581a64156b82ee123.tar.bz2
aports-d15675a7a0fc230ab4d248c581a64156b82ee123.tar.xz
community/openjdk9: Cleanup and unify with other openjdk aports
-rw-r--r--community/openjdk9/APKBUILD193
-rw-r--r--community/openjdk9/Alpine_Bug_10126.java13
-rw-r--r--community/openjdk9/TestCryptoLevel.java72
-rw-r--r--community/openjdk9/TestECDSA.java49
-rw-r--r--community/openjdk9/arm.patch29
-rw-r--r--community/openjdk9/fix-bootjdk-check.patch15
-rw-r--r--community/openjdk9/make-4.3.patch17
-rw-r--r--community/openjdk9/x86.patch130
8 files changed, 258 insertions, 260 deletions
diff --git a/community/openjdk9/APKBUILD b/community/openjdk9/APKBUILD
index 924a7e9698..09fdf81fc4 100644
--- a/community/openjdk9/APKBUILD
+++ b/community/openjdk9/APKBUILD
@@ -3,75 +3,75 @@
pkgname=openjdk9
pkgver=9.0.4_p12
_pkgver=${pkgver/_p/+}
-pkgrel=1
+pkgrel=2
pkgdesc="Oracle OpenJDK 9"
url="https://hg.openjdk.java.net/jdk-updates/jdk9u"
-arch="all !x86 !armhf !armv7" # build fails on 32bit arches
-license="GPL-2.0 with Classpath"
+arch="all !x86 !armhf !armv7" # oracle dropped support for 32 bit
+license="GPL-2.0-with-classpath-exception"
makedepends="autoconf
-bash
-gawk
-grep
-make
-openjdk8
-zip
-alsa-lib-dev
-cups-dev
-freetype-dev
-giflib-dev
-lcms2-dev
-elfutils-dev
-libexecinfo-dev
-libffi-dev
-libjpeg-turbo-dev
-libx11-dev
-libxext-dev
-libxrender-dev
-libxt-dev
-libxtst-dev
-linux-headers
-zlib-dev
-"
-depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-dbg $pkgname-jdk" # for the virtual openjdk9 package
+ bash
+ gawk
+ grep
+ make
+ openjdk8
+ zip
+ alsa-lib-dev
+ cups-dev
+ freetype-dev
+ giflib-dev
+ lcms2-dev
+ elfutils-dev
+ libexecinfo-dev
+ libffi-dev
+ libjpeg-turbo-dev
+ libx11-dev
+ libxext-dev
+ libxrender-dev
+ libxt-dev
+ libxtst-dev
+ linux-headers
+ zlib-dev"
+depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-jdk" # for the virtual openjdk9 package
subpackages="$pkgname-jmods:_jmods:noarch
-$pkgname-demos:_demos:noarch
-$pkgname-doc:_doc:noarch
-$pkgname-dbg:_dbg
-$pkgname-jre:_jre
-$pkgname-src:_src
-$pkgname-jre-headless:_jre_headless
-$pkgname-jdk:_jdk
-"
+ $pkgname-demos:_demos:noarch
+ $pkgname-doc:_doc:noarch
+ $pkgname-jre:_jre
+ $pkgname-src:_src
+ $pkgname-jre-headless:_jre_headless
+ $pkgname-jdk:_jdk"
source="jdk-$_pkgver-root.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/archive/jdk-$_pkgver.tar.bz2
-jdk-$_pkgver-corba.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/corba/archive/jdk-$_pkgver.tar.bz2
-jdk-$_pkgver-hotspot.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/hotspot/archive/jdk-$_pkgver.tar.bz2
-jdk-$_pkgver-jaxp.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/jaxp/archive/jdk-$_pkgver.tar.bz2
-jdk-$_pkgver-jaxws.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/jaxws/archive/jdk-$_pkgver.tar.bz2
-jdk-$_pkgver-jdk.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/jdk/archive/jdk-$_pkgver.tar.bz2
-jdk-$_pkgver-langtools.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/langtools/archive/jdk-$_pkgver.tar.bz2
-jdk-$_pkgver-nashorn.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/nashorn/archive/jdk-$_pkgver.tar.bz2
-
-2019-01-05_config.sub::https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;h=3b4c7624b68d2d7f84618e1b5fa2badd43a48325;hb=286a38db91ea2dce1749ab7d1d9ea5ae344a16c1
-build.patch
-aarch64.patch
-arm.patch
-ppc64le.patch
-x86.patch
-
-HelloWorld.java
+ jdk-$_pkgver-corba.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/corba/archive/jdk-$_pkgver.tar.bz2
+ jdk-$_pkgver-hotspot.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/hotspot/archive/jdk-$_pkgver.tar.bz2
+ jdk-$_pkgver-jaxp.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/jaxp/archive/jdk-$_pkgver.tar.bz2
+ jdk-$_pkgver-jaxws.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/jaxws/archive/jdk-$_pkgver.tar.bz2
+ jdk-$_pkgver-jdk.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/jdk/archive/jdk-$_pkgver.tar.bz2
+ jdk-$_pkgver-langtools.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/langtools/archive/jdk-$_pkgver.tar.bz2
+ jdk-$_pkgver-nashorn.tar.bz2::https://hg.openjdk.java.net/jdk-updates/jdk9u/nashorn/archive/jdk-$_pkgver.tar.bz2
+
+ build.patch
+ aarch64.patch
+ ppc64le.patch
+ make-4.3.patch
+ fix-bootjdk-check.patch
+
+ HelloWorld.java
+ TestECDSA.java
+ TestCryptoLevel.java
+ Alpine_Bug_10126.java
"
builddir="$srcdir/jdk9u-jdk-$_pkgver"
_java_home="/usr/lib/jvm/java-9-openjdk"
+
ldpath="$_java_home/lib:$_java_home/lib/jli:$_java_home/lib/server"
sonameprefix="$pkgname:"
# enable running the JTReg tests in check?
# see comment in that function for explanation
-_run_jtreg=0
+_run_jtreg=${_run_jtreg:-0}
if [ $_run_jtreg -ne 0 ]; then
makedepends="$makedepends java-jtreg"
- checkdepends="$checkdepends ttf-freefont xvfb"
+ checkdepends="$checkdepends ttf-freefont xvfb-run"
fi
@@ -94,8 +94,9 @@ unpack() {
prepare() {
default_prepare
- # update the config.sub file to detect alpine
- cp $srcdir/2019-01-05_config.sub common/autoconf/build-aux/autoconf-config.sub
+ # update autoconf files to detect alpine
+ update_config_sub
+ update_config_guess
# remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
@@ -105,8 +106,6 @@ prepare() {
}
build() {
- cd "$builddir"
-
if [ $_run_jtreg -ne 0 ]; then
_with_jtreg="--with-jtreg=/usr/share/java/jtreg"
else
@@ -115,11 +114,12 @@ build() {
# CFLAGS, CXXFLAGS and LDFLAGS are ignored as shown by a warning
# in the output of ./configure unless used like such:
- # --with-extra-cflags="${CFLAGS}"
- # --with-extra-cxxflags="${CXXFLAGS}"
- # --with-extra-ldflags="${LDFLAGS}"
- # See also paragraph "Configure Control Variables from "jdk9-${_hg_tag}/common/doc/building.md
- CFLAGS= CXXFLAGS= LDFLAGS= \
+ # --with-extra-cflags="$CFLAGS"
+ # --with-extra-cxxflags="$CXXFLAGS"
+ # --with-extra-ldflags="$LDFLAGS"
+ # See also paragraph "Configure Control Variables" from "common/doc/building.md"
+ # shellcheck disable=2097 disable=2098
+ CFLAGS='' CXXFLAGS='' LDFLAGS='' \
bash ./configure \
--openjdk-target=$CHOST \
--prefix="$_java_home" \
@@ -137,7 +137,7 @@ build() {
--with-lcms=system \
--with-jobs=${JOBS:-4} \
--with-test-jobs=${JOBS:-4} \
- --with-native-debug-symbols=external \
+ --with-native-debug-symbols=none \
$_with_jtreg \
--disable-warnings-as-errors \
--disable-precompiled-headers \
@@ -145,23 +145,33 @@ build() {
--with-jvm-variants=server \
--with-debug-level=release \
--with-version-pre= \
- --with-version-opt=alpine-r${pkgrel} \
+ --with-version-opt="alpine-r$pkgrel" \
--with-version-build=${_pkgver#*+}
-
- MAKEFLAGS= make jdk-image
+ MAKEFLAGS='' make jdk-image
}
check() {
- cd "$builddir"
+ local _java_bin="./build/*-normal-server-release/images/jdk/bin"
+
+ # 1) compile and run a simple hello world
+ $_java_bin/javac -d . "$srcdir"/HelloWorld.java
+ $_java_bin/java HelloWorld
+
+ # 2) compile and run a testcase for unlimited policy
+ $_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java
+ $_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
- # compile and run a simple hello world
- cp "$srcdir/HelloWorld.java" .
- ./build/*-normal-server-release/images/jdk/bin/javac HelloWorld.java
- ./build/*-normal-server-release/images/jdk/bin/java HelloWorld
+ # 3) compile and run a testcase for ECDSA signatures
+ $_java_bin/javac -d . "$srcdir"/TestECDSA.java
+ $_java_bin/java TestECDSA
+
+ # 4) compile and run testcase for bug 10126
+ $_java_bin/javac -d . "$srcdir"/Alpine_Bug_10126.java
+ $_java_bin/java Alpine_Bug_10126
# run the gtest unittest suites
# they don't take long, DO NOT DISABLE THEM!
- MAKEFLAGS= make test-hotspot-gtest
+ MAKEFLAGS='' make test-hotspot-gtest
# The jtreg tests take very, very long to finish and show some failures (9 - 12 on my machine, varying between runs)
# I think these are not critical and can be safely ignored.
@@ -169,28 +179,20 @@ check() {
# When updating this aport please let them run at least once on your machine to see if the failure count changes.
if [ $_run_jtreg -ne 0 ]; then
_logfile=$( mktemp -p "$builddir" )
- if [ -z "$DISPLAY" ]; then
- Xvfb :99 &
- _xvfb_pid=$!
- DISPLAY=:99
- fi
- MAKEFLAGS= DISPLAY=$DISPLAY make \
+ MAKEFLAGS='' xvfb-run make \
run-test-tier1 \
run-test-tier2 \
run-test-tier3 \
| tee "$_logfile"
msg "---------------------------------------"
msg "The build log can be found at $_logfile"
- if [ -n "$_xvfb_pid" ]; then
- kill $_xvfb_pid
- fi
+ # abort the build so you may take a look at the logfile
false
+ return 1
fi
}
package() {
- cd "$builddir"
-
mkdir -p "$pkgdir/$_java_home"
cp -r build/*-normal-server-release/images/jdk/* "$pkgdir/$_java_home"
}
@@ -225,19 +227,6 @@ _doc() {
mv "$_fromroot/man" "$_toroot"
}
-_dbg() {
- pkgdesc="Oracle OpenJDK 9 (debug)"
- depends="$pkgname-jdk"
- _fromroot="$pkgdir/$_java_home"
- _toroot="$subpkgdir/$_java_home"
-
- mkdir -p "$_toroot/lib/server"
- mkdir -p "$_toroot/lib/jli"
- mv "$_fromroot"/lib/server/*.debuginfo "$_toroot"/lib/server
- mv "$_fromroot"/lib/jli/*.debuginfo "$_toroot"/lib/jli
- mv "$_fromroot"/lib/*.debuginfo "$_toroot"/lib
-}
-
_jre() {
pkgdesc="Oracle OpenJDK 9 (JRE)"
depends="$pkgname-jre-headless"
@@ -257,7 +246,7 @@ _jre() {
_src() {
- pkgdesc="OpenJDK $_majorver Source Bundle"
+ pkgdesc="Oracle OpenJDK 9 (sources)"
depends="$pkgname-jre-headless"
mkdir -p "$subpkgdir/$_java_home"/lib
mv "$pkgdir"/$_java_home/lib/src.zip \
@@ -325,10 +314,12 @@ sha512sums="cef3655ae7db657e6c81aa86587e451e58896bb6ee786495f6d757096334435b6a4d
259228d3f439dde239e38cdebb8c3bbb83804ab141d87a9c236310707de9c58cd78cd80ceb4c17755cc1048071f24462839988112c2698f7ec1453a8810610f2 jdk-9.0.4+12-jdk.tar.bz2
ef3c70be906a4b0dd9c9195c88da045909ee3ef144941fb7b4495ed66b4162f481095cad87626d2bd38e5a62134b440223cd008dd6123b6b43c00e338610a692 jdk-9.0.4+12-langtools.tar.bz2
848c6ece418e250561572ad704baeb565580098cfc5f849d4e1a3b41b916aae3487eb4d8d0b319f3a503d122ec064ed4de0678d06821c9a2bdb09c990e589c97 jdk-9.0.4+12-nashorn.tar.bz2
-74e3d868d766e605921542969dd2f646a8adec1b82181aaeb02b623a524cb9011e44c261d4e13ab24268c79c6bc1d260e62d41a928b1b402b186dc5676272e36 2019-01-05_config.sub
386490c3be4c9aa9dc4b73911bc0b97298ff8b1a50e53bd601f4d2a7b3e469f5b8e70e446b2bbe6876854302a373522b4819fde24c85eafc00f9524268096615 build.patch
3cc00d9b81377fdffb7f5b3f732a35cebd2575825d85df88330740903dd98de30fe75e69229811d52f2ef192c1df0715c2696edf31f64c8d7de4b502a16792e4 aarch64.patch
-fa9fcc0c2f0972435b078669175c44f7d5d3cc29fbecb3e053d196c041ef0ff3feee8ec189a86fce0b35c5fd647ff71963a15e1e6fa50775cc2b6fa35d2ccf0a arm.patch
7244d0dfdb78d2f03ea992ef770ed888e2bd48f49e58438e7f0a763633c9aa8fc27b953d82c023f8f99ff23009a15031c99b2ef5550d277c63db684cd984ce8e ppc64le.patch
-427c525e184e2a74f511aad8192dd411fe7fcc4e7a4dc03a3496fb030cec0177b3b520cbdd1c7700f6761a15ff2e5cce59c93d7079b744954122f684d34ce723 x86.patch
-d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java"
+8460dde4d40d57254f14e995090bc4255ee7662d18c19f127d56a1d12d53ec56731574a784ed5d68e89aef1133da760f30ae0982389cf1512ccab1d5f62c4b75 make-4.3.patch
+a132df211c86aed5af8564cb584b4ee69ce07f3186f5f6ca4b5c1af4355c47f060534d0fd65e9415b0082de2c4912de63a776fff63241b8f3b20951fb45f9f73 fix-bootjdk-check.patch
+d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java
+27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java
+b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java
+cc466f64fcc8762cf6e3c1f5739be6425209b27aa58acff4e7eb126003d61fa18266f0e79e57e9d84224654010185ab45dc0a8043543dea227258458a00a1eb1 Alpine_Bug_10126.java"
diff --git a/community/openjdk9/Alpine_Bug_10126.java b/community/openjdk9/Alpine_Bug_10126.java
new file mode 100644
index 0000000000..a381c9ed70
--- /dev/null
+++ b/community/openjdk9/Alpine_Bug_10126.java
@@ -0,0 +1,13 @@
+public class Alpine_Bug_10126 {
+ public static void main(String[] args) throws Exception {
+ try (java.net.Socket sock = javax.net.ssl.SSLSocketFactory.getDefault().createSocket("gitlab.alpinelinux.org", 443);
+ java.io.InputStream in = sock.getInputStream();
+ java.io.OutputStream out = sock.getOutputStream()) {
+ out.write("GET / HTTP/1.0\n\nHost: gitlab.alpinelinux.org\n\nConnection: close\n\n\n\n".getBytes());
+ out.flush();
+ while (in.read(new byte[1024]) != -1) ;
+ }
+ System.out.println("Secured connection performed successfully");
+ }
+}
+
diff --git a/community/openjdk9/TestCryptoLevel.java b/community/openjdk9/TestCryptoLevel.java
new file mode 100644
index 0000000000..3ed6c8dc15
--- /dev/null
+++ b/community/openjdk9/TestCryptoLevel.java
@@ -0,0 +1,72 @@
+/* TestCryptoLevel -- Ensure unlimited crypto policy is in use.
+ Copyright (C) 2012 Red Hat, Inc.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program 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 Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+
+import java.security.Permission;
+import java.security.PermissionCollection;
+
+public class TestCryptoLevel
+{
+ public static void main(String[] args)
+ throws NoSuchFieldException, ClassNotFoundException,
+ IllegalAccessException, InvocationTargetException
+ {
+ Class<?> cls = null;
+ Method def = null, exempt = null;
+
+ try
+ {
+ cls = Class.forName("javax.crypto.JceSecurity");
+ }
+ catch (ClassNotFoundException ex)
+ {
+ System.err.println("Running a non-Sun JDK.");
+ System.exit(0);
+ }
+ try
+ {
+ def = cls.getDeclaredMethod("getDefaultPolicy");
+ exempt = cls.getDeclaredMethod("getExemptPolicy");
+ }
+ catch (NoSuchMethodException ex)
+ {
+ System.err.println("Running IcedTea with the original crypto patch.");
+ System.exit(0);
+ }
+ def.setAccessible(true);
+ exempt.setAccessible(true);
+ PermissionCollection defPerms = (PermissionCollection) def.invoke(null);
+ PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null);
+ Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission");
+ Field apField = apCls.getDeclaredField("INSTANCE");
+ apField.setAccessible(true);
+ Permission allPerms = (Permission) apField.get(null);
+ if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms)))
+ {
+ System.err.println("Running with the unlimited policy.");
+ System.exit(0);
+ }
+ else
+ {
+ System.err.println("WARNING: Running with a restricted crypto policy.");
+ System.exit(-1);
+ }
+ }
+}
diff --git a/community/openjdk9/TestECDSA.java b/community/openjdk9/TestECDSA.java
new file mode 100644
index 0000000000..abd81d1ced
--- /dev/null
+++ b/community/openjdk9/TestECDSA.java
@@ -0,0 +1,49 @@
+/* TestECDSA -- Ensure ECDSA signatures are working.
+ Copyright (C) 2016 Red Hat, Inc.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program 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 Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+import java.math.BigInteger;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.Signature;
+
+/**
+ * @test
+ */
+public class TestECDSA {
+
+ public static void main(String[] args) throws Exception {
+ KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
+ KeyPair key = keyGen.generateKeyPair();
+
+ byte[] data = "This is a string to sign".getBytes("UTF-8");
+
+ Signature dsa = Signature.getInstance("NONEwithECDSA");
+ dsa.initSign(key.getPrivate());
+ dsa.update(data);
+ byte[] sig = dsa.sign();
+ System.out.println("Signature: " + new BigInteger(1, sig).toString(16));
+
+ Signature dsaCheck = Signature.getInstance("NONEwithECDSA");
+ dsaCheck.initVerify(key.getPublic());
+ dsaCheck.update(data);
+ boolean success = dsaCheck.verify(sig);
+ if (!success) {
+ throw new RuntimeException("Test failed. Signature verification error");
+ }
+ System.out.println("Test passed.");
+ }
+}
diff --git a/community/openjdk9/arm.patch b/community/openjdk9/arm.patch
deleted file mode 100644
index 157168a501..0000000000
--- a/community/openjdk9/arm.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- old/hotspot/src/os_cpu/linux_arm/vm/os_linux_arm.cpp
-+++ new/hotspot/src/os_cpu/linux_arm/vm/os_linux_arm.cpp
-@@ -71,7 +71,6 @@
- # include <pwd.h>
- # include <poll.h>
- # include <ucontext.h>
--# include <fpu_control.h>
- # include <asm/ptrace.h>
-
- #define SPELL_REG_SP "sp"
-@@ -104,6 +103,18 @@
- #define ARM_REGS_IN_CONTEXT 31
-
- #else
-+
-+// Stupid hack as the origin if below doesnt compile with gcc 8.2.0:
-+//
-+// os_linux_arm.cpp:114:5: error: missing binary operator before token "("
-+// #if NGREG == 16
-+// ^~~~~
-+//
-+// The NGREG is 18, so force it to that value.
-+#ifdef NGREG
-+# undef NGREG
-+#endif
-+#define NGREG 18
-
- #if NGREG == 16
- // These definitions are based on the observation that until
diff --git a/community/openjdk9/fix-bootjdk-check.patch b/community/openjdk9/fix-bootjdk-check.patch
new file mode 100644
index 0000000000..596abb28cc
--- /dev/null
+++ b/community/openjdk9/fix-bootjdk-check.patch
@@ -0,0 +1,15 @@
+The alpine builders print out a warning about sched_getaffinity() not working.
+This causes the version check for the boot jdk to fail.
+Patch the command to determine the version number to ignore any errors and warnings.
+
+--- old/common/autoconf/boot-jdk.m4
++++ new/common/autoconf/boot-jdk.m4
+@@ -74,7 +74,7 @@
+ BOOT_JDK_FOUND=no
+ else
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
++ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $GREP version | $HEAD -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ [FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"9([\.+-].*)?\"|(1\.[89]\.)'`]
diff --git a/community/openjdk9/make-4.3.patch b/community/openjdk9/make-4.3.patch
new file mode 100644
index 0000000000..604dd46ad6
--- /dev/null
+++ b/community/openjdk9/make-4.3.patch
@@ -0,0 +1,17 @@
+upstream report: https://bugs.openjdk.java.net/browse/JDK-8237879.
+
+diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
+index 170c3ed..697f9d2 100644
+--- a/make/common/MakeBase.gmk
++++ b/make/common/MakeBase.gmk
+@@ -904,7 +904,9 @@ DependOnVariableHelper = \
+ $(info NewVariable $1: >$(strip $($1))<) \
+ $(info OldVariable $1: >$(strip $($1_old))<)) \
+ $(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \
+- $(call DependOnVariableFileName, $1, $2))) \
++ $(call DependOnVariableFileName, $1, $2)) \
++ $(eval $(call DependOnVariableFileName, $1, $2): ) \
++ ) \
+ $(call DependOnVariableFileName, $1, $2) \
+ )
+
diff --git a/community/openjdk9/x86.patch b/community/openjdk9/x86.patch
deleted file mode 100644
index 2ee42325df..0000000000
--- a/community/openjdk9/x86.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-Only in old: build.patch
---- old/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
-+++ new/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
-@@ -88,6 +88,126 @@
- #define SPELL_REG_FP "ebp"
- #endif // AMD64
-
-+// ==============================================================================
-+// Taken from glibc 2.28
-+// source: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/fpu_control.h;h=4cb98c5679b2897ff4e5826d228cba6be589e24d;hb=3c03baca37fdcb52c3881e653ca392bba7a99c2b
-+// ==============================================================================
-+#ifndef AMD64
-+/* FPU control word bits. x86 version.
-+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Olaf Flebbe.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, see
-+ <http://www.gnu.org/licenses/>. */
-+
-+#ifndef _FPU_CONTROL_H
-+#define _FPU_CONTROL_H 1
-+
-+/* Note that this file sets on x86-64 only the x87 FPU, it does not
-+ touch the SSE unit. */
-+
-+/* Here is the dirty part. Set up your 387 through the control word
-+ * (cw) register.
-+ *
-+ * 15-13 12 11-10 9-8 7-6 5 4 3 2 1 0
-+ * | reserved | IC | RC | PC | reserved | PM | UM | OM | ZM | DM | IM
-+ *
-+ * IM: Invalid operation mask
-+ * DM: Denormalized operand mask
-+ * ZM: Zero-divide mask
-+ * OM: Overflow mask
-+ * UM: Underflow mask
-+ * PM: Precision (inexact result) mask
-+ *
-+ * Mask bit is 1 means no interrupt.
-+ *
-+ * PC: Precision control
-+ * 11 - round to extended precision
-+ * 10 - round to double precision
-+ * 00 - round to single precision
-+ *
-+ * RC: Rounding control
-+ * 00 - rounding to nearest
-+ * 01 - rounding down (toward - infinity)
-+ * 10 - rounding up (toward + infinity)
-+ * 11 - rounding toward zero
-+ *
-+ * IC: Infinity control
-+ * That is for 8087 and 80287 only.
-+ *
-+ * The hardware default is 0x037f which we use.
-+ */
-+
-+#include <features.h>
-+
-+/* masking of interrupts */
-+#define _FPU_MASK_IM 0x01
-+#define _FPU_MASK_DM 0x02
-+#define _FPU_MASK_ZM 0x04
-+#define _FPU_MASK_OM 0x08
-+#define _FPU_MASK_UM 0x10
-+#define _FPU_MASK_PM 0x20
-+
-+/* precision control */
-+#define _FPU_EXTENDED 0x300 /* libm requires double extended precision. */
-+#define _FPU_DOUBLE 0x200
-+#define _FPU_SINGLE 0x0
-+
-+/* rounding control */
-+#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */
-+#define _FPU_RC_DOWN 0x400
-+#define _FPU_RC_UP 0x800
-+#define _FPU_RC_ZERO 0xC00
-+
-+#define _FPU_RESERVED 0xF0C0 /* Reserved bits in cw */
-+
-+
-+/* The fdlibm code requires strict IEEE double precision arithmetic,
-+ and no interrupts for exceptions, rounding to nearest. */
-+
-+#define _FPU_DEFAULT 0x037f
-+
-+/* IEEE: same as above. */
-+#define _FPU_IEEE 0x037f
-+
-+/* Type of the control word. */
-+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
-+
-+/* Macros for accessing the hardware control word. "*&" is used to
-+ work around a bug in older versions of GCC. __volatile__ is used
-+ to support combination of writing the control register and reading
-+ it back. Without __volatile__, the old value may be used for reading
-+ back under compiler optimization.
-+
-+ Note that the use of these macros is not sufficient anymore with
-+ recent hardware nor on x86-64. Some floating point operations are
-+ executed in the SSE/SSE2 engines which have their own control and
-+ status register. */
-+#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
-+#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
-+
-+/* Default control word set at startup. */
-+extern fpu_control_t __fpu_control;
-+
-+#endif /* fpu_control.h */
-+
-+#endif // AMD64
-+// ==============================================================================
-+// ==============================================================================
-+// ==============================================================================
-+
- address os::current_stack_pointer() {
- #ifdef SPARC_WORKS
- register void *esp;