diff options
author | Simon Frankenberger <simon@fraho.eu> | 2020-11-10 19:53:35 +0100 |
---|---|---|
committer | Milan P. Stanić <mps@arvanta.net> | 2020-12-03 11:30:05 +0000 |
commit | 06d351efe4b402e03825ebddcc81b6fd85fb3067 (patch) | |
tree | c2604fc369e2f1f7835637970987ee52dd95d93b | |
parent | e635874f2b5a4ae7a287c66fbbf608b789413bd2 (diff) | |
download | aports-06d351efe4b402e03825ebddcc81b6fd85fb3067.tar.gz aports-06d351efe4b402e03825ebddcc81b6fd85fb3067.tar.bz2 aports-06d351efe4b402e03825ebddcc81b6fd85fb3067.tar.xz |
community/openjdk13: unify patches
-rw-r--r-- | testing/openjdk13/APKBUILD | 16 | ||||
-rw-r--r-- | testing/openjdk13/Alpine_Bug_10126.java | 2 | ||||
-rw-r--r-- | testing/openjdk13/JDK-8245051.patch | 72 | ||||
-rw-r--r-- | testing/openjdk13/aarch64.patch | 13 | ||||
-rw-r--r-- | testing/openjdk13/build.patch | 25 | ||||
-rw-r--r-- | testing/openjdk13/fix-bootjdk-check.patch | 4 | ||||
-rw-r--r-- | testing/openjdk13/gcc10-compilation-fix.patch | 108 | ||||
-rw-r--r-- | testing/openjdk13/ppc64le.patch | 10 |
8 files changed, 227 insertions, 23 deletions
diff --git a/testing/openjdk13/APKBUILD b/testing/openjdk13/APKBUILD index 969b87ad57..c765aec27a 100644 --- a/testing/openjdk13/APKBUILD +++ b/testing/openjdk13/APKBUILD @@ -3,7 +3,7 @@ pkgname=openjdk13 pkgver=13.0.4_p8 _pkgver=${pkgver%_p*}-ga -pkgrel=0 +pkgrel=1 pkgdesc="Oracle OpenJDK 13" url="https://hg.openjdk.java.net/jdk-updates/jdk13u" arch="all !x86 !armhf !armv7 !mips !mips64" # oracle dropped support for 32 bit @@ -47,6 +47,8 @@ source="jdk-$_pkgver.tar.gz::https://github.com/openjdk/jdk13u/archive/jdk-$_pkg aarch64.patch ppc64le.patch fix-bootjdk-check.patch + gcc10-compilation-fix.patch + JDK-8245051.patch HelloWorld.java TestECDSA.java @@ -284,11 +286,13 @@ _jdk() { } sha512sums="d29820da13b45fe64ff20ff277142a3dd73301145b9b7c03b387950928aae99564b7ecb0c1a25d29737de896e06b94f8618c6e141130788a6e87dc23e97a023e jdk-13.0.4-ga.tar.gz -953fea48fa200b4388867134428220b08aad38396cebff2b2a2d270ac49678e5baf08b19edf58b514750b527c06c5958e7394e7d0d4189950c213bea322048e1 build.patch -44e26f252a911acc4fa742c352177dbd59f3a9275b76bb4cc61d430232bd95a7279d116204e39c3ebd9b4fea2ff0ba3ba091d640cdd021baa437d0196818d6bb aarch64.patch -fabbfd3d1a42d885e0631f6a9a93408dc4c3d1d6dd8099d3783192972d1f61776724d7d2d68f425c1d8eb4e942fa5302325fb8240c0a6049e891a29e8e3b2be7 ppc64le.patch -e54c69db6e97c9d7057275f6749565a748f42dadb397b2f3975d99608c4037ad93c84cf828c7e2955b1b4f1899dcc25069c8c6d675f1e963adf3f1223a47d56c fix-bootjdk-check.patch +ba02f4fa18de956b3c0e6ec367ce3ba6bc8fa237d4e3f5b8c0f761a4c2be8208b135faa0d9062f713680e2c2b94d11fb92758c2a51f6eb6721d64b3ced8afafe build.patch +f7fd94b04740e2a3f966577a5c02f7d6db38ef0ab3ef7b3183cd3ba3d8ff7304e3151fba03a4bcbb9f82f380a723d7823794e168ebf9f2fa8d5e7a9dbc895ce9 aarch64.patch +2d41f87175b3727c0e71d4d63ee4574d59097527775c98456a311b14e17950274531d422a965f0d7ad5e1b5bf4286fc250565c35f74aad61960d529a1a409eec ppc64le.patch +a916200ffdd4e4be0233fa020a30f4b0aabb92dc1956ce75e4372afc6fb22cad8333770d5381086e91c1ed4159a9620a37de3e5b175c8f025ec9040ad016fce2 fix-bootjdk-check.patch +bef17d175afcca4259c030b56961780d612c4c310c243ef60a0759a0faa16614a0deac2a80bab68073fab038eafaa436a4bce0e33a1b673fbbe56d9d4eb67aeb gcc10-compilation-fix.patch +0254dae7aef9bd6c4e19ac3c31f0b7bf8f818ead8858b1cd4e29e4572a5b0932de1ba498ba2c60a03dce77da235fdad23e7a4be5bea298bba3951752d313d1b4 JDK-8245051.patch d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java 27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java -fadd06c034614a25537246dfd66a4645c2a4c673f16b5d3e8abdd89c81baf04bd2797b26b0e589ec11ee08b90783b232a6d06c72589d211a5e10b8638a627911 Alpine_Bug_10126.java" +cc466f64fcc8762cf6e3c1f5739be6425209b27aa58acff4e7eb126003d61fa18266f0e79e57e9d84224654010185ab45dc0a8043543dea227258458a00a1eb1 Alpine_Bug_10126.java" diff --git a/testing/openjdk13/Alpine_Bug_10126.java b/testing/openjdk13/Alpine_Bug_10126.java index 76574a1509..a381c9ed70 100644 --- a/testing/openjdk13/Alpine_Bug_10126.java +++ b/testing/openjdk13/Alpine_Bug_10126.java @@ -1,6 +1,6 @@ public class Alpine_Bug_10126 { public static void main(String[] args) throws Exception { - try (java.net.Socket sock = javax.net.ssl.SSLSocketFactory.getDefault().createSocket("bugs.alpinelinux.org", 443); + 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()); diff --git a/testing/openjdk13/JDK-8245051.patch b/testing/openjdk13/JDK-8245051.patch new file mode 100644 index 0000000000..c4d10fb883 --- /dev/null +++ b/testing/openjdk13/JDK-8245051.patch @@ -0,0 +1,72 @@ +From 612c38cdc92a3e169fe83846920407d50263044a Mon Sep 17 00:00:00 2001 +From: Xin Liu <xliu@openjdk.org> +Date: Wed, 20 May 2020 11:29:11 -0700 +Subject: [PATCH] 8245051: c1 is broken if it is compiled by gcc without + -fno-lifetime-dse + +Initialize BlockBegin block id in constructor rather than operator new + +Reviewed-by: kbarrett, thartmann +--- + src/hotspot/share/c1/c1_Instruction.hpp | 7 ++----- + src/hotspot/share/c1/c1_ValueMap.cpp | 1 + + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/src/hotspot/share/c1/c1_Instruction.hpp b/src/hotspot/share/c1/c1_Instruction.hpp +index 09644580f2a..9716d4d00ec 100644 +--- a/src/hotspot/share/c1/c1_Instruction.hpp ++++ b/src/hotspot/share/c1/c1_Instruction.hpp +@@ -303,7 +303,6 @@ class Instruction: public CompilationResourceObj { + XHandlers* _exception_handlers; // Flat list of exception handlers covering this instruction + + friend class UseCountComputer; +- friend class BlockBegin; + + void update_exception_state(ValueStack* state); + +@@ -349,7 +348,6 @@ class Instruction: public CompilationResourceObj { + void* operator new(size_t size) throw() { + Compilation* c = Compilation::current(); + void* res = c->arena()->Amalloc(size); +- ((Instruction*)res)->_id = c->get_next_id(); + return res; + } + +@@ -410,7 +408,7 @@ class Instruction: public CompilationResourceObj { + + // creation + Instruction(ValueType* type, ValueStack* state_before = NULL, bool type_is_constant = false) +- : ++ : _id(Compilation::current()->get_next_id()), + #ifndef PRODUCT + _printable_bci(-99), + #endif +@@ -1649,8 +1647,6 @@ LEAF(BlockBegin, StateSplit) + void* operator new(size_t size) throw() { + Compilation* c = Compilation::current(); + void* res = c->arena()->Amalloc(size); +- ((BlockBegin*)res)->_id = c->get_next_id(); +- ((BlockBegin*)res)->_block_id = c->get_next_block_id(); + return res; + } + +@@ -1662,6 +1658,7 @@ LEAF(BlockBegin, StateSplit) + // creation + BlockBegin(int bci) + : StateSplit(illegalType) ++ , _block_id(Compilation::current()->get_next_block_id()) + , _bci(bci) + , _depth_first_number(-1) + , _linear_scan_number(-1) +diff --git a/src/hotspot/share/c1/c1_ValueMap.cpp b/src/hotspot/share/c1/c1_ValueMap.cpp +index 88ee5fe72b7..016ea3c99c0 100644 +--- a/src/hotspot/share/c1/c1_ValueMap.cpp ++++ b/src/hotspot/share/c1/c1_ValueMap.cpp +@@ -488,6 +488,7 @@ GlobalValueNumbering::GlobalValueNumbering(IR* ir) + : _compilation(ir->compilation()) + , _current_map(NULL) + , _value_maps(ir->linear_scan_order()->length(), ir->linear_scan_order()->length(), NULL) ++ , _has_substitutions(false) + { + TRACE_VALUE_NUMBERING(tty->print_cr("****** start of global value numbering")); + diff --git a/testing/openjdk13/aarch64.patch b/testing/openjdk13/aarch64.patch index e6a8911419..3f088dd9cc 100644 --- a/testing/openjdk13/aarch64.patch +++ b/testing/openjdk13/aarch64.patch @@ -1,12 +1,17 @@ -The header is not present with musl and including is not needed +Subject: Remove fpu_control.h include +Upstream: No +Author: Simon Frankenberger <simon-alpine@fraho.eu> + +The header is not present with musl and including it results in build error. +It's not needed anyways. --- old/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp +++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp -@@ -77,7 +77,6 @@ +@@ -74,7 +74,6 @@ # include <pwd.h> # include <poll.h> # include <ucontext.h> -# include <fpu_control.h> - #ifdef BUILTIN_SIM - #define REG_SP REG_RSP + #define REG_FP 29 + #define REG_LR 30 diff --git a/testing/openjdk13/build.patch b/testing/openjdk13/build.patch index 0f31de9f66..18256a162e 100644 --- a/testing/openjdk13/build.patch +++ b/testing/openjdk13/build.patch @@ -1,5 +1,10 @@ -This patch contains mainly code from the portola project. -Adopted, enhanced and fixed so that it actually compiles with alpine. +Subject: Fix compilation issues with musl libc +Upstream: No +Author: The portola team at https://openjdk.java.net/projects/portola/ + With modifications by Simon Frankenberger <simon-alpine@fraho.eu> + +This giant patch makes it possible to compile openjdk with musl libc. +The base was taken from a diff with the portola project and adjusted for latest musl libc. --- old/make/ReleaseFile.gmk +++ new/make/ReleaseFile.gmk @@ -13,7 +18,7 @@ Adopted, enhanced and fixed so that it actually compiles with alpine. # Param 1 - The file containing the MODULES list --- old/make/hotspot/lib/CompileJvm.gmk +++ new/make/hotspot/lib/CompileJvm.gmk -@@ -71,6 +71,7 @@ +@@ -73,6 +73,7 @@ -DHOTSPOT_BUILD_USER='"$(USERNAME)"' \ -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \ -DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \ @@ -61,7 +66,7 @@ Adopted, enhanced and fixed so that it actually compiles with alpine. } ///////////////////////////////////////////////////////////////////////////// -@@ -3001,20 +3006,36 @@ +@@ -3032,20 +3037,36 @@ extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { } extern "C" JNIEXPORT void numa_error(char *where) { } @@ -118,7 +123,7 @@ Adopted, enhanced and fixed so that it actually compiles with alpine. #define REG_SP REG_RSP --- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp +++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp -@@ -1153,7 +1153,7 @@ +@@ -1150,7 +1150,7 @@ static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) { bool first = true; size_t min_size = 0; // "first" makes this conceptually infinite. @@ -129,7 +134,7 @@ Adopted, enhanced and fixed so that it actually compiles with alpine. assert(*prev_ptr == cur, "just checking"); --- old/src/hotspot/share/runtime/vm_version.cpp +++ new/src/hotspot/share/runtime/vm_version.cpp -@@ -267,7 +267,7 @@ +@@ -277,7 +277,7 @@ #endif #define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \ @@ -198,7 +203,7 @@ Adopted, enhanced and fixed so that it actually compiles with alpine. #include <math.h> --- old/src/java.base/unix/native/libjli/java_md_solinux.c +++ new/src/java.base/unix/native/libjli/java_md_solinux.c -@@ -235,6 +235,39 @@ +@@ -236,6 +236,39 @@ char *dmllp = NULL; char *p; /* a utility pointer */ @@ -261,7 +266,7 @@ Adopted, enhanced and fixed so that it actually compiles with alpine. #include <jvm.h> #include <jni.h> -@@ -790,26 +787,6 @@ +@@ -783,26 +780,6 @@ } return ret; } @@ -342,7 +347,7 @@ Adopted, enhanced and fixed so that it actually compiles with alpine. void *run_java_overflow (void *p) { JNIEnv *env; jclass class_id; -@@ -254,13 +269,19 @@ +@@ -258,13 +273,19 @@ exit(7); } @@ -363,7 +368,7 @@ Adopted, enhanced and fixed so that it actually compiles with alpine. pthread_join (thr, NULL); printf("Testing stack guard page behaviour for initial thread\n"); -@@ -273,7 +294,7 @@ +@@ -277,7 +298,7 @@ printf("\nTesting NATIVE_OVERFLOW\n"); printf("Testing stack guard page behaviour for other thread\n"); diff --git a/testing/openjdk13/fix-bootjdk-check.patch b/testing/openjdk13/fix-bootjdk-check.patch index c9d91f9d2a..9f62757546 100644 --- a/testing/openjdk13/fix-bootjdk-check.patch +++ b/testing/openjdk13/fix-bootjdk-check.patch @@ -1,3 +1,7 @@ +Subject: Fix detection of bootjdk on configure +Upstream: No +Author: Simon Frankenberger <simon-alpine@fraho.eu> + 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. diff --git a/testing/openjdk13/gcc10-compilation-fix.patch b/testing/openjdk13/gcc10-compilation-fix.patch new file mode 100644 index 0000000000..c13d92f581 --- /dev/null +++ b/testing/openjdk13/gcc10-compilation-fix.patch @@ -0,0 +1,108 @@ +Subject: Fix build error with gcc >= 10.0 +Upstream: Yes +Upstream-Url: https://bugs.openjdk.java.net/browse/JDK-8235903 +Author: Simon Frankenberger <simon-alpine@fraho.eu> + +This is a backport of the fixes to make it compile with gcc10 again. + +--- old/src/java.base/unix/native/libjava/childproc.c ++++ new/src/java.base/unix/native/libjava/childproc.c +@@ -33,6 +33,7 @@ + + #include "childproc.h" + ++const char * const *parentPathv; + + ssize_t + restartableWrite(int fd, const void *buf, size_t count) +--- old/src/java.base/unix/native/libjava/childproc.h ++++ new/src/java.base/unix/native/libjava/childproc.h +@@ -118,7 +118,7 @@ + * The cached and split version of the JDK's effective PATH. + * (We don't support putenv("PATH=...") in native code) + */ +-const char * const *parentPathv; ++extern const char * const *parentPathv; + + ssize_t restartableWrite(int fd, const void *buf, size_t count); + int restartableDup2(int fd_from, int fd_to); +--- old/src/java.security.jgss/share/native/libj2gss/NativeFunc.c ++++ new/src/java.security.jgss/share/native/libj2gss/NativeFunc.c +@@ -27,6 +27,9 @@ + #include <stdlib.h> + #include "NativeFunc.h" + ++/* global GSS function table */ ++GSS_FUNCTION_TABLE_PTR ftab; ++ + /* standard GSS method names (ordering is from mapfile) */ + static const char RELEASE_NAME[] = "gss_release_name"; + static const char IMPORT_NAME[] = "gss_import_name"; +--- old/src/java.security.jgss/share/native/libj2gss/NativeFunc.h ++++ new/src/java.security.jgss/share/native/libj2gss/NativeFunc.h +@@ -277,6 +277,6 @@ + typedef GSS_FUNCTION_TABLE *GSS_FUNCTION_TABLE_PTR; + + /* global GSS function table */ +-GSS_FUNCTION_TABLE_PTR ftab; ++extern GSS_FUNCTION_TABLE_PTR ftab; + + #endif +--- /dev/null ++++ new/src/jdk.sctp/unix/native/libsctp/Sctp.c +@@ -0,0 +1,34 @@ ++/* ++ * Copyright (c) 2009, 2019, 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. ++ */ ++ ++#include "Sctp.h" ++ ++sctp_getladdrs_func* nio_sctp_getladdrs; ++sctp_freeladdrs_func* nio_sctp_freeladdrs; ++sctp_getpaddrs_func* nio_sctp_getpaddrs; ++sctp_freepaddrs_func* nio_sctp_freepaddrs; ++sctp_bindx_func* nio_sctp_bindx; ++sctp_peeloff_func* nio_sctp_peeloff; ++ +--- old/src/jdk.sctp/unix/native/libsctp/Sctp.h ++++ new/src/jdk.sctp/unix/native/libsctp/Sctp.h +@@ -322,12 +322,12 @@ + + #endif /* __linux__ */ + +-sctp_getladdrs_func* nio_sctp_getladdrs; +-sctp_freeladdrs_func* nio_sctp_freeladdrs; +-sctp_getpaddrs_func* nio_sctp_getpaddrs; +-sctp_freepaddrs_func* nio_sctp_freepaddrs; +-sctp_bindx_func* nio_sctp_bindx; +-sctp_peeloff_func* nio_sctp_peeloff; ++extern sctp_getladdrs_func* nio_sctp_getladdrs; ++extern sctp_freeladdrs_func* nio_sctp_freeladdrs; ++extern sctp_getpaddrs_func* nio_sctp_getpaddrs; ++extern sctp_freepaddrs_func* nio_sctp_freepaddrs; ++extern sctp_bindx_func* nio_sctp_bindx; ++extern sctp_peeloff_func* nio_sctp_peeloff; + + jboolean loadSocketExtensionFuncs(JNIEnv* env); + diff --git a/testing/openjdk13/ppc64le.patch b/testing/openjdk13/ppc64le.patch index b4800b62ac..97bd53f814 100644 --- a/testing/openjdk13/ppc64le.patch +++ b/testing/openjdk13/ppc64le.patch @@ -1,5 +1,11 @@ -The ucontext_t-Type is somewhat different with musl libc. -Add some precompiler conditions to use the right fields from the struct. +Subject: Fix compilation with different ucontext_t on musl +Upstream: No +Author: Simon Frankenberger <simon-alpine@fraho.eu> + +The machine state registers have to be accessed differently when +running on musl libc. This patch fix this by replacing +"uc_mcontext.regs->grp" with "uc_mcontext.gp_regs" +and accessing the named fields (like "->nip") by the array index constants. --- old/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +++ new/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp |