mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-12 18:59:50 +03:00
testing/openjdk24: new aport
This commit is contained in:
parent
ec112c6d3e
commit
f303c09081
5 changed files with 635 additions and 0 deletions
321
testing/openjdk24/APKBUILD
Normal file
321
testing/openjdk24/APKBUILD
Normal file
|
@ -0,0 +1,321 @@
|
|||
# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
|
||||
# Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
|
||||
pkgname=openjdk24
|
||||
pkgver=24.0.1_p9
|
||||
_pkgver=${pkgver%_p*}-ga
|
||||
pkgrel=0
|
||||
pkgdesc="Oracle OpenJDK 24"
|
||||
provider_priority=24
|
||||
url="https://github.com/openjdk/jdk24u"
|
||||
# oracle dropped support for 32 bit
|
||||
arch="all !x86 !armhf !armv7"
|
||||
license="GPL-2.0-with-classpath-exception"
|
||||
makedepends="
|
||||
openjdk23-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"
|
||||
subpackages="$pkgname-jmods:_jmods:noarch
|
||||
$pkgname-demos:_demos:noarch
|
||||
$pkgname-jre:_jre
|
||||
$pkgname-src:_src:noarch
|
||||
$pkgname-static-libs:_static_libs
|
||||
$pkgname-jre-headless:_jre_headless
|
||||
$pkgname-jdk:_jdk
|
||||
$pkgname-doc:_doc
|
||||
"
|
||||
source="jdk-$_pkgver.tar.gz::https://github.com/openjdk/jdk24u/archive/jdk-$_pkgver.tar.gz
|
||||
gtest-1.14.0.tar.gz::https://github.com/google/googletest/archive/v1.14.0.tar.gz
|
||||
docs-$_pkgver.tgz::https://github.com/bratkartoffel/openjdk-docs/raw/refs/heads/main/$pkgname-$pkgver-doc.tgz?download=
|
||||
|
||||
ppc64le.patch
|
||||
riscv64.patch
|
||||
JDK-8299245_disable-tests.patch
|
||||
JDK-8218814_Wformat-security.patch
|
||||
"
|
||||
builddir="$srcdir/jdk24u-jdk-${_pkgver/+/-}"
|
||||
|
||||
provides="$pkgname-bootstrap=$pkgver-r$pkgrel"
|
||||
|
||||
_java_home="/usr/lib/jvm/java-24-openjdk"
|
||||
|
||||
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
|
||||
|
||||
# just build the documentation?
|
||||
# the docs require pandoc-cli which is available just on a few archs.
|
||||
# this variable controls to build them locally, so i can upload them to
|
||||
# github afterwards
|
||||
# see https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/81985
|
||||
_build_doc=${_build_doc:-0}
|
||||
if [ "$_build_doc" -ne 0 ]; then
|
||||
makedepends="$makedepends pandoc-cli"
|
||||
subpackages="$subpackages $pkgname-doc:_doc"
|
||||
fi
|
||||
|
||||
# some archs do not support the server jvm variant
|
||||
_jvm_variants=server
|
||||
case $CTARGET_ARCH in
|
||||
loongarch64) _jvm_variants=zero ;;
|
||||
esac
|
||||
ldpath="$_java_home/lib:$_java_home/lib/$_jvm_variants"
|
||||
|
||||
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=$_jvm_variants \
|
||||
--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"
|
||||
|
||||
if [ "$_build_doc" -ne 1 ]; then
|
||||
MAKEFLAGS='' make jdk-image
|
||||
MAKEFLAGS='' make static-libs-image
|
||||
else
|
||||
MAKEFLAGS='' make docs
|
||||
cd build/linux-x86_64-server-release/images
|
||||
tar -czf $srcdir/$pkgname-$pkgver-doc.tgz docs/
|
||||
# abort the build, we just wanted to generate the docs locally
|
||||
false
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
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-*-$_jvm_variants-release/images/
|
||||
cp -r jdk/* "$pkgdir/$_java_home"
|
||||
cp -r static-libs/lib/* "$pkgdir/$_java_home/$libstaticdir"
|
||||
}
|
||||
|
||||
_jmods() {
|
||||
pkgdesc="Oracle OpenJDK 24 (jmods)"
|
||||
depends=""
|
||||
_fromroot="$pkgdir/$_java_home"
|
||||
_toroot="$subpkgdir/$_java_home"
|
||||
|
||||
mkdir -p "$_toroot"
|
||||
mv "$_fromroot/jmods" "$_toroot"
|
||||
}
|
||||
|
||||
_demos() {
|
||||
pkgdesc="Oracle OpenJDK 24 (demos)"
|
||||
depends=""
|
||||
_fromroot="$pkgdir/$_java_home"
|
||||
_toroot="$subpkgdir/$_java_home"
|
||||
|
||||
mkdir -p "$_toroot"
|
||||
mv "$_fromroot/demo" "$_toroot"
|
||||
}
|
||||
|
||||
_doc() {
|
||||
pkgdesc="Oracle OpenJDK 24 (Documentation)"
|
||||
depends=""
|
||||
_toroot="$subpkgdir/$_java_home"
|
||||
|
||||
mkdir -p "$_toroot"
|
||||
mv "$srcdir/docs" "$_toroot"
|
||||
}
|
||||
|
||||
_jre() {
|
||||
pkgdesc="Oracle OpenJDK 24 (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 24 (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 24 libraries for static linking"
|
||||
provides="java-jdk-static-libs"
|
||||
depends="$pkgname=$pkgver-r$pkgrel"
|
||||
|
||||
amove $_java_home/lib/static
|
||||
}
|
||||
|
||||
_jre_headless() {
|
||||
pkgdesc="Oracle OpenJDK 24 (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 24 (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="
|
||||
d564962b93a73ba8a203428f5e4c181ad910422021e65af57626eb85def2fd335893cad60cb28992c094cdebbfc6722a8bc6f48965774d6fbda10f415562d193 jdk-24.0.1-ga.tar.gz
|
||||
765c326ccc1b87a01027385e69238266e356361cd4ee3e18e3c9d137a5d11fa5d657c164d02dd1be8fe693c8e10f2b580588dbfa57d27f070e2750f50d3e662c gtest-1.14.0.tar.gz
|
||||
eb461d0835900a4ba20d8076137c2d676ca67e69b36389a923a8020d61360d543d93f0bd15284d91b62a0cb98fd16ba064418d4e922ee2aaafbb8cb5dcfc2d81 docs-24.0.1-ga.tgz
|
||||
8df458f439fc8b66e571cfee91ae6837d23fd25c386f2dbcddc8264e435eb3b15830fe779a9fca80c60dbf3a01ef63ca93efa614684ef9206286c6948a3232f2 ppc64le.patch
|
||||
73c8aeb77e2b1f105c62d1739a19f973cb34a16380fbff142605ee7e93cbc388613fa693d96b779ce73e82cd5fc4e46ffb09c3e3a522a8d459088dd47388ac23 riscv64.patch
|
||||
cc93616bf70e12775be9132fe58ff641e805af6851b159d7022347bcef86f2597c0dc33acc0ae7ea4e6ea56f2155f0aa73e6b541c8783490897fe7665c5cd9ab JDK-8299245_disable-tests.patch
|
||||
ba5ef8a82aea2300a32a2dcdf3b7298440263312ac9371f563935a074f3aa302d51af59f638c132c43cb02c2bfb54311c0284b613f1672d1c20c1c959a1c52ef JDK-8218814_Wformat-security.patch
|
||||
"
|
18
testing/openjdk24/JDK-8218814_Wformat-security.patch
Normal file
18
testing/openjdk24/JDK-8218814_Wformat-security.patch
Normal file
|
@ -0,0 +1,18 @@
|
|||
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
|
||||
|
||||
diff -ru old/make/common/TestFilesCompilation.gmk new/make/common/TestFilesCompilation.gmk
|
||||
--- old/make/common/TestFilesCompilation.gmk
|
||||
+++ new/make/common/TestFilesCompilation.gmk
|
||||
@@ -112,7 +112,7 @@
|
||||
CXXFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
|
||||
LD_SET_ORIGIN := $$($1_LD_SET_ORIGIN), \
|
||||
LDFLAGS := $$($1_LDFLAGS_$$(name)), \
|
||||
- DISABLED_WARNINGS_gcc := format undef unused-but-set-variable \
|
||||
+ DISABLED_WARNINGS_gcc := undef unused-but-set-variable \
|
||||
unused-const-variable unused-function unused-value \
|
||||
unused-variable, \
|
||||
DISABLED_WARNINGS_clang := format-nonliteral \
|
53
testing/openjdk24/JDK-8299245_disable-tests.patch
Normal file
53
testing/openjdk24/JDK-8299245_disable-tests.patch
Normal 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
|
||||
@@ -396,6 +396,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;
|
||||
@@ -404,6 +405,7 @@
|
||||
EXPECT_STREQ(buf, "jniCheck.hpp");
|
||||
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) {
|
||||
@@ -423,6 +425,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;
|
||||
@@ -431,9 +434,11 @@
|
||||
EXPECT_STREQ(buf, "<OVERFLOW>");
|
||||
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;
|
||||
@@ -442,6 +447,7 @@
|
||||
EXPECT_STREQ(buf, "L"); // 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__
|
226
testing/openjdk24/ppc64le.patch
Normal file
226
testing/openjdk24/ppc64le.patch
Normal 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.
|
||||
|
||||
--- old/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
|
||||
+++ new/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
|
||||
@@ -51,6 +51,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
|
||||
--- old/src/hotspot/cpu/ppc/vm_version_ppc.cpp
|
||||
+++ new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
|
||||
@@ -45,6 +45,10 @@
|
||||
#include <libperfstat.h>
|
||||
#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;
|
||||
|
||||
--- 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");
|
||||
|
||||
@@ -59,7 +63,11 @@
|
||||
// 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
|
||||
@@ -67,7 +75,11 @@
|
||||
}
|
||||
|
||||
// pc could refer to a native address outside the code cache even though the thread isInJava.
|
||||
+#if defined(__GLIBC__) || defined(__UCLIBC__)
|
||||
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/], pc, frame::kind::unknown);
|
||||
+#else // Musl
|
||||
+ frame ret_frame((intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/], pc, frame::kind::unknown);
|
||||
+#endif
|
||||
|
||||
if (ret_frame.fp() == nullptr) {
|
||||
// The found frame does not have a valid frame pointer.
|
||||
@@ -86,7 +98,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());
|
||||
--- old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
|
||||
+++ new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
|
||||
@@ -77,7 +77,11 @@
|
||||
# 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);
|
||||
}
|
||||
@@ -104,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.
|
||||
// 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) {
|
||||
@@ -129,7 +151,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,
|
||||
@@ -195,7 +221,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");
|
||||
@@ -449,6 +479,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);
|
||||
@@ -457,8 +488,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();
|
||||
}
|
||||
|
||||
void os::print_tos_pc(outputStream *st, const void *context) {
|
||||
@@ -492,17 +533,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;
|
17
testing/openjdk24/riscv64.patch
Normal file
17
testing/openjdk24/riscv64.patch
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue