Port of JEP 386: Alpine Linux Port to jdk8u
Andrew Haley
aph-open at littlepinkcloud.com
Thu May 5 11:33:35 UTC 2022
On 4/28/22 18:16, Stephanie Crater wrote:
> Would the community be open to a port of JEP 386: Alpine Linux Port [1]/JDK-8247589 [2] to OpenJDK jdk8u? A backport of JDK-8247589 to 11u has recently been integrated by BellSoft, and many OpenJDK vendors (BellSoft Liberica, Azul Zulu, Amazon Corretto) provide a jdk8 for Alpine Linux. We believe there is sufficient user demand for Alpine/musl support on jdk8u, but would be interested in the opinions of other vendors on this as well.
In principle, yes. I don't much like the actual patch, which sprinkles
changes like
#ifndef MUSL_LIBC
#include <sys/poll.h>
#else
#include <poll.h>
#endif
and (Yuck! Could they really not have factored this in a better way?)
+#ifndef MUSL_LIBC
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);
@@ -576,6 +604,16 @@ void os::print_context(outputStream *st, void *context) {
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();
+ }
in many places, but I have to admit that none of it looks very risky.
My concern is more to do with maintainability, with #ifndef MUSL_LIBC
occurring 25 times in the patch. But we're supposed to change patches
as little as possible when backporting.
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the jdk8u-dev
mailing list