testing/openjdk22: new aport

This commit is contained in:
Simon Frankenberger 2024-04-23 05:48:01 +02:00 committed by omni
parent 3c632ef10d
commit fd5d9cbd86
5 changed files with 606 additions and 0 deletions

293
testing/openjdk22/APKBUILD Normal file
View File

@ -0,0 +1,293 @@
# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
# Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
pkgname=openjdk22
pkgver=22.0.1_p8
_pkgver=${pkgver%_p*}-ga
pkgrel=2
pkgdesc="Oracle OpenJDK 22"
provider_priority=22
url="https://github.com/openjdk/jdk22u"
# oracle dropped support for 32 bit
arch="all !x86 !armhf !armv7"
license="GPL-2.0-with-classpath-exception"
makedepends="
openjdk21-jdk
autoconf
bash
gawk
grep
make
zip
alsa-lib-dev
cups-dev
elfutils-dev
fontconfig-dev
freetype-dev
giflib-dev
lcms2-dev
libffi-dev
libjpeg-turbo-dev
libx11-dev
libxext-dev
libxrandr-dev
libxrender-dev
libxt-dev
libxtst-dev
linux-headers
zlib-dev
"
depends="$pkgname-jdk $pkgname-demos $pkgname-doc" # for the virtual openjdk18 package
subpackages="$pkgname-jmods:_jmods:noarch
$pkgname-demos:_demos:noarch
$pkgname-doc:_doc:noarch
$pkgname-jre:_jre
$pkgname-src:_src:noarch
$pkgname-static-libs:_static_libs
$pkgname-jre-headless:_jre_headless
$pkgname-jdk:_jdk
"
source="jdk-$_pkgver.tar.gz::https://github.com/openjdk/jdk22u/archive/jdk-$_pkgver.tar.gz
gtest-1.14.0.tar.gz::https://github.com/google/googletest/archive/v1.14.0.tar.gz
ppc64le.patch
riscv64.patch
JDK-8299245_disable-tests.patch
JDK-8218814_Wformat-security.patch
"
builddir="$srcdir/jdk22u-jdk-${_pkgver/+/-}"
provides="$pkgname-bootstrap=$pkgver-r$pkgrel"
_java_home="/usr/lib/jvm/java-22-openjdk"
ldpath="$_java_home/lib:$_java_home/lib/server"
sonameprefix="$pkgname:"
# enable running the JTReg tests in check?
# see comment in that function for explanation
_run_jtreg=${_run_jtreg:-0}
if [ $_run_jtreg -ne 0 ]; then
makedepends="$makedepends java-jtreg"
checkdepends="$checkdepends ttf-freefont xvfb-run"
fi
build() {
if [ $_run_jtreg -ne 0 ]; then
_with_jtreg="--with-jtreg=/usr/share/java/jtreg"
else
_with_jtreg="--with-jtreg=no"
fi
if [ -n "$USE_CCACHE" ]; then
# workaround ccache being disallowed
export PATH="/usr/bin:/bin:/sbin:/usr/sbin"
local ccache="--enable-ccache"
fi
# 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 "common/doc/building.md"
# shellcheck disable=2097 disable=2098
CFLAGS='' CXXFLAGS='' LDFLAGS='' \
bash ./configure \
--build=$CBUILD \
--host=$CHOST \
--target=$CTARGET \
--prefix="$_java_home" \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--with-extra-cflags="$CFLAGS -D_LARGEFILE64_SOURCE" \
--with-extra-cxxflags="$CXXFLAGS -D_LARGEFILE64_SOURCE" \
--with-extra-ldflags="$LDFLAGS" \
--with-zlib=system \
--with-libjpeg=system \
--with-giflib=system \
--with-libpng=system \
--with-lcms=system \
--with-jobs=${JOBS:-4} \
--with-test-jobs=${JOBS:-4} \
--with-native-debug-symbols=none \
--with-gtest=../googletest-1.14.0 \
$ccache \
$_with_jtreg \
--disable-warnings-as-errors \
--disable-precompiled-headers \
--enable-dtrace=no \
--with-jvm-variants=server \
--with-debug-level=release \
--with-version-pre= \
--with-version-opt="alpine-r$pkgrel" \
--with-version-build="${pkgver##*p}" \
--with-vendor-name="Alpine" \
--with-vendor-url="https://alpinelinux.org/" \
--with-vendor-bug-url="https://gitlab.alpinelinux.org/alpine/aports/issues" \
--with-vendor-vm-bug-url="https://gitlab.alpinelinux.org/alpine/aports/issues"
MAKEFLAGS='' make jdk-image
MAKEFLAGS='' make static-libs-image
}
check() {
# run the gtest unittest suites
# they don't take long, DO NOT DISABLE THEM!
# override make variable, disable -Werror
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.
# As the tests take too long, they are disabled by default.
# 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" )
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"
# abort the build so you may take a look at the logfile
false
return 1
fi
}
package() {
local libstaticdir="lib/static/linux-${CARCH/x86_64/amd64}/musl"
mkdir -p "$pkgdir/$_java_home/$libstaticdir"
cd build/linux-*-server-release/images/
cp -r jdk/* "$pkgdir/$_java_home"
cp -r static-libs/lib/* "$pkgdir/$_java_home/$libstaticdir"
}
_jmods() {
pkgdesc="Oracle OpenJDK 22 (jmods)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/jmods" "$_toroot"
}
_demos() {
pkgdesc="Oracle OpenJDK 22 (demos)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/demo" "$_toroot"
}
_doc() {
pkgdesc="Oracle OpenJDK 22 (Documentation)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/man" "$_toroot"
}
_jre() {
pkgdesc="Oracle OpenJDK 22 (JRE)"
depends="$pkgname-jre-headless"
provides=java-jre
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot/lib"
mv "$_fromroot/lib/libawt_xawt.so" \
"$_fromroot/lib/libfontmanager.so" \
"$_fromroot/lib/libjavajpeg.so" \
"$_fromroot/lib/libjawt.so" \
"$_fromroot/lib/libjsound.so" \
"$_fromroot/lib/liblcms.so" \
"$_fromroot/lib/libsplashscreen.so" \
"$_toroot/lib"
}
_src() {
pkgdesc="Oracle OpenJDK 22 (sources)"
depends="$pkgname-jre-headless"
mkdir -p "$subpkgdir/$_java_home"/lib
mv "$pkgdir"/$_java_home/lib/src.zip \
"$subpkgdir"/$_java_home/lib/
}
_static_libs() {
pkgdesc="Oracle OpenJDK 22 libraries for static linking"
provides="java-jdk-static-libs"
depends="$pkgname=$pkgver-r$pkgrel"
amove $_java_home/lib/static
}
_jre_headless() {
pkgdesc="Oracle OpenJDK 22 (JRE headless)"
depends="java-common java-cacerts"
provides=java-jre-headless
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/lib" "$_toroot"
# ct.sym should stay in -jdk
mkdir "$_fromroot/lib"
mv "$_toroot/lib/ct.sym" "$_fromroot/lib"
mkdir -p "$_toroot/bin"
for i in java \
jfr \
jrunscript \
jwebserver \
keytool \
rmiregistry; do
mv "$_fromroot/bin/$i" "$_toroot/bin/$i"
done
mv "$_fromroot/legal" "$_toroot"
mv "$_fromroot/conf" "$_toroot"
mv "$_fromroot/release" "$_toroot"
cp "$builddir/ASSEMBLY_EXCEPTION" "$_toroot"
cp "$builddir/LICENSE" "$_toroot"
cp "$builddir/README.md" "$_toroot"
# symlink to shared cacerts store
rm "$_toroot/lib/security/cacerts"
ln -sf /etc/ssl/certs/java/cacerts \
"$_toroot/lib/security/cacerts"
# symlink for java-common to work (expects jre in $_java_home/jre)
ln -sf . "$_toroot/jre"
}
_jdk() {
pkgdesc="Oracle OpenJDK 22 (JDK)"
depends="$pkgname-jre $pkgname-jmods"
provides=java-jdk
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/bin" "$_toroot"
mv "$_fromroot/lib" "$_toroot"
mv "$_fromroot/include" "$_toroot"
}
sha512sums="
81df3fcc20105fe5b4df820566925b6b1abc0dba1875c214738767e5cda12d8faeab7d2854ecee9d91402b660c9de93814e83f4192ad837cd2aa8e162b4ac06d jdk-22.0.1-ga.tar.gz
765c326ccc1b87a01027385e69238266e356361cd4ee3e18e3c9d137a5d11fa5d657c164d02dd1be8fe693c8e10f2b580588dbfa57d27f070e2750f50d3e662c gtest-1.14.0.tar.gz
df49e32ddc56393869e792ae8347bfd63f29515e6aea94aabbc1e05d9e7c4d9e035d794c8dd031fc39627b0e07830927cb3e498ff6278932f6724c5ac6bb51eb ppc64le.patch
73c8aeb77e2b1f105c62d1739a19f973cb34a16380fbff142605ee7e93cbc388613fa693d96b779ce73e82cd5fc4e46ffb09c3e3a522a8d459088dd47388ac23 riscv64.patch
403862d6e6919f40d705c59463e9d6ecc5ac5b3f95e107a7e91f84d64068176e4abe7b63f15ba8fc9b4ab2f1ab58f3a489e07716e4c370356e40c2699e870b4f JDK-8299245_disable-tests.patch
66f9d80d189ee2cd3658a5d4f744247731ee2659c3bae2f3e8e4ca29d834170aa265b7db9376d80c3050d10defc8247c2d8ed690d06707fe86691a6c2066c320 JDK-8218814_Wformat-security.patch
"

View File

@ -0,0 +1,17 @@
Author: Simon Frankenberger <simon-alpine@fraho.eu>
Subject: Fix compilation of jtreg / gtest objects with -Werror=format-security CFLAGS
Upstream: Yes / closed unresolved (https://bugs.openjdk.org/browse/JDK-8218814)
Remove the -Wno-format CLFAG for test objects
--- old/make/common/TestFilesCompilation.gmk
+++ new/make/common/TestFilesCompilation.gmk
@@ -100,7 +100,7 @@
CFLAGS := $$($1_BASE_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
CXXFLAGS := $$($1_BASE_CXXFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$(name)), \
- DISABLED_WARNINGS_gcc := format undef unused-function unused-value, \
+ DISABLED_WARNINGS_gcc := undef unused-function unused-value, \
DISABLED_WARNINGS_clang := undef format-nonliteral \
missing-field-initializers sometimes-uninitialized, \
LIBS := $$($1_LIBS_$$(name)), \

View File

@ -0,0 +1,53 @@
Author: Simon Frankenberger <simon-alpine@fraho.eu>
Subject: Disable failing tests
Upstream: Yes (https://bugs.openjdk.org/browse/JDK-8299245)
"Some gtests do not work well in non-debug build"
Disable failing tests as workaround
--- old/test/hotspot/gtest/runtime/test_os_linux.cpp
+++ new/test/hotspot/gtest/runtime/test_os_linux.cpp
@@ -439,6 +439,7 @@
#if !defined(__clang_major__) || (__clang_major__ >= 5) // DWARF does not support Clang versions older than 5.0.
// Test valid address of method ReportJNIFatalError in jniCheck.hpp. We should get "jniCheck.hpp" in the buffer and a valid line number.
+#if 0
TEST_VM(os_linux, decoder_get_source_info_valid) {
char buf[128] = "";
int line = -1;
@@ -447,6 +448,7 @@
ASSERT_TRUE(strcmp(buf, "jniCheck.hpp") == 0);
ASSERT_TRUE(line > 0);
}
+#endif
// Test invalid addresses. Should not cause harm and output buffer and line must contain "" and -1, respectively.
TEST_VM(os_linux, decoder_get_source_info_invalid) {
@@ -466,6 +468,7 @@
// Test with valid address but a too small buffer to store the entire filename. Should find generic <OVERFLOW> message
// and a valid line number.
+#if 0
TEST_VM(os_linux, decoder_get_source_info_valid_overflow) {
char buf[11] = "";
int line = -1;
@@ -474,9 +477,11 @@
ASSERT_TRUE(strcmp(buf, "<OVERFLOW>") == 0);
ASSERT_TRUE(line > 0);
}
+#endif
// Test with valid address but a too small buffer that can neither store the entire filename nor the generic <OVERFLOW>
// message. We should find "L" as filename and a valid line number.
+#if 0
TEST_VM(os_linux, decoder_get_source_info_valid_overflow_minimal) {
char buf[2] = "";
int line = -1;
@@ -485,6 +490,7 @@
ASSERT_TRUE(strcmp(buf, "L") == 0); // Overflow message does not fit, so we fall back to "L:line_number"
ASSERT_TRUE(line > 0); // Line should correctly be found and returned
}
+#endif
#endif // clang
#ifdef __GLIBC__

View File

@ -0,0 +1,226 @@
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.
diff -ru old/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp new/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
--- 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
diff -ru old/src/hotspot/cpu/ppc/vm_version_ppc.cpp new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
--- old/src/hotspot/cpu/ppc/vm_version_ppc.cpp
+++ new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
@@ -53,6 +53,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;
diff -ru old/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp new/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp
--- old/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp
@@ -28,6 +28,10 @@
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.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");
@@ -58,14 +62,22 @@
// if we were running Java code when SIGPROF came in.
if (isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address pc = (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ address pc = (address)uc->uc_mcontext.gp_regs[PT_NIP];
+#endif
if (pc == nullptr) {
// ucontext wasn't useful
return false;
}
+#if defined(__GLIBC__) || defined(__UCLIBC__)
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/], pc);
+#else // Musl
+ frame ret_frame((intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/], pc);
+#endif
if (ret_frame.fp() == nullptr) {
// The found frame does not have a valid frame pointer.
@@ -84,7 +96,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());
diff -ru old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
--- old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -78,6 +78,10 @@
# include <poll.h>
# include <ucontext.h>
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
address os::current_stack_pointer() {
return (address)__builtin_frame_address(0);
@@ -105,24 +109,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 != nullptr, "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 != nullptr, "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) {
@@ -130,7 +152,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,
@@ -196,7 +222,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");
@@ -452,6 +482,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);
@@ -460,6 +491,16 @@
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();
}
@@ -495,17 +536,33 @@
continuation = n + 1;
switch (n) {
case 0:
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->nip);
+#else // Musl
+ st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_NIP]);
+#endif
break;
case 1:
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->link);
+#else // Musl
+ st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_LNK]);
+#endif
break;
case 2:
+#if defined(__GLIBC__) || defined(__UCLIBC__)
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_CTR]);
+#endif
break;
default:
st->print("r%-2d=", n-3);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, (intptr_t)uc->uc_mcontext.regs->gpr[n-3]);
+#else // Musl
+ print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[n-3]);
+#endif
break;
}
++n;

View File

@ -0,0 +1,17 @@
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_riscv/os_linux_riscv.cpp
+++ new/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp
@@ -56,7 +56,6 @@
// put OS-includes here
# include <dlfcn.h>
-# include <fpu_control.h>
# include <errno.h>
# include <pthread.h>
# include <signal.h>