Add openjdk 16 from xaero's overlay.

This commit is contained in:
Andrius Štikonas 2021-04-10 23:09:30 +01:00
parent c58b1c343c
commit b98b10d7df
4 changed files with 558 additions and 0 deletions

View File

@ -55,15 +55,18 @@ AUX openjdk-12.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603bee
AUX openjdk-13.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-14.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-15.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-16.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-7.env.sh 746 BLAKE2B b8a18bb5e2dd3c4722b78531428d4291236a6295973fdcd65c64469b3a49a520686ff8d884c0b3d5dd9017ff4027d2fc1d78d57f062a4cf8910e0bab3ed444cc SHA512 2c65d1875406deabbfadb798501de15850775a4a049f073cdfda684ca1bff4b531b93596ee91a7caf77ff6c377457093f72c7bde4b995bce9ffbc4a8fcceb6dd
AUX openjdk-8.env.sh 746 BLAKE2B b8a18bb5e2dd3c4722b78531428d4291236a6295973fdcd65c64469b3a49a520686ff8d884c0b3d5dd9017ff4027d2fc1d78d57f062a4cf8910e0bab3ed444cc SHA512 2c65d1875406deabbfadb798501de15850775a4a049f073cdfda684ca1bff4b531b93596ee91a7caf77ff6c377457093f72c7bde4b995bce9ffbc4a8fcceb6dd
AUX openjdk-9.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX patches/16/1001_ppc64le.patch 9158 BLAKE2B 6bf533c332ac2684216c394e13008bc8d806f2d938b94052cf7f8b267afe585b2bc607b3721c135c7516916595a5ab6ac84fcd96db5754c6cc05279c8c993698 SHA512 05845450afd2d8be9f9f3a69d24c92f2e18593beeb43d748efee53e92edaedacdde2bfcf46b07eb702e036fd3defe2e6418628c26d8e6114653aa521a5d309ce
DIST jdk-10.0.2+13.tar.bz2 1865415 BLAKE2B 46d2f743e2eab0ab1db0714123d4315b417c1970b2cca57ff83acd58ac6dcfca03350136d3aa20c2c8f45c7a50906a648dc581f1bd1dd7723b32bbee3c3c6ea8 SHA512 fd84be24a1b0e0d05ee41518d48443f17baa7a5e0ef7404bb1f9e9e88e6ae90bcd7e36c3d4facada72c952b9a68c5cef14f63e60b6de14ba47e70f9e6bdcc7db
DIST openjdk-11.0.9_p11.tar.bz2 91638327 BLAKE2B a04b7fb5ebde3b6c024e5f3931a2efe796e08ad66c0190cddfa4268d5181f46f24685d9d51ae328547916e8ece723967bf653feeac87347ee14ecbe213ad657a SHA512 a0a6726d5adbe95904b78d8b4319bc4386c594a563f80f63d59072cf72d00928b451163b91258b44193a80851400ce8b8d142fecfd2bd902ff7a5e47cb4a9976
DIST openjdk-12.0.2_p01.tar.bz2 1658584 BLAKE2B fe241cd84044d4722c097ecc0e721b97c601754c6b56d893873bba21020c12e5cae848228b76eeaf2ffe15cb0eeeddb84970a5927181d1062a6c23ba1ff51f23 SHA512 c3ef3c3326ff31380142502771c078303f229b79f4fa9748a401a35a7e5843d07e937eba23ec8d87fe4d20545f4a3011731c7612a77be2cef66a1a03043cb2bd
DIST openjdk-13.0.4_p01.tar.gz 1664699 BLAKE2B c34d51e4153ee63ac145a5d7ceb1534c119a6bf5dcbc1012ec16b182639333a8ba17480e5a09b76179884c1da9c21ef873d86c63d4e6813ca56a2d8225e3af0e SHA512 0941e3d363483edf497e37b23c90ecf31cecfb2881d6596ceb7212a660b556aa65c0dfd73f0bd2c6c38d8bd17f2c945067e662e7e0fea19bfc13575390f69bf3
DIST openjdk-14.0.2_p01.tar.bz2 1730264 BLAKE2B 7553d6df43936de7fafb402d3b6d276f5331da8c5883dac52f118b34d820e3260626b73f0edc19358eda6451d33f64f8c9ae1a57873460e0db5e1d4c8523100f SHA512 b01be476ba51e64a5034ed2471e431f288a95ccd45acafca0b3bb96075955ad6cfc32e01c1004e51dc8afd8910ed6b895b758972bc24db30591d55070e13491c
DIST openjdk-15.0.0_p36.tar.gz 101812870 BLAKE2B 1028ab04825941452b603998f05e2a7e419931979a19855f6ea6c1578c331704ac19ae77043a4f44b2f5d9d481b9a9eaad6c3e3eec9154789d54980ba0295bb7 SHA512 c08d2818de06569278b67954556221ed7c6ab6848ffc57823b789f370ebdd332d2803979a5a254e8f9f669ea161bb479f66ad4e1490b37889d38233b6cca4357
DIST openjdk-16.0.0_p36.tar.gz 104327489 BLAKE2B 7d20f72000155829cf5c36c430bde5ce7d22000b363583da25de9bc7b070b601141ad49b11f3505a344baea36ea846936e148e80c1fadf6e4ace53582f92480c SHA512 082d8a7fdc3f096fdc843869af7d43aa1eb9ac6b0538fbb5f8a0f4d942051a90e49932b30f3d2c3620845fb98373097e509a8432d16f1d44742f44286dccb46d
DIST openjdk-8.272_p10.tar.bz2 457222 BLAKE2B 51e487d36c1922c5fc04d8922f1000a776e4872142517933ef5e8d5fd825f221fa02325bd755bf3f48f7f3221a2da3ca182301fb303675cb7d712d7b2f1c7751 SHA512 488b7fa0ed725936d483efd54242dbf4409752c685f29277023fb47c4375b5700b34e743d819d7d7c2406a2f8845d1c3d4fc548c156b6c7c30e43574c1b51527
DIST openjdk-9.0.4_p12.tar.bz2 823756 BLAKE2B f1b457655520b983597b15254323abdb0c39feaff78ce36d88ef556a086d9f9333ceddec63d945ca28bb06f4a06c2bc1344051ac2c1df55a01728016ff7255c1 SHA512 cef3655ae7db657e6c81aa86587e451e58896bb6ee786495f6d757096334435b6a4de26ec3ec927da2487e135f09ce26414f8d6b9b9c508a28d3087be286b1ec
DIST openjdk-aarch64-shenandoah-8.272_p10.tar.bz2 462755 BLAKE2B abeabf704d2135da9df6746545209f5a658ec547be5852041bb9bd1dfc4546cef143541df61b4705b6d2181ae7ec91a8c64e2b27347c24d146da49bbf8c228ef SHA512 7cae0cf80e09e1d2ad3eef8bf6740942788d0af4d3c9821bb0785ea42d4b38319d0ec57a8d21add25a40eebdc5ecba8234c9f04e6922e87c80480f71b04e2e3d
@ -94,6 +97,7 @@ EBUILD openjdk-12.0.2_p01.ebuild 8436 BLAKE2B dfe25378ceff511abb9fbff5a775331513
EBUILD openjdk-13.0.4_p01.ebuild 8417 BLAKE2B 521f065801713eec3290d6fca3ae224f8fae56c026dedcc9e609d9ad92bf2c21ba195d785b8936a1099bb69109fc744132e8876f8e15dcd85f8304cbf1771c4e SHA512 5c08b3a707929881bdac4b8759851f4f0b80482245890568149adadded1e597a8260e707264cf85ea082f610a1f290ca9a00961f78af38466e433f867bd8a8c9
EBUILD openjdk-14.0.2_p01.ebuild 8419 BLAKE2B cdf793ba4d051f57c89027fca2a42666227974d2d1dc9191d9ef21f18110fa302fa6dfbe0a1daf3a6609e1458319f2a6150c1c07180096f1ccd66206160e77fd SHA512 d18978808c7ee2c530eabe1d749681ad50314366590d7683b39854dee9b07f6a609b115ecfc58e021bda493c0eec8e17ff0178fe3b8261675feaf152b9c97f4a
EBUILD openjdk-15.0.0_p36.ebuild 8645 BLAKE2B 8a4516e98f32bb038b6a5b0123bba4615842c6d19ed1fc1416c71f789d5ca6e366d8a71501d650c3a77304d80f3140a1e437b98b3045186ee538a81307d5f457 SHA512 7e637fae9f756c290479602175f8c9ca5d31a5d75fe69b21fb54e0aba2b559d4329e03f20935b8109a946bcf6063996f6f42a25693c3f2ad62590ff6bbb1a379
EBUILD openjdk-16.0.0_p36.ebuild 8496 BLAKE2B a98e9f85c96b6d0098ce21e337b5764c88c9933eb8abf94c0906430b60a85657360fb903eec0973262a268b8781324deea8d21a9025e91dbdf19796dc07b9c27 SHA512 b02a2fed9ae8ff387ae6691e21f2dba0b3f3cc1c636a9c5ea328f9dd41effb11e809bc77ca0ac84e980f07480413066b1f76f5f3f923d32e290ecb757f8fa687
EBUILD openjdk-8.272_p10.ebuild 8024 BLAKE2B dfb1d42eaad81e5942cacf16a28286c571c673aa47b3c951a9a42e94bc443e77c2a0b2f8099542e0eff7f8e0b11cca2413efdbd388555d2a0830d859f659dffa SHA512 af55ddfe5a2c39468590ca70216d64e3b211890a662f9bbd064fcec7f61f8e0d151c594653c27554ce49403c8ef0cea7c76e5c635a95121978cda4e7de11aa03
EBUILD openjdk-9.0.4_p12.ebuild 8182 BLAKE2B 745a457dcf08103e498da991501464ccb2de906145e5d8d45442ddf9bdd9bc50dc761d5fb6b489fa5c17419476fb36fe380f6ef880642ff68e9b1a66bb99940f SHA512 8239c6a2060ba559e4c319b528b8eeb7aa9fe6e77111ccd265d713bd4a613d90c2f1cc724085c667034e88901530d90a9e0a4413091150a4d0dd19f159f60a2f
MISC metadata.xml 1432 BLAKE2B 36a11642c99127a5f97fc0b095a142705c6b4e077ed24604f1886e4d1beaa47b4fa30359600797d5e6a085befd11a2851196fe97a75a0f0907461679946b4cbf SHA512 ecc66015da3a0fc616b91dd5aaffb5b050c9f66e936cad02ec12fb56dd7c6b3b3c331d8856402c0deee16c415ea083e088cce7414703f9d659f551883b055ff0

View File

@ -0,0 +1,16 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
VERSION="OpenJDK ${PV}"
JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JAVAC="\${JAVA_HOME}/bin/javac"
PATH="\${JAVA_HOME}/bin"
ROOTPATH="\${JAVA_HOME}/bin"
LDPATH="\${JAVA_HOME}/lib/:\${JAVA_HOME}/lib/server/"
MANPATH=""
PROVIDES_TYPE="JDK JRE"
PROVIDES_VERSION="${SLOT}"
BOOTCLASSPATH=""
GENERATION="2"
ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH"

View File

@ -0,0 +1,248 @@
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
@@ -47,6 +47,10 @@
#include "utilities/macros.hpp"
#include "utilities/powerOfTwo.hpp"
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
#ifdef PRODUCT
#define BLOCK_COMMENT(str) // nothing
#else
@@ -1272,7 +1276,11 @@
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address addr = (address)uc->uc_mcontext.regs->gpr[ra] + (ssize_t)ds;
+#else // Musl
+ address addr = (address)uc->uc_mcontext.gp_regs[ra] + (ssize_t) ds;
+#endif
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
@@ -1335,11 +1343,20 @@
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return ds+(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ return ds+(address)uc->uc_mcontext.gp_regs[ra];
+#endif
} else if (is_stdux(instruction) && rs == 1) {
int rb = inv_rb_field(instruction);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address sp = (address)uc->uc_mcontext.regs->gpr[1];
long rb_val = (long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address sp = (address)uc->uc_mcontext.gp_regs[1];
+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb];
+#endif
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
--- old/src/hotspot/cpu/ppc/vm_version_ppc.cpp
+++ new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
@@ -52,6 +52,10 @@
#endif
#endif
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
bool VM_Version::_is_determine_features_test_running = false;
uint64_t VM_Version::_dscr_val = 0;
@@ -709,7 +713,7 @@
unsigned long auxv = getauxval(AT_HWCAP2);
if (auxv & PPC_FEATURE2_HTM_NOSC) {
- if (auxv & PPC_FEATURE2_HAS_HTM) {
+ if (auxv & PPC_FEATURE2_HTM) {
// TM on POWER8 and POWER9 in compat mode (VM) is supported by the JVM.
// TM on POWER9 DD2.1 NV (baremetal) is not supported by the JVM (TM on
// POWER9 DD2.1 NV has a few issues that need a couple of firmware
--- old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -76,7 +76,11 @@
# include <poll.h>
# include <ucontext.h>
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
address os::current_stack_pointer() {
intptr_t* csp;
@@ -108,24 +112,42 @@
// - if uc was filled by getcontext(), it is undefined - getcontext() does not fill
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
return (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_get_pc in sigaction context");
+ return (address)uc->uc_mcontext.gp_regs[PT_NIP];
+#endif
}
// modify PC in ucontext.
// Note: Only use this for an ucontext handed down to a signal handler. See comment
// in ucontext_get_pc.
void os::Posix::ucontext_set_pc(ucontext_t * uc, address pc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_set_pc in sigaction context");
uc->uc_mcontext.regs->nip = (unsigned long)pc;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_set_pc in sigaction context");
+ uc->uc_mcontext.gp_regs[PT_NIP] = (unsigned long)pc;
+#endif
}
static address ucontext_get_lr(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (address)uc->uc_mcontext.regs->link;
+#else // Musl
+ return (address)uc->uc_mcontext.gp_regs[PT_LNK];
+#endif
}
intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/];
+#else // Musl
+ return (intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/];
+#endif
}
intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
@@ -133,7 +155,11 @@
}
static unsigned long ucontext_get_trap(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return uc->uc_mcontext.regs->trap;
+#else // Musl
+ return uc->uc_mcontext.gp_regs[PT_TRAP];
+#endif
}
address os::fetch_frame_from_context(const void* ucVoid,
@@ -203,7 +229,11 @@
// 3.2.1 "Machine State Register"), however note that ISA notation for bit
// numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
// bits 33 and 34. It's not related to endianness, just a notation matter.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
+#else // Musl
+ if (second_uc->uc_mcontext.gp_regs[PT_MSR] & 0x600000000) {
+#endif
if (TraceTraps) {
tty->print_cr("caught signal in transaction, "
"ignoring to jump to abort handler");
@@ -451,6 +481,7 @@
const ucontext_t* uc = (const ucontext_t*)context;
st->print_cr("Registers:");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
@@ -459,8 +490,18 @@
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
+#else // Musl
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_NIP]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_LNK]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_CTR]);
st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
+ st->cr();
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
@@ -483,12 +524,22 @@
st->print_cr("Register to memory mapping:");
st->cr();
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->nip);
st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->link);
st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->ctr);
+#else // Musl
+ st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_NIP]);
+ st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_LNK]);
+ st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_CTR]);
+#endif
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, uc->uc_mcontext.regs->gpr[i]);
+#else // Musl
+ print_location(st, uc->uc_mcontext.gp_regs[i]);
+#endif
}
st->cr();
}
Only in new: src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp.orig
--- old/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
@@ -27,6 +27,10 @@
#include "runtime/frame.inline.hpp"
#include "runtime/thread.hpp"
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
frame JavaThread::pd_last_frame() {
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
@@ -55,8 +59,13 @@
// if we were running Java code when SIGPROF came in.
if (isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
(address)uc->uc_mcontext.regs->nip);
+#else // Musl
+ frame ret_frame((intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/],
+ (address)uc->uc_mcontext.gp_regs[PT_NIP]);
+#endif
if (ret_frame.pc() == NULL) {
// ucontext wasn't useful
@@ -69,7 +78,11 @@
if (!Method::is_valid_method(m)) return false;
if (!Metaspace::contains(m->constMethod())) return false;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/];
+#else // Musl
+ uint64_t reg_bcp = uc->uc_mcontext.gp_regs[14/*R14_bcp*/];
+#endif
uint64_t istate_bcp = istate->bcp;
uint64_t code_start = (uint64_t)(m->code_base());
uint64_t code_end = (uint64_t)(m->code_base() + m->code_size());

View File

@ -0,0 +1,290 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
MY_PV="${PV/_p/+}"
FULL_VERSION="${PV%_p*}"
SLOT=$(get_major_version)
# First release of major jdk releases do not contain u at end jdk<slot>.
# so 15.0.0 would fetch jdk-15-ga.tar.gz from jdk15, 15.0.1 jdk-15.0.1-ga.tar.gz from jdk15u
if [ $(get_after_major_version $FULL_VERSION) = "0.0" ]; then
SRC_URI="https://github.com/openjdk/jdk${SLOT}/archive/jdk-${SLOT}-ga.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/jdk${SLOT}-jdk-${SLOT}-ga"
else
SRC_URI="https://github.com/openjdk/jdk${SLOT}u/archive/jdk-${FULL_VERSION}-ga.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/jdk${SLOT}u-jdk-${FULL_VERSION}-ga"
fi
DESCRIPTION="Open source implementation of the Java programming language"
HOMEPAGE="https://openjdk.java.net"
LICENSE="GPL-2"
KEYWORDS="amd64 ~arm arm64 ~ppc64"
IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap"
COMMON_DEPEND="
media-libs/freetype:2=
media-libs/giflib:0/7
media-libs/libpng:0=
media-libs/lcms:2=
sys-libs/zlib
virtual/jpeg:0=
systemtap? ( dev-util/systemtap )
"
# Many libs are required to build, but not to run, make is possible to remove
# by listing conditionally in RDEPEND unconditionally in DEPEND
RDEPEND="
${COMMON_DEPEND}
>=sys-apps/baselayout-java-0.1.0-r1
!headless-awt? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
)
alsa? ( media-libs/alsa-lib )
cups? ( net-print/cups )
selinux? ( sec-policy/selinux-java )
"
DEPEND="
${COMMON_DEPEND}
app-arch/zip
media-libs/alsa-lib
net-print/cups
x11-base/xorg-proto
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
javafx? ( dev-java/openjfx:${SLOT}= )
|| (
dev-java/openjdk-bin:${SLOT}
dev-java/openjdk:${SLOT}
dev-java/openjdk-bin:$((SLOT-1))
dev-java/openjdk:$((SLOT-1))
)
"
REQUIRED_USE="javafx? ( alsa !headless-awt )"
# The space required to build varies wildly depending on USE flags,
# ranging from 2GB to 16GB. This function is certainly not exact but
# should be close enough to be useful.
openjdk_check_requirements() {
local M
M=2048
M=$(( $(usex jbootstrap 2 1) * $M ))
M=$(( $(usex debug 3 1) * $M ))
M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
pkg_pretend() {
openjdk_check_requirements
if [[ ${MERGE_TYPE} != binary ]]; then
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
fi
}
pkg_setup() {
openjdk_check_requirements
java-vm-2_pkg_setup
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT} openjdk-$((SLOT-1)) openjdk-bin-$((SLOT-1))"
JAVA_PKG_WANT_SOURCE="${SLOT}"
JAVA_PKG_WANT_TARGET="${SLOT}"
# The nastiness below is necessary while the gentoo-vm USE flag is
# masked. First we call java-pkg-2_pkg_setup if it looks like the
# flag was unmasked against one of the possible build VMs. If not,
# we try finding one of them in their expected locations. This would
# have been slightly less messy if openjdk-bin had been installed to
# /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env
# file but disable it so that it would not normally be selectable.
local vm
for vm in ${JAVA_PKG_WANT_BUILD_VM}; do
if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then
java-pkg-2_pkg_setup
return
fi
done
if has_version --host-root dev-java/openjdk:${SLOT}; then
export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT}
else
if [[ ${MERGE_TYPE} != "binary" ]]; then
JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT})
[[ -n ${JDK_HOME} ]] || die "Build VM not found!"
JDK_HOME=${JDK_HOME#*/}
JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*}
export JDK_HOME
fi
fi
}
src_prepare() {
default
if use elibc_musl ; then
eapply "${FILESDIR}/patches/${SLOT}/1001_ppc64le.patch"
# this needs libthread_db which is only provided by glibc
# haven't found any way to disable this module so just remove it.
rm -rf "${S}"/src/jdk.hotspot.agent || die "failed to remove HotSpot agent"
fi
chmod +x configure || die
}
src_configure() {
# Work around stack alignment issue, bug #647954. in case we ever have x86
use x86 && append-flags -mincoming-stack-boundary=2
# Work around -fno-common ( GCC10 default ), bug #713180
append-flags -fcommon
# Enabling full docs appears to break doc building. If not
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
local myconf=(
--disable-ccache
--enable-full-docs=no
--with-boot-jdk="${JDK_HOME}"
--with-extra-cflags="${CFLAGS}"
--with-extra-cxxflags="${CXXFLAGS}"
--with-extra-ldflags="${LDFLAGS}"
--with-giflib=system
--with-lcms=system
--with-libjpeg=system
--with-libpng=system
--with-native-debug-symbols=$(usex debug internal none)
--with-vendor-name="Gentoo"
--with-vendor-url="https://gentoo.org"
--with-vendor-bug-url="https://bugs.gentoo.org"
--with-vendor-vm-bug-url="https://bugs.openjdk.java.net"
--with-vendor-version-string="${PVR}"
--with-version-pre=""
--with-version-string="${PV%_p*}"
--with-version-build="${PV#*_p}"
--with-zlib=system
--disable-warnings-as-errors
--enable-dtrace=$(usex systemtap yes no)
--enable-headless-only=$(usex headless-awt yes no)
$(tc-is-clang && echo "--with-toolchain-type=clang")
)
if use javafx; then
local zip="${EROOT%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then
myconf+=( --with-import-modules="${zip}" )
else
die "${zip} not found or not readable"
fi
fi
# PaX breaks pch, bug #601016
if use pch && ! host-is-pax; then
myconf+=( --enable-precompiled-headers )
else
myconf+=( --disable-precompiled-headers )
fi
(
unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS
CFLAGS= CXXFLAGS= LDFLAGS= \
CONFIG_SITE=/dev/null \
econf "${myconf[@]}"
)
}
src_compile() {
local myemakeargs=(
JOBS=$(makeopts_jobs)
LOG=debug
ALL_NAMED_TESTS= # Build error
$(usex doc docs '')
$(usex jbootstrap bootcycle-images product-images)
)
emake "${myemakeargs[@]}" -j1 #nowarn
}
src_install() {
local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
local ddest="${ED}${dest#/}"
cd "${S}"/build/*-release/images/jdk || die
# Create files used as storage for system preferences.
mkdir .systemPrefs || die
touch .systemPrefs/.system.lock || die
touch .systemPrefs/.systemRootModFile || die
# Oracle and IcedTea have libjsoundalsa.so depending on
# libasound.so.2 but OpenJDK only has libjsound.so. Weird.
if ! use alsa ; then
rm -v lib/libjsound.* || die
fi
if ! use examples ; then
rm -vr demo/ || die
fi
if ! use source ; then
rm -v lib/src.zip || die
fi
rm -v lib/security/cacerts || die
dodir "${dest}"
cp -pPR * "${ddest}" || die
dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
# must be done before running itself
java-vm_set-pax-markings "${ddest}"
einfo "Creating the Class Data Sharing archives and disabling usage tracking"
"${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die
use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
java-vm_revdep-mask
java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
if use doc ; then
docinto html
dodoc -r "${S}"/build/*-release/images/docs/*
dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}"
fi
}
pkg_postinst() {
java-vm-2_pkg_postinst
if use gentoo-vm ; then
ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK"
ewarn "recognised by the system. This will almost certainly break"
ewarn "many java ebuilds as they are not ready for openjdk-11"
else
ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK"
ewarn "will not be recognised by the system. For example, simply calling"
ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo"
ewarn "fully supports Java ${SLOT}. This JDK must therefore be invoked using its"
ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
fi
}