diff --git a/testing/openjdk12/APKBUILD b/testing/openjdk12/APKBUILD index 8292b44e2ed..8efec2cf745 100644 --- a/testing/openjdk12/APKBUILD +++ b/testing/openjdk12/APKBUILD @@ -3,7 +3,7 @@ pkgname=openjdk12 pkgver=12.0.2_p10 _pkgver=${pkgver/_p10/-ga} -pkgrel=1 +pkgrel=2 pkgdesc="Oracle OpenJDK 12" url="https://hg.openjdk.java.net/jdk-updates/jdk12u" arch="all !x86 !armhf !armv7 !mips !mips64" # oracle dropped support for 32 bit @@ -48,6 +48,9 @@ source="jdk-$_pkgver.tar.gz::https://github.com/openjdk/jdk12u/archive/jdk-$_pkg ppc64le.patch make-4.3.patch fix-bootjdk-check.patch + gcc10-compilation-fix.patch + JDK-8245051.patch + JDK-8241296.patch HelloWorld.java TestECDSA.java @@ -285,12 +288,15 @@ _jdk() { } sha512sums="370e3d8378fcdf929df7325ac988ffcb4565c3fbb7cd1831554e0977769f1beaef0185ac8c7df40b5d74ca88acb27f657fb617279f58a8f78cf2adac10b95882 jdk-12.0.2-ga.tar.gz -fe1b54d6006e9f77c1ebc0705e28eb962f42571b4e4ee5cd73e0c7000cbf46f90df4a83b72421261e02abec488f493111d28893a27edf2af8eb43a9ecee00833 build.patch -8c0f1f8d2a78ebb30a8460bc0ea9cd2349cea98819df1577bf7de19a1dd82d06a593f36b4e17c282ed53d23f00163e387e3dd1f3c9e5a092726e78c3aa710370 aarch64.patch -b6b1623a8dffd5a91bf122d7ef5a4b7cd2dff9dde072e9613eb38b1c95000c95b1eef7eb8ea8edc8bc3a59592ba3cf78bd32d31a8c6e3a30c24fc2030405a696 ppc64le.patch -ee8ba62ab5909648dccc1d5e1d12b4f35e813320a7919476bc1ff35bc2ef51030df3426616e0f636dd64a8b07021201f7bcb477253bb33a97cd0db8a6684137c make-4.3.patch -5261f5d30659991869a069ee50988ccb4741951def70a172bbe978c0bbb2d7dc0fe4595d9ac19ae28137a13e246882f21a275b1553652ab20b96ca9af550e444 fix-bootjdk-check.patch +d46ff99976290bc4d9f8aa2a3fd505a6036906fafd616783a7ab894c49649af128f261934617bab38fdcc53accc933b47d0329564fd841ae9a8f5d6597646526 build.patch +241a34ceed95c53217284b551bda502236acb07a0defff41bf5a6dd654e48f7b3038c8c69c31c848e4b0b060374fd93d65579d644249d4673755f5bdfcc66893 aarch64.patch +c231c16f38eec3ef6afe38a790ca06a4f9d492994a400ea84c6e72e8f188233288554c44f4759e40c3660b51cb471a5434695e915a1b7e8ecef53bd45f3f847b ppc64le.patch +cc23a053243d4672b6d4a19196a459f2fb0387d7f9286a2673bbe1885963e43315e0815d9df8e8c9e9093df3c15ffb6bfc72cb6d5a8b28ae278f86825a9a1272 make-4.3.patch +fe94d7b6cd84cb71d00c9bf30ddb000afe60c6d0e5eb2aac20a6f9913d42f50efd3ec74115d36f35b0053b14d16e6a90d7a64378b151c465793c11d7f9dcd57b fix-bootjdk-check.patch +bef17d175afcca4259c030b56961780d612c4c310c243ef60a0759a0faa16614a0deac2a80bab68073fab038eafaa436a4bce0e33a1b673fbbe56d9d4eb67aeb gcc10-compilation-fix.patch +0254dae7aef9bd6c4e19ac3c31f0b7bf8f818ead8858b1cd4e29e4572a5b0932de1ba498ba2c60a03dce77da235fdad23e7a4be5bea298bba3951752d313d1b4 JDK-8245051.patch +03e0df30091c137fe83d7b5b9d91f3f206a477fdffabe2371ae160f6b51535c3aca67b3cef0531ec75ff1f4bfafbaeb8709e8110ac1202ea38499027c9a51fa2 JDK-8241296.patch d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java 27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java -fadd06c034614a25537246dfd66a4645c2a4c673f16b5d3e8abdd89c81baf04bd2797b26b0e589ec11ee08b90783b232a6d06c72589d211a5e10b8638a627911 Alpine_Bug_10126.java" +cc466f64fcc8762cf6e3c1f5739be6425209b27aa58acff4e7eb126003d61fa18266f0e79e57e9d84224654010185ab45dc0a8043543dea227258458a00a1eb1 Alpine_Bug_10126.java" diff --git a/testing/openjdk12/Alpine_Bug_10126.java b/testing/openjdk12/Alpine_Bug_10126.java index 76574a15098..a381c9ed70a 100644 --- a/testing/openjdk12/Alpine_Bug_10126.java +++ b/testing/openjdk12/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/openjdk12/JDK-8241296.patch b/testing/openjdk12/JDK-8241296.patch new file mode 100644 index 00000000000..5b88c4dffd0 --- /dev/null +++ b/testing/openjdk12/JDK-8241296.patch @@ -0,0 +1,25 @@ +From e566dca620c43d56798770b41cd0d25a63a71b82 Mon Sep 17 00:00:00 2001 +From: Andrew Haley +Date: Thu, 19 Mar 2020 14:53:57 +0000 +Subject: [PATCH] 8241296: Segfault in JNIHandleBlock::oops_do() + +Reviewed-by: stefank, shade +--- + src/hotspot/share/runtime/thread.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp +index 0aa68f3941..ca7f0b0fa4 100644 +--- a/src/hotspot/share/runtime/thread.cpp ++++ b/src/hotspot/share/runtime/thread.cpp +@@ -872,7 +872,9 @@ bool Thread::claim_oops_do_par_case(int strong_roots_parity) { + } + + void Thread::oops_do(OopClosure* f, CodeBlobClosure* cf) { +- active_handles()->oops_do(f); ++ if (active_handles() != NULL) { ++ active_handles()->oops_do(f); ++ } + // Do oop for ThreadShadow + f->do_oop((oop*)&_pending_exception); + handle_area()->oops_do(f); diff --git a/testing/openjdk12/JDK-8245051.patch b/testing/openjdk12/JDK-8245051.patch new file mode 100644 index 00000000000..c4d10fb8834 --- /dev/null +++ b/testing/openjdk12/JDK-8245051.patch @@ -0,0 +1,72 @@ +From 612c38cdc92a3e169fe83846920407d50263044a Mon Sep 17 00:00:00 2001 +From: Xin Liu +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/openjdk12/aarch64.patch b/testing/openjdk12/aarch64.patch index 26484ca0808..d1c29368d9e 100644 --- a/testing/openjdk12/aarch64.patch +++ b/testing/openjdk12/aarch64.patch @@ -1,3 +1,12 @@ +Subject: Remove fpu_control.h include +Upstream: No +Author: Simon Frankenberger + +The header is not present with musl and including it results in build error. +It's not needed anyways. + +The second patch fixes "error: redeclaration of 'using MacroAssembler::call_VM_leaf_base'" + --- 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 @@ @@ -8,3 +17,14 @@ #ifdef BUILTIN_SIM #define REG_SP REG_RSP +--- old/src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp ++++ new/src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp +@@ -38,8 +38,6 @@ + protected: + + protected: +- using MacroAssembler::call_VM_leaf_base; +- + // Interpreter specific version of call_VM_base + using MacroAssembler::call_VM_leaf_base; + diff --git a/testing/openjdk12/build.patch b/testing/openjdk12/build.patch index 2195d15f83d..14256893077 100644 --- a/testing/openjdk12/build.patch +++ b/testing/openjdk12/build.patch @@ -1,3 +1,11 @@ +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 + +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 @@ -53,6 +53,7 @@ diff --git a/testing/openjdk12/fix-bootjdk-check.patch b/testing/openjdk12/fix-bootjdk-check.patch index c7fe679b36e..24c4ba66b02 100644 --- a/testing/openjdk12/fix-bootjdk-check.patch +++ b/testing/openjdk12/fix-bootjdk-check.patch @@ -1,3 +1,7 @@ +Subject: Fix detection of bootjdk on configure +Upstream: No +Author: Simon Frankenberger + 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/openjdk12/gcc10-compilation-fix.patch b/testing/openjdk12/gcc10-compilation-fix.patch new file mode 100644 index 00000000000..c13d92f581e --- /dev/null +++ b/testing/openjdk12/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 + +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 + #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/openjdk12/make-4.3.patch b/testing/openjdk12/make-4.3.patch index 6720709cda1..75617366cb3 100644 --- a/testing/openjdk12/make-4.3.patch +++ b/testing/openjdk12/make-4.3.patch @@ -1,4 +1,7 @@ -upstream report: https://bugs.openjdk.java.net/browse/JDK-8237879. +Subject: Fix build error with make >= 4.3 +Upstream: Yes +Upstream-Url: https://bugs.openjdk.java.net/browse/JDK-8237879 +Author: Simon Frankenberger diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index 170c3ed..697f9d2 100644 diff --git a/testing/openjdk12/ppc64le.patch b/testing/openjdk12/ppc64le.patch index d3b4ae01316..30e29143b2b 100644 --- a/testing/openjdk12/ppc64le.patch +++ b/testing/openjdk12/ppc64le.patch @@ -1,3 +1,12 @@ +Subject: Fix compilation with different ucontext_t on musl +Upstream: No +Author: Simon Frankenberger + +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 @@ -1290,7 +1290,11 @@ @@ -46,6 +55,16 @@ // 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,6 +76,9 @@ + # include + # include + ++#if ! (defined(__GLIBC__) || defined(__UCLIBC__)) ++#include ++#endif + + address os::current_stack_pointer() { + intptr_t* csp; @@ -108,24 +108,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. @@ -55,7 +74,7 @@ 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[32]; ++ return (address)uc->uc_mcontext.gp_regs[PT_NIP]; +#endif } @@ -68,7 +87,7 @@ 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[32] = (unsigned long)pc; ++ uc->uc_mcontext.gp_regs[PT_NIP] = (unsigned long)pc; +#endif } @@ -76,7 +95,7 @@ +#if defined(__GLIBC__) || defined(__UCLIBC__) return (address)uc->uc_mcontext.regs->link; +#else // Musl -+ return (address)uc->uc_mcontext.gp_regs[36]; ++ return (address)uc->uc_mcontext.gp_regs[PT_LNK]; +#endif } @@ -89,16 +108,14 @@ } intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) { -@@ -255,7 +273,13 @@ +@@ -255,7 +273,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 -+ // why 33? -+ // see comment for glibc NGREG: "r0-r31, nip, msr, lr, etc." -+ if (second_uc->uc_mcontext.gp_regs[33] & 0x600000000) { ++ if (second_uc->uc_mcontext.gp_regs[PT_MSR] & 0x600000000) { +#endif if (TraceTraps) { tty->print_cr("caught signal in transaction, " @@ -116,9 +133,9 @@ if (i % 3 == 2) st->cr(); } +#else // Musl -+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[32]); -+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[36]); -+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[35]); ++ 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]); @@ -130,7 +147,7 @@ intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc); st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp)); -@@ -587,12 +622,22 @@ +@@ -586,12 +621,22 @@ st->print_cr("Register to memory mapping:"); st->cr(); @@ -139,9 +156,9 @@ 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[32]); -+ st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[36]); -+ st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[35]); ++ 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); @@ -155,6 +172,17 @@ } --- 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 ++#endif ++ + frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + @@ -56,8 +56,13 @@ // if we were running Java code when SIGPROF came in. if (isInJava) { @@ -164,7 +192,7 @@ (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[32]); ++ (address)uc->uc_mcontext.gp_regs[PT_NIP]); +#endif if (ret_frame.pc() == NULL) {