This commit is contained in:
build@apk-groulx 2021-07-14 03:56:39 +00:00
parent 6aafd284c0
commit 2f099a9745
87 changed files with 6944 additions and 153 deletions

18
.gitignore vendored
View file

@ -1,3 +1,17 @@
*.apk
*.gz
*.tgz
*.bz2
*.tbz2
*.zip
*.tags
*.xz
*.part
*.tar
*.tar.gz
*.tar.xz
src
pkg
pkg-*
build.log
core
!core/
.vscode/

View file

@ -0,0 +1,18 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=craftbukkit-plugin-customtime
pkgver=2.0
pkgrel=0
pkgdesc="CustomTime is a simple plugin used to control the day/night cycle. You can speed up or slow down time any way you like."
options=!check
arch='noarch'
url="https://dev.bukkit.org/projects/customtime"
license="CC-BY-NC-4.0"
depends="craftbukkit>=1.16.1 craftbukkit<=1.17.1"
source="${pkgname}-${pkgver}.jar::https://media.forgecdn.net/files/3002/701/CustomTime-${pkgver}.jar"
noextract="${pkgname}-${pkgver}.jar"
package() {
install -Dm644 "${srcdir}"/${pkgname}-${pkgver}.jar "$pkgdir/var/lib/craftbukkit/plugins/CustomTime.jar"
chown craftbukkit:craftbukkit "$pkgdir"/var/lib/craftbukkit/plugins/CustomTime.jar
}
sha512sums="f8e2202b3cff635223d90a783d655fc04b468bf1c5e351a132dd39182322bf12381b158646d0f264237e6a33a9cb0c81e1fc8bffe01a21dc51f9edb7546f53ea craftbukkit-plugin-customtime-2.0.jar"

View file

@ -0,0 +1,19 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=craftbukkit-plugin-dynmap
pkgver=3.2
_pkgver=${pkgver}-beta-2
pkgrel=0
pkgdesc="A Google Maps-like map for your Minecraft server that can be viewed in a browser"
options=!check
arch='noarch'
url="https://github.com/webbukkit/dynmap"
license="AGPL-2.0"
depends="craftbukkit>=1.16.1 craftbukkit<=1.17.1"
source="${pkgname}-${_pkgver}.jar::https://dynmap.us/releases/Dynmap-${_pkgver}-spigot.jar"
noextract="${pkgname}-${_pkgver}.jar"
package() {
install -Dm644 "${srcdir}"/${pkgname}-${_pkgver}.jar "$pkgdir/var/lib/craftbukkit/plugins/dynmap.jar"
chown craftbukkit:craftbukkit "$pkgdir"/var/lib/craftbukkit/plugins/dynmap.jar
}
sha512sums="4611a17fdd552177e8a3f39cf0bce1fe49dc0c9881426e64f88904d7293309a9dbfc15b4f550b0367aa9aeb025309a85818ebe9fae360e8768bf5684958f158b craftbukkit-plugin-dynmap-3.2-beta-2.jar"

View file

@ -0,0 +1,103 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=craftbukkit-plugin-essentialx
_pkgver=2.19.0
_buildver=204
_buildcommit=0b6b0f9
pkgver=$_pkgver.$_buildver
pkgrel=0
pkgdesc="EssentialsX is the essential plugin suite for Minecraft servers, with over 130 commands for servers of all size and scale."
options=!check
arch='noarch'
url="https://essentialsx.net/"
license="GPL-3.0"
depends="craftbukkit>=1.8.8 craftbukkit<=1.17.1"
source="
https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsX-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsXChat-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsXSpawn-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsXAntiBuild-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsXDiscord-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsXGeoIP-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsXProtect-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsXXMPP-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
"
noextract="
EssentialsXChat-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
EssentialsXSpawn-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
EssentialsXAntiBuild-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
EssentialsXDiscord-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
EssentialsXGeoIP-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
EssentialsXProtect-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
EssentialsXMPP-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar
"
subpackages="${pkgname}-core ${pkgname}-chat ${pkgname}-spawn ${pkgname}-antibuild ${pkgname}-discord ${pkgname}-geo ${pkgname}-protect ${pkgname}-xmpp"
package() {
mkdir -p "${pkgdir}"
}
core() {
pkgdesc="Core functionality: teleports, private messages, homes, warps and more"
install -Dm644 "${srcdir}"/EssentialsX-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar "$subpkgdir/var/lib/craftbukkit/plugins/Essentials.jar"
chown craftbukkit:craftbukkit "$subpkgdir"/var/lib/craftbukkit/plugins/Essentials.jar
}
chat() {
pkgdesc="Chat formatting, local chat"
depends="${pkgname}-core"
install -Dm644 "${srcdir}"/EssentialsXChat-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar "$subpkgdir/var/lib/craftbukkit/plugins/EssentialsChat.jar"
chown craftbukkit:craftbukkit "$subpkgdir"/var/lib/craftbukkit/plugins/EssentialsChat.jar
}
spawn() {
pkgdesc="Spawnpoint control, per-player spawns"
depends="${pkgname}-core"
install -Dm644 "${srcdir}"/EssentialsXSpawn-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar "$subpkgdir/var/lib/craftbukkit/plugins/EssentialsSpawn.jar"
chown craftbukkit:craftbukkit "$subpkgdir"/var/lib/craftbukkit/plugins/EssentialsSpawn.jar
}
antibuild() {
pkgdesc="Simple permissions-based building control"
depends="${pkgname}-core"
install -Dm644 "${srcdir}"/EssentialsXAntiBuild-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar "$subpkgdir/var/lib/craftbukkit/plugins/EssentialsAntiBuild.jar"
chown craftbukkit:craftbukkit "$subpkgdir"/var/lib/craftbukkit/plugins/EssentialsAntiBuild.jar
}
discord() {
pkgdesc="Lightweight chat, messaging and command integration with Discord"
depends="${pkgname}-core"
install -Dm644 "${srcdir}"/EssentialsXDiscord-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar "$subpkgdir/var/lib/craftbukkit/plugins/EssentialsDiscord.jar"
chown craftbukkit:craftbukkit "$subpkgdir"/var/lib/craftbukkit/plugins/EssentialsDiscord.jar
}
geo() {
pkgdesc="Geographical player lookup (formerly EssentialsX GeoIP)"
depends="${pkgname}-core"
install -Dm644 "${srcdir}"/EssentialsXGeoIP-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar "$subpkgdir/var/lib/craftbukkit/plugins/EssentialsGeo.jar"
chown craftbukkit:craftbukkit "$subpkgdir"/var/lib/craftbukkit/plugins/EssentialsGeo.jar
}
protect() {
pkgdesc="Configurable world protection and control"
depends="${pkgname}-core"
install -Dm644 "${srcdir}"/EssentialsXProtect-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar "$subpkgdir/var/lib/craftbukkit/plugins/EssentialsProtect.jar"
chown craftbukkit:craftbukkit "$subpkgdir"/var/lib/craftbukkit/plugins/EssentialsProtect.jar
}
xmpp() {
pkgdesc="Lightweight chat, messaging and server log integration with Jabber/XMPP services"
depends="${pkgname}-core"
install -Dm644 "${srcdir}"/EssentialsXXMPP-${_pkgver}-dev+${_buildver}-${_buildcommit}.jar "$subpkgdir/var/lib/craftbukkit/plugins/EssentialsXMPP.jar"
chown craftbukkit:craftbukkit "$subpkgdir"/var/lib/craftbukkit/plugins/EssentialsXMPP.jar
}
sha512sums="44f49dd9c49641851412c3ec885686620a8c275c222e9ee7077f0d552fef25110a5eead208e38e2ff7b4d6293bdbc161639af38c4e4f58bf84c3a937dab1901f EssentialsX-2.19.0-dev+204-0b6b0f9.jar
6041839f3defc75bc3bf9f8946a81c6235ec261ce10cf7e639a1036e917b67776c21f86dc99881d2e35b6a11bdedc1b48195975cb040bff975f673a1e89cb8d9 EssentialsXChat-2.19.0-dev+204-0b6b0f9.jar
430589e71fa7bed7a09af8eb048e5f5687072f4d1d97b0fdfca4a174465c0a4ef946a5d08ff0d5f7adc34b0bd7c28b6ffb19371a420afd9fdb257b0192b60447 EssentialsXSpawn-2.19.0-dev+204-0b6b0f9.jar
7fdce5d00bee73b22478560b86e7ff30014eb471bdc04fabec048f619ea636fa244af600ca5d9b902f4c17306e30e544e6e096efc5618675282bb1d2b8dfcad5 EssentialsXAntiBuild-2.19.0-dev+204-0b6b0f9.jar
c222a677428b75dac73ff37038d40dcdacb29b9ead383d2135aabc5bad0193b1fd027d8883b22aa99be48876841463ced4f769da0fd563ff191e10c4dfb4761f EssentialsXDiscord-2.19.0-dev+204-0b6b0f9.jar
8f491358e99a982a3f951f87706bdcbdb428bac5a8b0eaf5afd61433b82d58fb2ede29814dd9ffbaeda5fedb07ae84c7b2ba472bc9ef904b43ee7503e87bc275 EssentialsXGeoIP-2.19.0-dev+204-0b6b0f9.jar
2b0a20927538fa3b3ed20f0881256c26173829657b6dc81870497ed74b6a2f39af1bee84420490e06f80b7ec7db2e90f3a747d924b26107063170e04b5b861de EssentialsXProtect-2.19.0-dev+204-0b6b0f9.jar
d78696934a69433cdbcd12fd69653c69d6bde13008bff4ed51446622b183c7ce9b458b9bd20331ad7092e74ca39adf699022ddd2c64829b7c9474e3c78f86869 EssentialsXXMPP-2.19.0-dev+204-0b6b0f9.jar"

View file

@ -0,0 +1,27 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=craftbukkit-plugin-fastchunkpregenerator
pkgver=2.0.6
pkgrel=0
pkgdesc="This plugin can be used to pregenerate as many chunks on as many worlds as you want"
options=!check
arch='noarch'
url="https://www.spigotmc.org/resources/fast-chunk-pregenerator.74429"
license="custom"
depends="craftbukkit>=1.16.0 craftbukkit<=1.17.1"
source="${pkgname}-${pkgver}.jar::https://www.spigotmc.org/resources/fast-chunk-pregenerator.74429/download?version=386817"
noextract="${pkgname}-${pkgver}.jar"
package() {
install -Dm644 "${srcdir}"/${pkgname}-${pkgver}.jar "$pkgdir/var/lib/craftbukkit/plugins/FastChunkPregenerator.jar"
chown craftbukkit:craftbukkit "$pkgdir"/var/lib/craftbukkit/plugins/FastChunkPregenerator.jar
}
uri_fetch() {
local uri="$1"
mkdir -p "$SRCDEST"
echo "$SRCDEST/FastChunkPregenerator-2.0.6-SNAPSHOT.jar"
msg "Fetching $uri"
local uri=$(echo ${uri} | sed 's|.*::||')
curl --header 'Host: www.spigotmc.org' --user-agent 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' --header 'Accept-Language: en-US,en;q=0.5' --referer 'https://www.spigotmc.org/resources/fast-chunk-pregenerator.74429/update?update=390814&__cf_chl_jschl_tk__=d120053760ff17301f05c0e00cd2c75ad98162fa-1625889119-0-AaAmKmdxmwlQfZ2OcV9fpPqfmY33xuAHdWzSJYXcI6IkLa2QHXjU6wAus37F8oOqWtuEnTXqcclJ_p3tVnwopGcoS3yKUuxwJ07xLqB6VzBpbqe8hMtqnaizSZniDwEPmF0QwYn3x_TnPJWTNw6IXX1D6fsB8cv-Krzp6yEN6ff3LS8HmtRJll6QFRX6RKl4uI14FCpqaD39fcZFeAPz01MtlnhMSMZ7b3JTiic0_ETK_5M0mZIzkaSfHMe9d1j4OpkoKnGD4QHdtNFcWQdHtDLdakk9gYzZmP284k591Mqcou9-AyxMS_jbxeGnCOsp9aUnh1L89KBG9Vo_vN-XIgZ-Yn5ialg7YovdhYyMfnhHclWLB7RLNNZQDSBZEEmXNFZGwA857THjbbnQVbJKhVDa-Fe_PQ52AghR8DeRNui64pszyRKccLtM_V3tV7gjjFXDivZibIdDVAQlt-e4AbMlj-i6xI732y1jXafADHot' --cookie 'cf_chl_2=286326ecda2ecfb; cf_chl_prog=x8; cf_clearance=293f1dcd818bbef7fa6ce67fd01248a495f5a17a-1625889123-0-150; xf_session=c37fcf6ee6d64a85390e99fbd3ab0dee' --header 'Upgrade-Insecure-Requests: 1' "$uri" --output "$SRCDEST/${pkgname}-${pkgver}.jar"
}
sha512sums="0ff0e4a41058e81786f08f9468bd2018a32d0d047c6bd25842445694766629eb1b6a51433f1525d51a5093972499725b505e0a45820684ab1672a9059afd7aa1 craftbukkit-plugin-fastchunkpregenerator-2.0.6.jar"

View file

@ -0,0 +1,20 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=craftbukkit-plugin-luckperms
_pkgver=5.3.51
_buildver=1349
pkgver=$_pkgver.$_buildver
pkgrel=2
pkgdesc="An advanced permissions plugin for Bukkit/Spigot, BungeeCord and Sponge."
options=!check
arch='noarch'
url="https://github.com/lucko/LuckPerms"
license="MIT"
depends="craftbukkit>=1.8.8 craftbukkit<=1.17.1"
source="https://ci.lucko.me/job/LuckPerms/${_buildver}/artifact/bukkit/loader/build/libs/LuckPerms-Bukkit-${_pkgver}.jar"
noextract="LuckPerms-Bukkit-$_pkgver.jar"
package() {
install -Dm644 "${srcdir}"/LuckPerms-Bukkit-$_pkgver.jar "$pkgdir/var/lib/craftbukkit/plugins/LuckPerms.jar"
chown craftbukkit:craftbukkit "$pkgdir"/var/lib/craftbukkit/plugins/LuckPerms.jar
}
sha512sums="b3dc0c107464b490315d8b6376c3a5e37f9bf13602b5ab1ed85203d24b92298dc3201346c0aa406fe4832c7a785812b9e5cd3aa11a0dbda995525ddb5b659b6b LuckPerms-Bukkit-5.3.51.jar"

View file

@ -0,0 +1,18 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=craftbukkit-plugin-vault
pkgver=1.7.3
pkgrel=0
pkgdesc="Vault is a Permissions, Chat, & Economy API to give plugins easy hooks into these systems"
options=!check
arch='noarch'
url="https://github.com/MilkBowl/Vault"
license="GPL-3.0"
depends="craftbukkit>=1.13.2 craftbukkit<=1.17.1"
source="${pkgname}-${pkgver}.jar::https://github.com/MilkBowl/Vault/releases/download/${pkgver}/Vault.jar"
noextract="${pkgname}-${pkgver}.jar"
package() {
install -Dm644 "${srcdir}"/${pkgname}-${pkgver}.jar "$pkgdir/var/lib/craftbukkit/plugins/Vault.jar"
chown craftbukkit:craftbukkit "$pkgdir"/var/lib/craftbukkit/plugins/Vault.jar
}
sha512sums="aa02af3c9770249bda77b91058ce97240d4fd4cba3f07918534127acace297feb05445122b499c2623123dfde49670e9a763221e0f41ef03f51e6880ea8f6647 craftbukkit-plugin-vault-1.7.3.jar"

View file

@ -0,0 +1,19 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=craftbukkit-plugin-worldedit
pkgver=7.2.6
_pkgver=${pkgver}-beta-01
pkgrel=0
pkgdesc="WorldEdit is an easy-to-use in-game Minecraft map editor"
options=!check
arch='noarch'
url="https://media.forgecdn.net/files/3379/705/worldedit-bukkit-7.2.6-beta-01.jar"
license="GPL-3.0"
depends="craftbukkit>=1.13.2 craftbukkit<=1.17.1"
source="https://media.forgecdn.net/files/3379/705/worldedit-bukkit-${_pkgver}.jar"
noextract="worldedit-bukkit-${_pkgver}.jar"
package() {
install -Dm644 "${srcdir}"/worldedit-bukkit-${_pkgver}.jar "$pkgdir/var/lib/craftbukkit/plugins/WorldEdit.jar"
chown craftbukkit:craftbukkit $pkgdir/var/lib/craftbukkit/plugins/WorldEdit.jar
}
sha512sums="6c6fae144b672a578fde5bcf8e950a6b2dec70b559a44a4389d4847e54f5a1a9e6b9abe66318262df1766b5e53a622377a23310c40aaa9594f135d01e36cc708 worldedit-bukkit-7.2.6-beta-01.jar"

View file

@ -0,0 +1,19 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=craftbukkit-plugin-worldedit
pkgver=7.0.6
_pkgver=${pkgver}-beta1
pkgrel=0
pkgdesc="WorldGuard lets you and players guard areas of land against griefers and undesirables"
options=!check
arch='noarch'
url="https://dev.bukkit.org/projects/worldguard"
license="GPL-3.0"
depends="craftbukkit>=1.17.0 craftbukkit<=1.17.1"
source="https://media.forgecdn.net/files/3380/93/worldguard-bukkit-${_pkgver}-dist.jar"
noextract="worldguard-bukkit-${_pkgver}-dist.jar"
package() {
install -Dm644 "${srcdir}"/worldguard-bukkit-${_pkgver}-dist.jar "$pkgdir/var/lib/craftbukkit/plugins/WorldGuard.jar"
chown craftbukkit:craftbukkit $pkgdir/var/lib/craftbukkit/plugins/WorldGuard.jar
}
sha512sums="edef1e4c540fce2b3a7cf6f5e9b8fbb33668ab06e518e1522ac41cd425a6ba4a1cd67bd673624924a585ec61a556ac649ecc50557046af814e9ee1028f5fc4a2 worldguard-bukkit-7.0.6-beta1-dist.jar"

View file

@ -1,35 +0,0 @@
From 839ad29b16a8baf7b1470f13d7faa0ce941769b3 Mon Sep 17 00:00:00 2001
From: Jan Vorlicek <janvorli@microsoft.com>
Date: Mon, 30 Nov 2020 16:11:36 +0100
Subject: [PATCH] Fix build on Alpine edge (#45352)
The atoll definition in the pal.h was leaking into the PAL implementation and
on Alpine edge, the difference in throws() classification was causing a build
break.
---
src/coreclr/src/pal/src/include/pal/palinternal.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/coreclr/src/pal/src/include/pal/palinternal.h b/src/coreclr/src/pal/src/include/pal/palinternal.h
index e73720bec73..4ad42a03a13 100644
--- a/src/coreclr/src/pal/src/include/pal/palinternal.h
+++ b/src/coreclr/src/pal/src/include/pal/palinternal.h
@@ -170,6 +170,7 @@ function_name() to call the system's implementation
#define memset DUMMY_memset
#define memmove DUMMY_memmove
#define memchr DUMMY_memchr
+#define atoll DUMMY_atoll
#define strlen DUMMY_strlen
#define stricmp DUMMY_stricmp
#define strstr DUMMY_strstr
@@ -357,6 +358,7 @@ function_name() to call the system's implementation
#undef memset
#undef memmove
#undef memchr
+#undef atoll
#undef strlen
#undef strnlen
#undef wcsnlen
--
2.30.2

View file

@ -1,13 +1,15 @@
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Kristian Mosegaard <kristian@mosen.me>
# Contributor: Max Liebkies <mail@maxliebkies.de>
# Contributor: Krzysztof Bogacki <krzysztof.bogacki@leancode.pl>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Based on Archlinux PKGBUILD by:
# Maxime Gauduin <alucryd@archlinux.org>
# Kristian Mosegaard <kristian@mosen.me>
# Max Liebkies <mail@maxliebkies.de>
# Krzysztof Bogacki <krzysztof.bogacki@leancode.pl>
pkgname=dotnet
pkgdesc='The .NET Core SDK'
pkgver=5.0.6
pkgrel=1
pkgver=5.0.7
pkgrel=0
arch='x86_64'
url=https://www.microsoft.com/net/core
license='MIT'
@ -19,6 +21,8 @@ makedepends='
icu-dev
inetutils-syslogd
krb5-dev
dotnet-sdk
dotnet-runtime
libgit2-dev
libunwind-dev
libxml2-dev
@ -40,75 +44,89 @@ makedepends='
# libstdc++zlib
#'
subpackages="$pkgname-sdk:sdk $pkgname-host:host $pkgname-runtime:runtime aspnet-runtime:aspnet_runtime:noarch netstandard-targeting-pack:netstandard_targeting_pack:noarch $pkgname-targeting-pack:targeting_pack aspnet-targeting-pack:aspnet_targeting_pack:noarch"
_gittag=a8f12771179965da9f48646ded87068d379563b9
_gittag=v${pkgver}-runtime
_giturl=https://github.com/dotnet/source-build
source="
$pkgname-$pkgver.tar.gz
dotnet.sh
9999-runtime-link-order.patch
9999-sdk-telemetry-optout.patch
9999-Fix-build-on-Alpine-edge-45352.patch
9999-Fix-last-version-digit-present-on-alpine-non-portable.patch
9999-Fixed-problematic-version-of-ApplicationInsights-dot.patch
9999-fixed-net40-location.patch
$pkgname-$pkgver.git.zip
https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
dotnet.sh
runtime_link-order.patch
runtime_alpine-non-portable-rid-fix.patch
sdk_telemetry-optout.patch
applications-insights_fix-net40-location.patch
build_applicationinsights-alternative-source.patch
"
builddir="$srcdir/$pkgname"
snapshot() {
mkdir -p "$srcdir"
cd "${srcdir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
else
cd $pkgname.git
git fetch || return 1
fi
mkdir -p "$srcdir"
cd "${srcdir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
else
cd $pkgname.git
git fetch || return 1
fi
echo "Checking out"
git checkout $_gittag
echo "Repo archive"
git archive --prefix="$pkgname/" -o $pkgname.tar --format "tar" $_gittag
echo "Repo archive"
mkfifo $pkgname-$pkgver.git
git bundle create - $_gittag > $pkgname-$pkgver.git &
zip --fifo "${SRCDEST}"/$pkgname-$pkgver.git.zip $pkgname-$pkgver.git
rm $pkgname-$pkgver.git
gzip $pkgname.tar -c > "$SRCDEST"/$pkgname-$pkgver.tar.gz
ln -s "$SRCDEST"/$pkgname-$pkgver.tar.gz "$startdir"/$pkgname-$pkgver.tar.gz
ln -s "$SRCDEST"/$pkgname-$pkgver.git.zip "$startdir"/$pkgname-$pkgver.git.zip
}
unpack() {
default_unpack
cd "${srcdir}"
git clone $pkgname-$pkgver.git $pkgname --branch $_gittag 1>/dev/null 2>&1
}
prepare() {
cd "${builddir}"
msg "Settings up dotnet bootstrap"
mkdir runtime
mkdir bootstrap
local i failed=
[ -n "$builddir" -a -d "$builddir" ] && cd "$builddir"
bash $srcdir/dotnet-install.sh -c Current --install-dir ./
bash $srcdir/dotnet-install.sh -c 3.1 --install-dir . --runtime dotnet
patch -p1 < "${srcdir}"/9999-Fixed-problematic-version-of-ApplicationInsights-dot.patch
[ -d patches/runtime ] || mkdir patches/runtime
cp "$srcdir"/9999-runtime-link-order.patch patches/runtime/.
cp "$srcdir"/9999-Fix-build-on-Alpine-edge-45352.patch patches/runtime/.
cp "$srcdir"/9999-Fix-last-version-digit-present-on-alpine-non-portable.patch patches/runtime/.
[ -d patches/sdk ] || mkdir patches/sdk
cp "$srcdir"/9999-sdk-telemetry-optout.patch patches/sdk/.
[ -d patches/application-insights ] || mkdir patches/application-insights
cp "$srcdir"/9999-fixed-net40-location.patch patches/application-insights/.
msg "Settings up bootstrap SDK"
eng/common/dotnet-install.sh -runtime dotnet -version 3.1.1
bash .dotnet/dotnet-install.sh -c Current --install-dir ./
bash .dotnet/dotnet-install.sh -c 3.1 --install-dir . --runtime dotnet
# disable warnings
sed -i 's|skiptests|skiptests ignorewarnings|' repos/runtime.common.props
export SOURCE_BUILD_SKIP_SUBMODULE_CHECK=1
# To simulate git directory for DARC
mkdir -p .git/objects .git/refs
echo "${_gittag}" > .git/HEAD
touch .git/patched-refs .git/index
# TODO Why does /var/build/build/apk/v3.13/main/dotnet-sdk/src/dotnet/artifacts/src/sdk.b8025906f7463b6e477893c81238dc7003b353a3/artifacts/bin/redist/Release/dotnet/artifacts/src/sdk.b8025906f7463b6e477893c81238dc7003b353a3/artifacts/bin/redist/Release/dotnet/artifacts/src/ApplicationInsights-dotnet.53b80940842204f78708a538628288ff5d741a1d/src/Core/Managed/Net40/Utils.cs not appear? It's in Shared, though.
# cp Shared/* net45/. -R
# cp Shared/* netstandard1.3/. -R
if ! have_patches; then
return 0
fi
[ -d "$builddir" ] || { error "Is \$builddir set correctly?"; return 1; }
msg "Deploying patches"
for i in $source; do
case ${i%::*} in
build_*.patch)
patch ${patch_args:--p1} -i "$srcdir/$(filename_from_uri $i)" || failed="$failed $i"
;;
*.patch)
local _package=$(echo ${i} | sed 's|_.*||')
local _patch=$(echo ${i} | sed "s|${_package}_||")
echo "cp $_patch -> $_package"
[ -d patches/$_package ] || mkdir patches/$_package
cp "$srcdir"/"$i" patches/${_package}/${_patch}
;;
esac
done
if [ -z "$failed" ]; then
return 0
fi
error "The following patches failed to apply:"
for i in $failed; do
printf " %s\n" "$i"
done
return 1
}
pkgver() {
@ -121,10 +139,8 @@ pkgver() {
}
build() {
cd "$builddir"
export SOURCE_BUILD_SKIP_SUBMODULE_CHECK=1
cd "${builddir}"
msg "Building $pkgname-$pkgver"
./build.sh \
--with-sdk ../dotnet \
/p:ArchiveDownloadedPackages=true \
@ -255,12 +271,11 @@ aspnet_targeting_pack() {
}
# vim: ts=2 sw=2 et:
sha512sums="c53a173cdd48d2e25905cd1f15c930965df8edff311ad267144b1fcc5a9cc06e2e42c7e630f12c5c75cfff19488a9217d9fabb88ac112a0f6feed5c62ea65024 dotnet-5.0.6.tar.gz
e61b9e3e5a2305646a616d598378230c9755c5dd5363692cc363f8f4add3807563c324dd86f3a7ae9d358c82d730608e7b293935a2b6c81c0c0f62d752a0a1cf dotnet.sh
ad57d02371d351106e043fa104e31afbb0d6799e7ce0ea1a26f585abbfbab7bcba734c7e70491c4af5bfbed965a9ed3235cf4bc1019f504baf482518193b10a7 9999-runtime-link-order.patch
c96700138ea919c169c3a394f1bf9548c7f86b1ba42b193d6e7bb0a1e2bd6f7f202befbc61246a8720181cd40e1f7fa36a6c208eb19b03a23e21994136fb2507 9999-sdk-telemetry-optout.patch
025b297e81130e6f46dfa755cfd35c3756ef148a48adcc99511d95b1ec8eeede3561f31bbdf6b16cb294da3642298c9353ba07e9728c9c60fe9c3e0f2e2b4ed4 9999-Fix-build-on-Alpine-edge-45352.patch
944461da9ed50d536195ab3572b15fdfa74713344a4ca5e31bed627f09fbf328dd0d1f66599553d474e766cacdba7146c701180810383245fcdce1aba39bfef3 9999-Fix-last-version-digit-present-on-alpine-non-portable.patch
58a3e93e5fb6247569c291f86db127cbbc6cc6842eaf0973c2a211d4806f08dcabd9781b7da567088d820a337d58d6375230ade991dcc77e170266675c4a97e5 9999-Fixed-problematic-version-of-ApplicationInsights-dot.patch
0469d571d0f7634d3794761f04e1cbff9d27d642d134a11a13560574280e5cab6f366eb8820e61a449eca99470fdea8d9f6a7d97b633059b2fe25257ed1579e6 9999-fixed-net40-location.patch
ecab4809e617e9cd30940b1c1a700e16b37b5974c850a60da7f1a25bf81516850e4533ef39d2d8786381e0e4e325d3b53fbb2377ecaa6c0813bb00fc1c92b784 dotnet-install.sh"
sha512sums="a9603309bb2dcdab89177f19e488c6ae268ae6d1d79ac8db5fd84508f4917e24aa388a658afaec53e2a4aee2520d6d4c1fff8e1f61aa8ef7f3465305d9a760ae dotnet-5.0.7.git.zip
ecab4809e617e9cd30940b1c1a700e16b37b5974c850a60da7f1a25bf81516850e4533ef39d2d8786381e0e4e325d3b53fbb2377ecaa6c0813bb00fc1c92b784 dotnet-install.sh
f58bd83b709dcb4b0b67830756069c34258a167b33cb290cbf30f21d69d75402d38e013fd7bbf00640fe19e397f78df6ff787cf8484ee8967d5b8809f033eafb dotnet.sh
ad57d02371d351106e043fa104e31afbb0d6799e7ce0ea1a26f585abbfbab7bcba734c7e70491c4af5bfbed965a9ed3235cf4bc1019f504baf482518193b10a7 runtime_link-order.patch
944461da9ed50d536195ab3572b15fdfa74713344a4ca5e31bed627f09fbf328dd0d1f66599553d474e766cacdba7146c701180810383245fcdce1aba39bfef3 runtime_alpine-non-portable-rid-fix.patch
c96700138ea919c169c3a394f1bf9548c7f86b1ba42b193d6e7bb0a1e2bd6f7f202befbc61246a8720181cd40e1f7fa36a6c208eb19b03a23e21994136fb2507 sdk_telemetry-optout.patch
0469d571d0f7634d3794761f04e1cbff9d27d642d134a11a13560574280e5cab6f366eb8820e61a449eca99470fdea8d9f6a7d97b633059b2fe25257ed1579e6 applications-insights_fix-net40-location.patch
58a3e93e5fb6247569c291f86db127cbbc6cc6842eaf0973c2a211d4806f08dcabd9781b7da567088d820a337d58d6375230ade991dcc77e170266675c4a97e5 build_applicationinsights-alternative-source.patch"

View file

@ -10,3 +10,4 @@ esac
# Extract self-contained executables under HOME to avoid multi-user issues from using the default '/var/tmp'
[ -z "$DOTNET_BUNDLE_EXTRACT_BASE_DIR" ] && export DOTNET_BUNDLE_EXTRACT_BASE_DIR="${XDG_CACHE_HOME:-"$HOME"/.cache}/dotnet_bundle_extract"

View file

@ -0,0 +1,32 @@
# Maintainer: Antoine Martin <dev@ayakael.net>
pkgname=firefly-iii-plaid-connector
pkgver=0.3.1
pkgrel=3
pkgdesc='The Free Software Media System'
arch='i686 x86_64'
url='https://gitlab.com/GeorgeHahn/firefly-plaid-connector'
license='MIT'
options="!strip !check"
depends='firefly-iii'
makedepends='dotnet-sdk'
source="firefly-plaid-connector-$pkgver.tar.gz::https://gitlab.com/GeorgeHahn/firefly-plaid-connector/-/archive/v${pkgver}/firefly-plaid-connector-v${pkgver}.tar.gz"
builddir="${srcdir}/firefly-plaid-connector-v${pkgver}"
build(){
cd "${builddir}"
# Disable dotnet telemetry
export DOTNET_CLI_TELEMETRY_OPTOUT=1
# publish app and libraries
dotnet publish --configuration Release --output "$PWD"/publish
}
package() {
mkdir -p "${pkgdir}"/usr/lib
cp -r "${builddir}"/publish "$pkgdir"/var/lib/firefly-plaid-connector
}
sha512sums="57a64673bf2e8cae00cb215e1dc90eb02bddf50010835a9318f55f83313c00f19d6c8d8af65e2739b0fb6fd4522a2327941bdc7d11cbe59c9537ff6c1575765e firefly-plaid-connector-0.3.1.tar.gz"

View file

@ -0,0 +1,45 @@
# Maintainer: Antoine Martin <dev@ayakael.net>
pkgname=firefly-iii
pkgver=5.5.12
pkgrel=1
pkgdesc='PHP personal finances manager'
pkgusers='firefly'
arch='noarch'
url="https://github.com/${pkgname}/${pkgname}"
license='custom'
options=!check
depends='php7-intl'
makedepends='composer'
source="$pkgname-$pkgver.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/${pkgver}.tar.gz"
package() {
cd "$srcdir/$pkgname-$pkgver"
composer install --no-scripts --no-dev --ignore-platform-reqs
install -d "$pkgdir/usr/share/webapps/$pkgname" "$pkgdir/usr/share/licenses/$pkgname" "$pkgdir/etc/webapps/$pkgname"
cp -rv * "$pkgdir/usr/share/webapps/$pkgname"
install -D "$srcdir/$pkgname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname"
cp -v .env.example "$pkgdir/etc/webapps/$pkgname/.env"
cp -v .deploy/*/.env* "$pkgdir/etc/webapps/$pkgname"
for i in '' '.heroku' ; do
mv -v "$pkgdir/etc/webapps/$pkgname/.env$i" "$pkgdir/etc/webapps/$pkgname/config.env$i"
done
ln -s "/etc/webapps/$pkgname/config.env" "$pkgdir/usr/share/webapps/$pkgname/.env"
rm -rf "$pkgdir/usr/share/webapps/$pkgname/bootstrap/cache"
mkdir -p "$pkgdir/var/cache/$pkgname"
chown firefly:www-data "$pkgdir/var/cache/$pkgname"
ln -s "/var/cache/$pkgname" "$pkgdir/usr/share/webapps/$pkgname/bootstrap/cache"
mkdir -p "$pkgdir/var/lib"
mv "$pkgdir/usr/share/webapps/$pkgname/storage" "$pkgdir/var/lib/firefly-iii"
chown -R firefly:www-data "$pkgdir/var/lib/firefly-iii"
chmod 775 "$pkgdir/var/lib/firefly-iii"
ln -s "/var/lib/firefly-iii" "$pkgdir/usr/share/webapps/$pkgname/storage"
}
# vim:ts=4:sw=4:expandtab
sha512sums="157ec94b6df4a7247cd4f666115a34eeea40d138176818d964aac9a2676640896e25cf7d8adc5936bc4d0aa1f0e76865f0fe9257cd99b8cdeaa063a4004c1b08 firefly-iii-5.5.12.tar.gz"

View file

@ -1,7 +1,7 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss-auto-refresh
pkgver=1.1
pkgrel=1
pkgver=1.3
pkgrel=0
pkgdesc="Automatically refreshes FreshRSS page once in a minute when there is no activity detected."
url="https://github.com/Eisa01/FreshRSS---Auto-Refresh-Extension"
arch="noarch"
@ -10,7 +10,7 @@ depends="freshrss"
makedepends="git"
source="$pkgname-$pkgver.tar.gz"
_giturl="https://github.com/Eisa01/FreshRSS---Auto-Refresh-Extension"
_gittag="master"
_gittag="1d26672a78d3b6f8e0d45ccf51a385764ff6bfca"
builddir="$srcdir"
options="!check"
@ -45,4 +45,4 @@ package() {
cp -R "${pkgname}/xExtension-AutoRefresh" "${pkgdir}/usr/share/webapps/freshrss/extensions/"
}
sha512sums="d67c224520b1702ea8671ff4d77e2f852d2fb75b581a7d50f9cdf8e99f064389ef5ac8fd4c18c077f9633fe5d051e20d44ff3615cf0dcbf7ff91105c2f12e9e0 freshrss-auto-refresh-1.1.tar.gz"
sha512sums="bd00e0e5007fdd5cd917b6594942efe8844ce2de97652da32727c4dca8242b87e798bc1953e5624c1c4bd99af7c0950023f5016f3f554c346b6aa6f462a8e708 freshrss-auto-refresh-1.3.tar.gz"

View file

@ -0,0 +1,50 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss-fixednavmenu
pkgver=0.1
pkgrel=0
pkgdesc="Sets the position of the navigation menu to fixed when scrolling down"
url="https://github.com/langfeld/FreshRSS-extensions"
arch="noarch"
license="MIT"
depends="freshrss"
makedepends="git"
source="$pkgname-$pkgver.tar.gz"
_giturl="https://github.com/langfeld/FreshRSS-extensions"
_gittag="8ae060d5103082485edcf20c4ac0308508461492"
builddir="$srcdir"
options="!check"
snapshot() {
mkdir -p "$srcdir"
cd "${SRCDEST:-$srcdir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
else
cd $pkgname.git
git fetch || return 1
fi
echo "Checking out"
git checkout $_gittag
echo "Repo archive"
git archive --prefix="$pkgname/" -o ${pkgname}-${pkgver}.tar --format "tar" $_gittag
gzip ${pkgname}-${pkgver}.tar -c > "$SRCDEST"/$pkgname-$pkgver.tar.gz
ln -s "$SRCDEST"/$pkgname-$pkgver.tar.gz "$startdir"/$pkgname-$pkgver.tar.gz
}
build() {
return 0
}
package() {
cd "$builddir"
mkdir -p "${pkgdir}/usr/share/webapps/freshrss/extensions"
cp -R "${pkgname}/xExtension-FixedNavMenu" "${pkgdir}/usr/share/webapps/freshrss/extensions/"
}
sha512sums="cabbc3ff578fff675bbccb47c1868390f2096c7317b68b8537bbd442d77d9897d4cbe8ae90db8cd82f47e56d4d3fb1ed93319e8c5282e2b9e004e5802209aa35 freshrss-fixednavmenu-0.1.tar.gz"

View file

@ -1,8 +1,8 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss-imageproxy
pkgver=0.5.1
pkgrel=0
pkgdesc="https://github.com/FreshRSS/Extensions/tree/master/xExtension-ImageProxy"
pkgrel=1
pkgdesc="No insecure content warnings or disappearing images"
url="https://github.com/FreshRSS/Extensions"
arch="noarch"
license="GPL-3.0-only"

View file

@ -0,0 +1,50 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss-keepfolderstate
pkgver=0.1
pkgrel=1
pkgdesc="Stores the state of the folders locally and expand them automatically if necessary"
url="https://github.com/langfeld/FreshRSS-extensions"
arch="noarch"
license="MIT"
depends="freshrss"
makedepends="git"
source="$pkgname-$pkgver.tar.gz"
_giturl="https://github.com/langfeld/FreshRSS-extensions"
_gittag="0b5b158c97601d44829975e03a9321fd797c623c"
builddir="$srcdir"
options="!check"
snapshot() {
mkdir -p "$srcdir"
cd "${SRCDEST:-$srcdir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
else
cd $pkgname.git
git fetch || return 1
fi
echo "Checking out"
git checkout $_gittag
echo "Repo archive"
git archive --prefix="$pkgname/" -o ${pkgname}-${pkgver}.tar --format "tar" $_gittag
gzip ${pkgname}-${pkgver}.tar -c > "$SRCDEST"/$pkgname-$pkgver.tar.gz
ln -s "$SRCDEST"/$pkgname-$pkgver.tar.gz "$startdir"/$pkgname-$pkgver.tar.gz
}
build() {
return 0
}
package() {
cd "$builddir"
mkdir -p "${pkgdir}/usr/share/webapps/freshrss/extensions"
cp -R "${pkgname}/xExtension-KeepFolderState" "${pkgdir}/usr/share/webapps/freshrss/extensions/"
}
sha512sums="b36e03d5dca7cb0e2e11a0b2505a88e73f657bf03df97c14f603cb492f8e2036b1688c12ffdc029ce38c6d5ff3f5ccf76d297cdd83a66fe0b4c5e06c660aa79f freshrss-keepfolderstate-0.1.tar.gz"

View file

@ -0,0 +1,48 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss-latexsupport
pkgver=0.1.4
pkgrel=0
pkgdesc="A FreshRSS extension which add LaTeX support"
url="https://github.com/aledeg/xExtension-LatexSupport"
arch="noarch"
license="AGPL3"
depends="freshrss"
makedepends="git"
source="$pkgname-$pkgver.tar.gz"
_giturl="https://github.com/aledeg/xExtension-LatexSupport"
_gittag="2767caec86437e92b748cd770ddc51e79b113a7c"
builddir="$srcdir"
options="!check"
snapshot() {
mkdir -p "$srcdir"
cd "${SRCDEST:-$srcdir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
else
cd $pkgname.git
git fetch || return 1
fi
echo "Checking out"
git checkout $_gittag
echo "Repo archive"
git archive --prefix="$pkgname/" -o ${pkgname}-${pkgver}.tar --format "tar" $_gittag
gzip ${pkgname}-${pkgver}.tar -c > "$SRCDEST"/$pkgname-$pkgver.tar.gz
ln -s "$SRCDEST"/$pkgname-$pkgver.tar.gz "$startdir"/$pkgname-$pkgver.tar.gz
}
build() {
return 0
}
package() {
cd "$builddir"
mkdir -p "${pkgdir}/usr/share/webapps/freshrss/extensions/xExtension-LatexSupport"
cp -R "${pkgname}/"* "${pkgdir}/usr/share/webapps/freshrss/extensions/xExtension-LatexSupport"
}
sha512sums="db3f90146f6b1f18338c187b1bb9363e7c25b9e84483c9835968ad79ad9edcf570088674f114d1f5e6de8913f9d096109e493e726622fd75923d896f91ce0512 freshrss-latexsupport-0.1.4.tar.gz"

View file

@ -0,0 +1,50 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss-mobilescrollmenu
pkgver=0.2
pkgrel=1
pkgdesc="utomatically hides the header menu on mobile phones, when scrolling down and shows it when scrolling up"
url="https://github.com/FreshRSS/Extensions"
arch="noarch"
license="MIT"
depends="freshrss"
makedepends="git"
source="$pkgname-$pkgver.tar.gz"
_giturl="https://github.com/langfeld/FreshRSS-extensions"
_gittag="d02b2cb89f5ad16a9ee10c8eac578ead21c8c91d"
builddir="$srcdir"
options="!check"
snapshot() {
mkdir -p "$srcdir"
cd "${SRCDEST:-$srcdir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
else
cd $pkgname.git
git fetch || return 1
fi
echo "Checking out"
git checkout $_gittag
echo "Repo archive"
git archive --prefix="$pkgname/" -o ${pkgname}-${pkgver}.tar --format "tar" $_gittag
gzip ${pkgname}-${pkgver}.tar -c > "$SRCDEST"/$pkgname-$pkgver.tar.gz
ln -s "$SRCDEST"/$pkgname-$pkgver.tar.gz "$startdir"/$pkgname-$pkgver.tar.gz
}
build() {
return 0
}
package() {
cd "$builddir"
mkdir -p "${pkgdir}/usr/share/webapps/freshrss/extensions"
cp -R "${pkgname}/xExtension-MobileScrollMenu" "${pkgdir}/usr/share/webapps/freshrss/extensions/"
}
sha512sums="02dd7eb7e2bd9442e359d00b28ff84add2af13396bc27e2a0cdc4d12677ef60012db16a70826a8003efc1ac644947b6129e3a65632924a2bfde650cf1b9b6047 freshrss-mobilescrollmenu-0.2.tar.gz"

View file

@ -1,16 +1,16 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss-redditimage
pkgver=0.10.0
pkgver=0.12.0
pkgrel=0
pkgdesc="Modify reddit entries by displaying known medias and easing access to the linked resource"
url="https://github.com/aledeg/FreshRSS-extensions"
url="https://github.com/aledeg/xExtension-RedditImage"
arch="noarch"
license="MIT"
depends="freshrss"
makedepends="git"
source="$pkgname-$pkgver.tar.gz"
_giturl="https://github.com/aledeg/FreshRSS-extensions"
_gittag="2ad7def"
_giturl="https://github.com/aledeg/xExtension-RedditImage"
_gittag="ae1c643445c7e9a0f326bdff4d432bdada6e589d"
builddir="$srcdir"
options="!check"
@ -41,8 +41,8 @@ build() {
package() {
cd "$builddir"
mkdir -p "${pkgdir}/usr/share/webapps/freshrss/extensions"
cp -R "${pkgname}/xExtension-RedditImage" "${pkgdir}/usr/share/webapps/freshrss/extensions/"
mkdir -p "${pkgdir}/usr/share/webapps/freshrss/extensions/xExtension-RedditImage"
cp -R "${pkgname}/"* "${pkgdir}/usr/share/webapps/freshrss/extensions/xExtension-RedditImage"
}
sha512sums="c37f90702ba8b6e70483b8f11df7b3913d4c05f396e0e312f065a55f68521c7fac1ba4bb85f3eff09d9f0e5ea1b06616a199612fee37b0fcb1846e4b0a18877a freshrss-redditimage-0.10.0.tar.gz"
sha512sums="870b4fdade6ce5af8b9368e06d934ba8127d9c531a04c2b9f99718460476eaddaa86b3d426b7d5cdec3d65c5573cfd70451886f5f322efd053c828bb845d6b7b freshrss-redditimage-0.12.0.tar.gz"

View file

@ -0,0 +1,50 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss-smartmobilemenu
pkgver=0.1
pkgrel=0
pkgdesc="Minimizes the required button space and groups buttons"
url="https://github.com/langfeld/FreshRSS-extensions"
arch="noarch"
license="MIT"
depends="freshrss"
makedepends="git"
source="$pkgname-$pkgver.tar.gz"
_giturl="https://github.com/langfeld/FreshRSS-extensions"
_gittag="cb1503844f55fb5b07568ed98f601c547d1f1596"
builddir="$srcdir"
options="!check"
snapshot() {
mkdir -p "$srcdir"
cd "${SRCDEST:-$srcdir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
else
cd $pkgname.git
git fetch || return 1
fi
echo "Checking out"
git checkout $_gittag
echo "Repo archive"
git archive --prefix="$pkgname/" -o ${pkgname}-${pkgver}.tar --format "tar" $_gittag
gzip ${pkgname}-${pkgver}.tar -c > "$SRCDEST"/$pkgname-$pkgver.tar.gz
ln -s "$SRCDEST"/$pkgname-$pkgver.tar.gz "$startdir"/$pkgname-$pkgver.tar.gz
}
build() {
return 0
}
package() {
cd "$builddir"
mkdir -p "${pkgdir}/usr/share/webapps/freshrss/extensions"
cp -R "${pkgname}/xExtension-SmartMobileMenu" "${pkgdir}/usr/share/webapps/freshrss/extensions/"
}
sha512sums="99444bd061479a3bc5cdb1ae8d32a64654d5211182d8ed49b35bf0d9a383a7cc539fc6d09a3726ec8b290de222771afbc4b869e2a37e397dc3c365f20436b41f freshrss-smartmobilemenu-0.1.tar.gz"

View file

@ -0,0 +1,50 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss-touchcontrol
pkgver=0.2
pkgrel=1
pkgdesc="Add touch gestures to FreshRSS."
url="https://github.com/langfeld/FreshRSS-extensions"
arch="noarch"
license="MIT"
depends="freshrss"
makedepends="git"
source="$pkgname-$pkgver.tar.gz"
_giturl="https://github.com/langfeld/FreshRSS-extensions"
_gittag="d02b2cb89f5ad16a9ee10c8eac578ead21c8c91d"
builddir="$srcdir"
options="!check"
snapshot() {
mkdir -p "$srcdir"
cd "${SRCDEST:-$srcdir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
else
cd $pkgname.git
git fetch || return 1
fi
echo "Checking out"
git checkout $_gittag
echo "Repo archive"
git archive --prefix="$pkgname/" -o ${pkgname}-${pkgver}.tar --format "tar" $_gittag
gzip ${pkgname}-${pkgver}.tar -c > "$SRCDEST"/$pkgname-$pkgver.tar.gz
ln -s "$SRCDEST"/$pkgname-$pkgver.tar.gz "$startdir"/$pkgname-$pkgver.tar.gz
}
build() {
return 0
}
package() {
cd "$builddir"
mkdir -p "${pkgdir}/usr/share/webapps/freshrss/extensions"
cp -R "${pkgname}/xExtension-TouchControl" "${pkgdir}/usr/share/webapps/freshrss/extensions/"
}
sha512sums="e471c2fe77ce9533eca6133a9fec1210e4c243daa7b624882b233643a31130e1507ed1465a95bea09a7ffd1e5aa23cf267090aab8656ae92841529077a501c14 freshrss-touchcontrol-0.2.tar.gz"

View file

@ -1,15 +1,16 @@
# Maintainer: Antoine Martin <antoine@ayakael.net>
pkgname=freshrss
pkgver=1.18.0
pkgrel=1
pkgver=1.18.1
pkgrel=0
pkgdesc="FreshRSS is a self-hosted RSS feed aggregator"
arch='noarch'
url="http://freshrss.org"
license='AGPL'
depends='nginx php7 php7-fileinfo php7-curl php7-dom php7-xml php7-session php7-ctype php7-pdo_mysql php7-json php7-gmp php7-intl php7-mbstring php7-iconv php7-zip php7-zlib php7-idn'
depends='nginx php7 php7-fileinfo php7-curl php7-dom php7-xml php7-session php7-ctype php7-pdo_mysql php7-json php7-gmp php7-intl php7-mbstring php7-iconv php7-zip php7-zlib'
source="https://github.com/FreshRSS/FreshRSS/archive/${pkgver}.zip"
builddir="${srcdir}/FreshRSS-${pkgver}"
options='!check'
build() {
return 0
@ -27,4 +28,4 @@ package() {
}
sha512sums="b5ac5b92e9cc4608ff6018a962e16e26bd3c2bf97c00aab992283939a3331927bea922090bc2d2e848dfa4f43a783017679d176bc708156e9d4a2b62acc5cc55 1.18.0.zip"
sha512sums="d18bca33c6c4626806bc027111aa1da126e4198dcba27e276c1c1c17a9cc27bfac83a3b4d2bc0644721a3b905b6b239cbac734ec2c052974785258103cabd741 1.18.1.zip"

View file

@ -1,8 +1,8 @@
# Maintainer: Antoine Martin <dev@ayakael.net>
pkgname=haproxy-wi
pkgver=4.5.9
pkgrel=2
pkgver=5.1.1
pkgrel=0
pkgdesc="Web interface for managing HAProxy, Nginx and Keepalived servers"
arch='noarch'
url="https://github.com/Aidaho12/haproxy-wi"
@ -14,7 +14,7 @@ py3-ldap3 python3-dev libpq libxml2-dev libxslt-dev libldap
libsasl libffi-dev pkgconfig nmap"
source="$pkgname-$pkgver.tar.gz"
_giturl="https://github.com/Aidaho12/haproxy-wi"
_gittag="7c575fe0f8676c47f913bfe47166088ad3740a2b"
_gittag="0f02f84588bd15c5c923e0e405d8f32a19321b2a"
builddir="$srcdir/$pkgname"
options="!check"
@ -47,4 +47,4 @@ package() {
install -Dm755 -d "${_instdir}"/app/certs "${_instdir}"/keys "${_instdir}"/log "${pkgdir}"/etc/logrotate.d
cp "${_instdir}"/config_other/logrotate/* "${pkgdir}"/etc/logrotate.d/.
}
sha512sums="7d8462de5cebe3c9f60378261a2508a5f3cbf99fc55e8ebd38adb4690659a57387614e45f2f29f9c7f486314b0bceea80591d334cf6cef24b8ea56e941a05905 haproxy-wi-4.5.9.tar.gz"
sha512sums="59405d95aaa3229e6525499b34ad7590d467b361021bc615db9cf13854f386c66b0595d152c313d90ee66d238ff16e709b4432c13b0f33b324d4c22ce1b729de haproxy-wi-5.1.1.tar.gz"

View file

@ -0,0 +1,309 @@
# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
# Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
pkgname=openjdk12
pkgver=12.0.2_p10
_pkgver=${pkgver/_p10/-ga}
pkgrel=3
pkgdesc="Oracle OpenJDK 12"
provider_priority=12
url="https://hg.openjdk.java.net/jdk-updates/jdk12u"
# x86, armhf and armv7 are not supported by Oracle due to being 32-bit
# mips64 and riscv64 blocked by openjdk11
arch="all !x86 !armhf !armv7 !mips64 !riscv64"
license="GPL-2.0-with-classpath-exception"
makedepends="autoconf
bash
gawk
grep
make
openjdk11-jdk
zip
alsa-lib-dev
cups-dev
elfutils-dev
fontconfig-dev
freetype-dev
giflib-dev
lcms2-dev
libexecinfo-dev
libffi-dev
libjpeg-turbo-dev
libx11-dev
libxext-dev
libxrandr-dev
libxrender-dev
libxt-dev
libxtst-dev
linux-headers
zlib-dev
"
depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-jdk" # for the virtual openjdk12 package
subpackages="$pkgname-jmods:_jmods:noarch
$pkgname-demos:_demos:noarch
$pkgname-doc:_doc:noarch
$pkgname-jre:_jre
$pkgname-src:_src:noarch
$pkgname-jre-headless:_jre_headless
$pkgname-jdk:_jdk"
source="https://github.com/openjdk/jdk12u/archive/jdk-$_pkgver.tar.gz
build.patch
aarch64.patch
ppc64le.patch
make-4.3.patch
fix-bootjdk-check.patch
gcc10-compilation-fix.patch
JDK-8245051.patch
JDK-8241296.patch
HelloWorld.java
TestECDSA.java
TestCryptoLevel.java
Alpine_Bug_10126.java
"
builddir="$srcdir/jdk12u-jdk-$_pkgver"
_java_home="/usr/lib/jvm/java-12-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
prepare() {
default_prepare
# update autoconf files to detect alpine
update_config_sub
update_config_guess
# remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
rm -r src/jdk.hotspot.agent
}
build() {
if [ $_run_jtreg -ne 0 ]; then
_with_jtreg="--with-jtreg=/usr/share/java/jtreg"
else
_with_jtreg="--with-jtreg=no"
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" \
--with-extra-cxxflags="$CXXFLAGS" \
--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_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#*+} \
--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
}
check() {
local _java_bin="./build/linux-*-server-release/images/jdk/bin"
# 1) compile and run a simple hello world
$_java_bin/javac -d . "$srcdir"/HelloWorld.java
$_java_bin/java HelloWorld
# 2) compile and run a testcase for unlimited policy
$_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java
$_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
# 3) compile and run a testcase for ECDSA signatures
$_java_bin/javac -d . "$srcdir"/TestECDSA.java
$_java_bin/java TestECDSA
# 4) compile and run testcase for bug 10126
$_java_bin/javac -d . "$srcdir"/Alpine_Bug_10126.java
$_java_bin/java Alpine_Bug_10126
# run the gtest unittest suites
# they don't take long, DO NOT DISABLE THEM!
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() {
mkdir -p "$pkgdir/$_java_home"
cp -r build/linux-*-server-release/images/jdk/* "$pkgdir/$_java_home"
}
_jmods() {
pkgdesc="Oracle OpenJDK 12 (jmods)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/jmods" "$_toroot"
}
_demos() {
pkgdesc="Oracle OpenJDK 12 (demos)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/demo" "$_toroot"
}
_doc() {
pkgdesc="Oracle OpenJDK 12 (Documentation)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/man" "$_toroot"
}
_jre() {
pkgdesc="Oracle OpenJDK 12 (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 12 (sources)"
depends="$pkgname-jre-headless"
mkdir -p "$subpkgdir/$_java_home"/lib
mv "$pkgdir"/$_java_home/lib/src.zip \
"$subpkgdir"/$_java_home/lib/
}
_jre_headless() {
pkgdesc="Oracle OpenJDK 12 (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"
mkdir -p "$_toroot/bin"
for i in java \
jjs \
keytool \
pack200 \
rmid \
rmiregistry \
unpack200; 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" "$_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 12 (JDK)"
depends="$pkgname-jre"
provides=java-jdk
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/bin" "$_toroot"
mv "$_fromroot/include" "$_toroot"
}
sha512sums="370e3d8378fcdf929df7325ac988ffcb4565c3fbb7cd1831554e0977769f1beaef0185ac8c7df40b5d74ca88acb27f657fb617279f58a8f78cf2adac10b95882 jdk-12.0.2-ga.tar.gz
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
cc466f64fcc8762cf6e3c1f5739be6425209b27aa58acff4e7eb126003d61fa18266f0e79e57e9d84224654010185ab45dc0a8043543dea227258458a00a1eb1 Alpine_Bug_10126.java"

View file

@ -0,0 +1,13 @@
public class Alpine_Bug_10126 {
public static void main(String[] args) throws Exception {
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());
out.flush();
while (in.read(new byte[1024]) != -1) ;
}
System.out.println("Secured connection performed successfully");
}
}

View file

@ -0,0 +1,3 @@
public class HelloWorld {
public static void main(String[] args) { System.out.println("Hello World!"); }
}

View file

@ -0,0 +1,25 @@
From e566dca620c43d56798770b41cd0d25a63a71b82 Mon Sep 17 00:00:00 2001
From: Andrew Haley <aph@openjdk.org>
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);

View file

@ -0,0 +1,72 @@
From 612c38cdc92a3e169fe83846920407d50263044a Mon Sep 17 00:00:00 2001
From: Xin Liu <xliu@openjdk.org>
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"));

View file

@ -0,0 +1,72 @@
/* TestCryptoLevel -- Ensure unlimited crypto policy is in use.
Copyright (C) 2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.security.Permission;
import java.security.PermissionCollection;
public class TestCryptoLevel
{
public static void main(String[] args)
throws NoSuchFieldException, ClassNotFoundException,
IllegalAccessException, InvocationTargetException
{
Class<?> cls = null;
Method def = null, exempt = null;
try
{
cls = Class.forName("javax.crypto.JceSecurity");
}
catch (ClassNotFoundException ex)
{
System.err.println("Running a non-Sun JDK.");
System.exit(0);
}
try
{
def = cls.getDeclaredMethod("getDefaultPolicy");
exempt = cls.getDeclaredMethod("getExemptPolicy");
}
catch (NoSuchMethodException ex)
{
System.err.println("Running IcedTea with the original crypto patch.");
System.exit(0);
}
def.setAccessible(true);
exempt.setAccessible(true);
PermissionCollection defPerms = (PermissionCollection) def.invoke(null);
PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null);
Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission");
Field apField = apCls.getDeclaredField("INSTANCE");
apField.setAccessible(true);
Permission allPerms = (Permission) apField.get(null);
if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms)))
{
System.err.println("Running with the unlimited policy.");
System.exit(0);
}
else
{
System.err.println("WARNING: Running with a restricted crypto policy.");
System.exit(-1);
}
}
}

View file

@ -0,0 +1,49 @@
/* TestECDSA -- Ensure ECDSA signatures are working.
Copyright (C) 2016 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.Signature;
/**
* @test
*/
public class TestECDSA {
public static void main(String[] args) throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
KeyPair key = keyGen.generateKeyPair();
byte[] data = "This is a string to sign".getBytes("UTF-8");
Signature dsa = Signature.getInstance("NONEwithECDSA");
dsa.initSign(key.getPrivate());
dsa.update(data);
byte[] sig = dsa.sign();
System.out.println("Signature: " + new BigInteger(1, sig).toString(16));
Signature dsaCheck = Signature.getInstance("NONEwithECDSA");
dsaCheck.initVerify(key.getPublic());
dsaCheck.update(data);
boolean success = dsaCheck.verify(sig);
if (!success) {
throw new RuntimeException("Test failed. Signature verification error");
}
System.out.println("Test passed.");
}
}

View file

@ -0,0 +1,30 @@
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.
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 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#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;

View file

@ -0,0 +1,525 @@
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 <simon-alpine@fraho.eu>
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 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -71,6 +71,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
################################################################################
--- old/make/lib/CoreLibraries.gmk
+++ new/make/lib/CoreLibraries.gmk
@@ -194,6 +194,7 @@
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_EXTRA_FILES += \
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -99,7 +99,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -519,6 +518,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -536,6 +540,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -2855,20 +2860,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -75,9 +75,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -1148,7 +1148,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/runtime/vm_version.cpp
+++ new/src/hotspot/share/runtime/vm_version.cpp
@@ -270,7 +270,7 @@
#endif
#define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \
- " for " OS "-" CPU FLOAT_ARCH_STR \
+ " for " OS "-" CPU FLOAT_ARCH_STR LIBC \
" JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ \
" by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -204,7 +204,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -234,7 +234,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -37,7 +37,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md_solinux.c
+++ new/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -235,6 +235,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
+++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
@@ -27,9 +27,6 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
-#include <execinfo.h>
-#endif
#include <jvm.h>
#include <jni.h>
@@ -790,26 +787,6 @@
}
return ret;
}
-
-#ifdef __linux__
-void print_stack(void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- fprintf (stderr, "Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- fprintf (stderr, "%s\n", strings[i]);
-
- free (strings);
-}
-#endif
Window get_xawt_root_shell(JNIEnv *env) {
static jclass classXRootWindow = NULL;
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -254,13 +269,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -273,7 +294,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -396,8 +396,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -438,13 +438,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -460,10 +460,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -518,12 +518,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -620,6 +620,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -658,6 +665,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1961,7 +2007,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);

View file

@ -0,0 +1,19 @@
Subject: Fix detection of bootjdk on configure
Upstream: No
Author: Simon Frankenberger <simon-alpine@fraho.eu>
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.
--- old/make/autoconf/boot-jdk.m4
+++ new/make/autoconf/boot-jdk.m4
@@ -74,7 +74,7 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $GREP version | $HEAD -n 1`
if [ [[ "$BOOT_JDK_VERSION" =~ "Picked up" ]] ]; then
AC_MSG_NOTICE([You have _JAVA_OPTIONS or JAVA_TOOL_OPTIONS set. This can mess up the build. Please use --with-boot-jdk-jvmargs instead.])
AC_MSG_NOTICE([Java reports: "$BOOT_JDK_VERSION".])

View file

@ -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 <simon-alpine@fraho.eu>
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 <stdlib.h>
#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);

View file

@ -0,0 +1,20 @@
Subject: Fix build error with make >= 4.3
Upstream: Yes
Upstream-Url: https://bugs.openjdk.java.net/browse/JDK-8237879
Author: Simon Frankenberger <simon-alpine@fraho.eu>
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
index 170c3ed..697f9d2 100644
--- a/make/common/MakeBase.gmk
+++ b/make/common/MakeBase.gmk
@@ -984,7 +984,9 @@ DependOnVariableHelper = \
$(info NewVariable $1: >$(strip $($1))<) \
$(info OldVariable $1: >$(strip $($1_old))<)) \
$(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \
- $(call DependOnVariableFileName, $1, $2))) \
+ $(call DependOnVariableFileName, $1, $2)) \
+ $(eval $(call DependOnVariableFileName, $1, $2): ) \
+ ) \
$(call DependOnVariableFileName, $1, $2) \
)

View file

@ -0,0 +1,211 @@
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
@@ -1290,7 +1290,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;
}
@@ -1353,11 +1357,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
@@ -768,7 +768,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,6 +76,9 @@
# 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 +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 != 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::Linux::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) {
@@ -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
+ 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");
@@ -554,6 +578,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);
@@ -562,8 +587,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));
@@ -586,12 +621,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();
}
--- 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");
@@ -56,8 +56,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 +74,11 @@
if (!((Method*)(istate->method))->is_metaspace_object()) {
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)(((Method*)(istate->method))->code_base());
uint64_t code_end = (uint64_t)(((Method*)istate->method)->code_base() + ((Method*)istate->method)->code_size());

View file

@ -0,0 +1,302 @@
# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
# Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
pkgname=openjdk13
pkgver=13.0.7_p5
_pkgver=${pkgver%_p*}-ga
pkgrel=0
pkgdesc="Oracle OpenJDK 13"
provider_priority=13
url="https://github.com/openjdk/jdk13u"
arch="all !x86 !armhf !armv7 !mips !mips64" # oracle dropped support for 32 bit
license="GPL-2.0-with-classpath-exception"
makedepends="autoconf
bash
gawk
grep
make
openjdk12-jdk
zip
alsa-lib-dev
cups-dev
elfutils-dev
fontconfig-dev
freetype-dev
giflib-dev
lcms2-dev
libexecinfo-dev
libffi-dev
libjpeg-turbo-dev
libx11-dev
libxext-dev
libxrandr-dev
libxrender-dev
libxt-dev
libxtst-dev
linux-headers
zlib-dev"
depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-jdk" # for the virtual openjdk13 package
subpackages="$pkgname-jmods:_jmods:noarch
$pkgname-demos:_demos:noarch
$pkgname-doc:_doc:noarch
$pkgname-jre:_jre
$pkgname-src:_src:noarch
$pkgname-jre-headless:_jre_headless
$pkgname-jdk:_jdk"
source="jdk-$_pkgver.tar.gz::https://github.com/openjdk/jdk13u/archive/jdk-$_pkgver.tar.gz
build.patch
aarch64.patch
ppc64le.patch
fix-bootjdk-check.patch
gcc10-compilation-fix.patch
JDK-8245051.patch
HelloWorld.java
TestECDSA.java
TestCryptoLevel.java
Alpine_Bug_10126.java
"
builddir="$srcdir/jdk13u-jdk-$_pkgver"
_java_home="/usr/lib/jvm/java-13-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
prepare() {
default_prepare
# update autoconf files to detect alpine
update_config_sub
update_config_guess
# remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
rm -r src/jdk.hotspot.agent
}
build() {
if [ $_run_jtreg -ne 0 ]; then
_with_jtreg="--with-jtreg=/usr/share/java/jtreg"
else
_with_jtreg="--with-jtreg=no"
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" \
--with-extra-cxxflags="$CXXFLAGS" \
--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_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
}
check() {
local _java_bin="./build/linux-*-server-release/images/jdk/bin"
# 1) compile and run a simple hello world
$_java_bin/javac -d . "$srcdir"/HelloWorld.java
$_java_bin/java HelloWorld
# 2) compile and run a testcase for unlimited policy
$_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java
$_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
# 3) compile and run a testcase for ECDSA signatures
$_java_bin/javac -d . "$srcdir"/TestECDSA.java
$_java_bin/java TestECDSA
# 4) compile and run testcase for bug 10126
$_java_bin/javac -d . "$srcdir"/Alpine_Bug_10126.java
$_java_bin/java Alpine_Bug_10126
# run the gtest unittest suites
# they don't take long, DO NOT DISABLE THEM!
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() {
mkdir -p "$pkgdir/$_java_home"
cp -r build/linux-*-server-release/images/jdk/* "$pkgdir/$_java_home"
}
_jmods() {
pkgdesc="Oracle OpenJDK 13 (jmods)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/jmods" "$_toroot"
}
_demos() {
pkgdesc="Oracle OpenJDK 13 (demos)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/demo" "$_toroot"
}
_doc() {
pkgdesc="Oracle OpenJDK 13 (Documentation)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/man" "$_toroot"
}
_jre() {
pkgdesc="Oracle OpenJDK 13 (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 13 (sources)"
depends="$pkgname-jre-headless"
mkdir -p "$subpkgdir/$_java_home"/lib
mv "$pkgdir"/$_java_home/lib/src.zip \
"$subpkgdir"/$_java_home/lib/
}
_jre_headless() {
pkgdesc="Oracle OpenJDK 13 (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"
mkdir -p "$_toroot/bin"
for i in java \
jjs \
keytool \
pack200 \
rmid \
rmiregistry \
unpack200; 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" "$_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 13 (JDK)"
depends="$pkgname-jre"
provides=java-jdk
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/bin" "$_toroot"
mv "$_fromroot/include" "$_toroot"
}
sha512sums="182999c3e5f295d9cf3df39cd419a5c66d01a48a44ff91f38963438c3713bdb036fe230778f638a6295210334a2c16ec89351c1dff8f40aad4850d434b6716d4 jdk-13.0.7-ga.tar.gz
9786cdbe1fdbdc882092124ebade05bea6d039f62263fb29bae2dc9479d07434f574424e7716a10edf6c9c88ebec7c4d3ef3c5031424d7eb65ee6a68ac038f6b build.patch
f7fd94b04740e2a3f966577a5c02f7d6db38ef0ab3ef7b3183cd3ba3d8ff7304e3151fba03a4bcbb9f82f380a723d7823794e168ebf9f2fa8d5e7a9dbc895ce9 aarch64.patch
2d41f87175b3727c0e71d4d63ee4574d59097527775c98456a311b14e17950274531d422a965f0d7ad5e1b5bf4286fc250565c35f74aad61960d529a1a409eec ppc64le.patch
a916200ffdd4e4be0233fa020a30f4b0aabb92dc1956ce75e4372afc6fb22cad8333770d5381086e91c1ed4159a9620a37de3e5b175c8f025ec9040ad016fce2 fix-bootjdk-check.patch
bef17d175afcca4259c030b56961780d612c4c310c243ef60a0759a0faa16614a0deac2a80bab68073fab038eafaa436a4bce0e33a1b673fbbe56d9d4eb67aeb gcc10-compilation-fix.patch
0254dae7aef9bd6c4e19ac3c31f0b7bf8f818ead8858b1cd4e29e4572a5b0932de1ba498ba2c60a03dce77da235fdad23e7a4be5bea298bba3951752d313d1b4 JDK-8245051.patch
d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java
27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java
b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java
cc466f64fcc8762cf6e3c1f5739be6425209b27aa58acff4e7eb126003d61fa18266f0e79e57e9d84224654010185ab45dc0a8043543dea227258458a00a1eb1 Alpine_Bug_10126.java"

View file

@ -0,0 +1,13 @@
public class Alpine_Bug_10126 {
public static void main(String[] args) throws Exception {
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());
out.flush();
while (in.read(new byte[1024]) != -1) ;
}
System.out.println("Secured connection performed successfully");
}
}

View file

@ -0,0 +1,3 @@
public class HelloWorld {
public static void main(String[] args) { System.out.println("Hello World!"); }
}

View file

@ -0,0 +1,72 @@
From 612c38cdc92a3e169fe83846920407d50263044a Mon Sep 17 00:00:00 2001
From: Xin Liu <xliu@openjdk.org>
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"));

View file

@ -0,0 +1,72 @@
/* TestCryptoLevel -- Ensure unlimited crypto policy is in use.
Copyright (C) 2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.security.Permission;
import java.security.PermissionCollection;
public class TestCryptoLevel
{
public static void main(String[] args)
throws NoSuchFieldException, ClassNotFoundException,
IllegalAccessException, InvocationTargetException
{
Class<?> cls = null;
Method def = null, exempt = null;
try
{
cls = Class.forName("javax.crypto.JceSecurity");
}
catch (ClassNotFoundException ex)
{
System.err.println("Running a non-Sun JDK.");
System.exit(0);
}
try
{
def = cls.getDeclaredMethod("getDefaultPolicy");
exempt = cls.getDeclaredMethod("getExemptPolicy");
}
catch (NoSuchMethodException ex)
{
System.err.println("Running IcedTea with the original crypto patch.");
System.exit(0);
}
def.setAccessible(true);
exempt.setAccessible(true);
PermissionCollection defPerms = (PermissionCollection) def.invoke(null);
PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null);
Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission");
Field apField = apCls.getDeclaredField("INSTANCE");
apField.setAccessible(true);
Permission allPerms = (Permission) apField.get(null);
if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms)))
{
System.err.println("Running with the unlimited policy.");
System.exit(0);
}
else
{
System.err.println("WARNING: Running with a restricted crypto policy.");
System.exit(-1);
}
}
}

View file

@ -0,0 +1,49 @@
/* TestECDSA -- Ensure ECDSA signatures are working.
Copyright (C) 2016 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.Signature;
/**
* @test
*/
public class TestECDSA {
public static void main(String[] args) throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
KeyPair key = keyGen.generateKeyPair();
byte[] data = "This is a string to sign".getBytes("UTF-8");
Signature dsa = Signature.getInstance("NONEwithECDSA");
dsa.initSign(key.getPrivate());
dsa.update(data);
byte[] sig = dsa.sign();
System.out.println("Signature: " + new BigInteger(1, sig).toString(16));
Signature dsaCheck = Signature.getInstance("NONEwithECDSA");
dsaCheck.initVerify(key.getPublic());
dsaCheck.update(data);
boolean success = dsaCheck.verify(sig);
if (!success) {
throw new RuntimeException("Test failed. Signature verification error");
}
System.out.println("Test passed.");
}
}

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_aarch64/os_linux_aarch64.cpp
+++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -74,7 +74,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#define REG_FP 29
#define REG_LR 30

View file

@ -0,0 +1,514 @@
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 <simon-alpine@fraho.eu>
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 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -73,6 +73,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
################################################################################
--- old/make/lib/CoreLibraries.gmk
+++ new/make/lib/CoreLibraries.gmk
@@ -192,6 +192,7 @@
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_EXTRA_FILES += \
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -102,7 +102,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -599,6 +598,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -616,6 +620,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -3032,20 +3037,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -75,9 +75,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -1150,7 +1150,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -204,7 +204,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -234,7 +234,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -37,7 +37,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md_solinux.c
+++ new/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -236,6 +236,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
+++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
@@ -27,9 +27,6 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
-#include <execinfo.h>
-#endif
#include <jvm.h>
#include <jni.h>
@@ -783,26 +780,6 @@
}
return ret;
}
-
-#ifdef __linux__
-void print_stack(void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- fprintf (stderr, "Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- fprintf (stderr, "%s\n", strings[i]);
-
- free (strings);
-}
-#endif
Window get_xawt_root_shell(JNIEnv *env) {
static jclass classXRootWindow = NULL;
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -258,13 +273,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -277,7 +298,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -396,8 +396,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -438,13 +438,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -460,10 +460,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -518,12 +518,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -620,6 +620,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -658,6 +665,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1961,7 +2007,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);

View file

@ -0,0 +1,19 @@
Subject: Fix detection of bootjdk on configure
Upstream: No
Author: Simon Frankenberger <simon-alpine@fraho.eu>
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.
--- old/make/autoconf/boot-jdk.m4
+++ new/make/autoconf/boot-jdk.m4
@@ -74,7 +74,7 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $GREP version | $HEAD -n 1`
if [ [[ "$BOOT_JDK_VERSION" =~ "Picked up" ]] ]; then
AC_MSG_NOTICE([You have _JAVA_OPTIONS or JAVA_TOOL_OPTIONS set. This can mess up the build. Please use --with-boot-jdk-jvmargs instead.])
AC_MSG_NOTICE([Java reports: "$BOOT_JDK_VERSION".])

View file

@ -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 <simon-alpine@fraho.eu>
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 <stdlib.h>
#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);

View file

@ -0,0 +1,247 @@
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 "opto/intrinsicnode.hpp"
#endif
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
#ifdef PRODUCT
#define BLOCK_COMMENT(str) // nothing
#else
@@ -1290,7 +1294,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;
}
@@ -1353,11 +1361,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
@@ -50,6 +50,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;
@@ -892,7 +896,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::Linux::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
}
ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
@@ -259,7 +285,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");
@@ -570,6 +600,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);
@@ -578,8 +609,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));
@@ -602,12 +643,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();
}
--- 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");
@@ -56,8 +60,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 (MetaspaceObj::is_valid((Method*)(istate->method)) == false) {
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)(((Method*)(istate->method))->code_base());
uint64_t code_end = (uint64_t)(((Method*)istate->method)->code_base() + ((Method*)istate->method)->code_size());

View file

@ -0,0 +1,300 @@
# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
# Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
pkgname=openjdk14
pkgver=14.0.2_p12
_pkgver=${pkgver%_p*}-ga
pkgrel=2
pkgdesc="Oracle OpenJDK 14"
provider_priority=14
url="https://hg.openjdk.java.net/jdk-updates/jdk14u"
arch="all !x86 !armhf !armv7 !mips !mips64" # oracle dropped support for 32 bit
license="GPL-2.0-with-classpath-exception"
makedepends="autoconf
bash
gawk
grep
make
openjdk13-jdk
zip
alsa-lib-dev
cups-dev
elfutils-dev
fontconfig-dev
freetype-dev
giflib-dev
lcms2-dev
libexecinfo-dev
libffi-dev
libjpeg-turbo-dev
libx11-dev
libxext-dev
libxrandr-dev
libxrender-dev
libxt-dev
libxtst-dev
linux-headers
zlib-dev"
depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-jdk" # for the virtual openjdk14 package
subpackages="$pkgname-jmods:_jmods:noarch
$pkgname-demos:_demos:noarch
$pkgname-doc:_doc:noarch
$pkgname-jre:_jre
$pkgname-src:_src:noarch
$pkgname-jre-headless:_jre_headless
$pkgname-jdk:_jdk"
source="jdk-$_pkgver.tar.gz::https://github.com/openjdk/jdk14u/archive/jdk-$_pkgver.tar.gz
build.patch
aarch64.patch
ppc64le.patch
fix-bootjdk-check.patch
gcc10-compilation-fix.patch
JDK-8245051.patch
HelloWorld.java
TestECDSA.java
TestCryptoLevel.java
Alpine_Bug_10126.java
"
builddir="$srcdir/jdk14u-jdk-${_pkgver/+/-}"
_java_home="/usr/lib/jvm/java-14-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
prepare() {
default_prepare
# update autoconf files to detect alpine
update_config_sub
update_config_guess
# remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
rm -r src/jdk.hotspot.agent
}
build() {
if [ $_run_jtreg -ne 0 ]; then
_with_jtreg="--with-jtreg=/usr/share/java/jtreg"
else
_with_jtreg="--with-jtreg=no"
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" \
--with-extra-cxxflags="$CXXFLAGS" \
--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_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#*+} \
--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
}
check() {
local _java_bin="./build/linux-*-server-release/images/jdk/bin"
# 1) compile and run a simple hello world
$_java_bin/javac -d . "$srcdir"/HelloWorld.java
$_java_bin/java HelloWorld
# 2) compile and run a testcase for unlimited policy
$_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java
$_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
# 3) compile and run a testcase for ECDSA signatures
$_java_bin/javac -d . "$srcdir"/TestECDSA.java
$_java_bin/java TestECDSA
# 4) compile and run testcase for bug 10126
$_java_bin/javac -d . "$srcdir"/Alpine_Bug_10126.java
$_java_bin/java Alpine_Bug_10126
# run the gtest unittest suites
# they don't take long, DO NOT DISABLE THEM!
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() {
mkdir -p "$pkgdir/$_java_home"
cp -r build/linux-*-server-release/images/jdk/* "$pkgdir/$_java_home"
}
_jmods() {
pkgdesc="Oracle OpenJDK 14 (jmods)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/jmods" "$_toroot"
}
_demos() {
pkgdesc="Oracle OpenJDK 14 (demos)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/demo" "$_toroot"
}
_doc() {
pkgdesc="Oracle OpenJDK 14 (Documentation)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/man" "$_toroot"
}
_jre() {
pkgdesc="Oracle OpenJDK 14 (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 14 (sources)"
depends="$pkgname-jre-headless"
mkdir -p "$subpkgdir/$_java_home"/lib
mv "$pkgdir"/$_java_home/lib/src.zip \
"$subpkgdir"/$_java_home/lib/
}
_jre_headless() {
pkgdesc="Oracle OpenJDK 14 (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"
mkdir -p "$_toroot/bin"
for i in java \
jjs \
keytool \
rmid \
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" "$_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 14 (JDK)"
depends="$pkgname-jre"
provides=java-jdk
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/bin" "$_toroot"
mv "$_fromroot/include" "$_toroot"
}
sha512sums="e76b7908e7b1375029564d39386c86b640fcb61c7152bdda7249a6455516792830f17e987c98790ae5983087b928be6f5d572b8b10f3e2318d2d993f5f22ed62 jdk-14.0.2-ga.tar.gz
c2da2d73f47c71768028a31282438389ef4f06d0985b8c4d769487745bd14ce65fbb430a2f420eb6dba8af7a69927f0e8cba285c7e0b17bde234357792534ba7 build.patch
f7fd94b04740e2a3f966577a5c02f7d6db38ef0ab3ef7b3183cd3ba3d8ff7304e3151fba03a4bcbb9f82f380a723d7823794e168ebf9f2fa8d5e7a9dbc895ce9 aarch64.patch
a02b35842c71ee5513d24e82b4edcda4943af6aaa54188775d2a36e9e70d35d16823df92df6390ceee222a1a7661ac6116e6edaf5c67bfe239efb15eb6457f57 ppc64le.patch
a916200ffdd4e4be0233fa020a30f4b0aabb92dc1956ce75e4372afc6fb22cad8333770d5381086e91c1ed4159a9620a37de3e5b175c8f025ec9040ad016fce2 fix-bootjdk-check.patch
32dbebd5d2f6741e9917af89ec86308dbd766dfb24ddee6f42bfe8b68a4d82c5dd886a061147c3aab75c8092b30c93aec49737458716c7af8900d5d73dfb0567 gcc10-compilation-fix.patch
0254dae7aef9bd6c4e19ac3c31f0b7bf8f818ead8858b1cd4e29e4572a5b0932de1ba498ba2c60a03dce77da235fdad23e7a4be5bea298bba3951752d313d1b4 JDK-8245051.patch
d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java
27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java
b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java
cc466f64fcc8762cf6e3c1f5739be6425209b27aa58acff4e7eb126003d61fa18266f0e79e57e9d84224654010185ab45dc0a8043543dea227258458a00a1eb1 Alpine_Bug_10126.java"

View file

@ -0,0 +1,13 @@
public class Alpine_Bug_10126 {
public static void main(String[] args) throws Exception {
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());
out.flush();
while (in.read(new byte[1024]) != -1) ;
}
System.out.println("Secured connection performed successfully");
}
}

View file

@ -0,0 +1,3 @@
public class HelloWorld {
public static void main(String[] args) { System.out.println("Hello World!"); }
}

View file

@ -0,0 +1,72 @@
From 612c38cdc92a3e169fe83846920407d50263044a Mon Sep 17 00:00:00 2001
From: Xin Liu <xliu@openjdk.org>
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"));

View file

@ -0,0 +1,72 @@
/* TestCryptoLevel -- Ensure unlimited crypto policy is in use.
Copyright (C) 2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.security.Permission;
import java.security.PermissionCollection;
public class TestCryptoLevel
{
public static void main(String[] args)
throws NoSuchFieldException, ClassNotFoundException,
IllegalAccessException, InvocationTargetException
{
Class<?> cls = null;
Method def = null, exempt = null;
try
{
cls = Class.forName("javax.crypto.JceSecurity");
}
catch (ClassNotFoundException ex)
{
System.err.println("Running a non-Sun JDK.");
System.exit(0);
}
try
{
def = cls.getDeclaredMethod("getDefaultPolicy");
exempt = cls.getDeclaredMethod("getExemptPolicy");
}
catch (NoSuchMethodException ex)
{
System.err.println("Running IcedTea with the original crypto patch.");
System.exit(0);
}
def.setAccessible(true);
exempt.setAccessible(true);
PermissionCollection defPerms = (PermissionCollection) def.invoke(null);
PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null);
Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission");
Field apField = apCls.getDeclaredField("INSTANCE");
apField.setAccessible(true);
Permission allPerms = (Permission) apField.get(null);
if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms)))
{
System.err.println("Running with the unlimited policy.");
System.exit(0);
}
else
{
System.err.println("WARNING: Running with a restricted crypto policy.");
System.exit(-1);
}
}
}

View file

@ -0,0 +1,49 @@
/* TestECDSA -- Ensure ECDSA signatures are working.
Copyright (C) 2016 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.Signature;
/**
* @test
*/
public class TestECDSA {
public static void main(String[] args) throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
KeyPair key = keyGen.generateKeyPair();
byte[] data = "This is a string to sign".getBytes("UTF-8");
Signature dsa = Signature.getInstance("NONEwithECDSA");
dsa.initSign(key.getPrivate());
dsa.update(data);
byte[] sig = dsa.sign();
System.out.println("Signature: " + new BigInteger(1, sig).toString(16));
Signature dsaCheck = Signature.getInstance("NONEwithECDSA");
dsaCheck.initVerify(key.getPublic());
dsaCheck.update(data);
boolean success = dsaCheck.verify(sig);
if (!success) {
throw new RuntimeException("Test failed. Signature verification error");
}
System.out.println("Test passed.");
}
}

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_aarch64/os_linux_aarch64.cpp
+++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -74,7 +74,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#define REG_FP 29
#define REG_LR 30

View file

@ -0,0 +1,514 @@
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 <simon-alpine@fraho.eu>
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 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -73,6 +73,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
################################################################################
--- old/make/lib/CoreLibraries.gmk
+++ new/make/lib/CoreLibraries.gmk
@@ -190,6 +190,7 @@
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_EXTRA_FILES += \
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -102,7 +102,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -597,6 +596,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -614,6 +618,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -3117,20 +3122,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -75,9 +75,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -1116,7 +1116,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -204,7 +204,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -235,7 +235,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -37,7 +37,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md_solinux.c
+++ new/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -236,6 +236,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
+++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
@@ -27,9 +27,6 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
-#include <execinfo.h>
-#endif
#include <jvm.h>
#include <jni.h>
@@ -779,26 +776,6 @@
}
return ret;
}
-
-#ifdef __linux__
-void print_stack(void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- fprintf (stderr, "Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- fprintf (stderr, "%s\n", strings[i]);
-
- free (strings);
-}
-#endif
Window get_xawt_root_shell(JNIEnv *env) {
static jclass classXRootWindow = NULL;
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -258,13 +273,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -277,7 +298,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -396,8 +396,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -438,13 +438,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -460,10 +460,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -518,12 +518,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -620,6 +620,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -658,6 +665,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1961,7 +2007,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);

View file

@ -0,0 +1,19 @@
Subject: Fix detection of bootjdk on configure
Upstream: No
Author: Simon Frankenberger <simon-alpine@fraho.eu>
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.
--- old/make/autoconf/boot-jdk.m4
+++ new/make/autoconf/boot-jdk.m4
@@ -74,7 +74,7 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $GREP version | $HEAD -n 1`
if [ [[ "$BOOT_JDK_VERSION" =~ "Picked up" ]] ]; then
AC_MSG_NOTICE([You have _JAVA_OPTIONS or JAVA_TOOL_OPTIONS set. This can mess up the build. Please use --with-boot-jdk-jvmargs instead.])
AC_MSG_NOTICE([Java reports: "$BOOT_JDK_VERSION".])

View file

@ -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 <simon-alpine@fraho.eu>
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
@@ -34,6 +34,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
@@ -126,7 +126,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 <stdlib.h>
#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);

View file

@ -0,0 +1,247 @@
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
@@ -48,6 +48,10 @@
#include "opto/intrinsicnode.hpp"
#endif
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
#ifdef PRODUCT
#define BLOCK_COMMENT(str) // nothing
#else
@@ -1291,7 +1295,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;
}
@@ -1354,11 +1362,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
@@ -50,6 +50,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;
@@ -896,7 +900,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::Linux::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
}
ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
@@ -259,7 +285,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");
@@ -588,6 +618,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);
@@ -596,8 +627,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));
@@ -620,12 +661,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();
}
--- 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");
@@ -56,8 +60,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
@@ -70,7 +79,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,298 @@
# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
# Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
pkgname=openjdk15
pkgver=15.0.3_p3
_pkgver=${pkgver%_p*}-ga
pkgrel=0
pkgdesc="Oracle OpenJDK 15"
provider_priority=15
url="https://github.com/openjdk/jdk15u"
arch="all !x86 !armhf !armv7 !mips !mips64" # oracle dropped support for 32 bit
license="GPL-2.0-with-classpath-exception"
makedepends="autoconf
bash
gawk
grep
make
openjdk14-jdk
zip
alsa-lib-dev
cups-dev
elfutils-dev
fontconfig-dev
freetype-dev
giflib-dev
lcms2-dev
libexecinfo-dev
libffi-dev
libjpeg-turbo-dev
libx11-dev
libxext-dev
libxrandr-dev
libxrender-dev
libxt-dev
libxtst-dev
linux-headers
zlib-dev"
depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-jdk" # for the virtual openjdk15 package
subpackages="$pkgname-jmods:_jmods:noarch
$pkgname-demos:_demos:noarch
$pkgname-doc:_doc:noarch
$pkgname-jre:_jre
$pkgname-src:_src:noarch
$pkgname-jre-headless:_jre_headless
$pkgname-jdk:_jdk"
source="jdk-$_pkgver.tar.gz::https://github.com/openjdk/jdk15u/archive/jdk-$_pkgver.tar.gz
gtest-1.8.1.tar.gz::https://github.com/google/googletest/archive/release-1.8.1.tar.gz
build.patch
aarch64.patch
ppc64le.patch
HelloWorld.java
TestECDSA.java
TestCryptoLevel.java
Alpine_Bug_10126.java
"
builddir="$srcdir/jdk15u-jdk-${_pkgver/+/-}"
_java_home="/usr/lib/jvm/java-15-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
prepare() {
default_prepare
# update autoconf files to detect alpine
update_config_sub
update_config_guess
# remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
rm -r src/jdk.hotspot.agent
}
build() {
if [ $_run_jtreg -ne 0 ]; then
_with_jtreg="--with-jtreg=/usr/share/java/jtreg"
else
_with_jtreg="--with-jtreg=no"
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" \
--with-extra-cxxflags="$CXXFLAGS" \
--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-release-1.8.1 \
$_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
}
check() {
local _java_bin="./build/linux-*-server-release/images/jdk/bin"
# 1) compile and run a simple hello world
$_java_bin/javac -d . "$srcdir"/HelloWorld.java
$_java_bin/java HelloWorld
# 2) compile and run a testcase for unlimited policy
$_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java
$_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
# 3) compile and run a testcase for ECDSA signatures
$_java_bin/javac -d . "$srcdir"/TestECDSA.java
$_java_bin/java TestECDSA
# 4) compile and run testcase for bug 10126
$_java_bin/javac -d . "$srcdir"/Alpine_Bug_10126.java
$_java_bin/java Alpine_Bug_10126
# run the gtest unittest suites
# they don't take long, DO NOT DISABLE THEM!
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() {
mkdir -p "$pkgdir/$_java_home"
cp -r build/linux-*-server-release/images/jdk/* "$pkgdir/$_java_home"
}
_jmods() {
pkgdesc="Oracle OpenJDK 15 (jmods)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/jmods" "$_toroot"
}
_demos() {
pkgdesc="Oracle OpenJDK 15 (demos)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/demo" "$_toroot"
}
_doc() {
pkgdesc="Oracle OpenJDK 15 (Documentation)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/man" "$_toroot"
}
_jre() {
pkgdesc="Oracle OpenJDK 15 (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 15 (sources)"
depends="$pkgname-jre-headless"
mkdir -p "$subpkgdir/$_java_home"/lib
mv "$pkgdir"/$_java_home/lib/src.zip \
"$subpkgdir"/$_java_home/lib/
}
_jre_headless() {
pkgdesc="Oracle OpenJDK 15 (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"
mkdir -p "$_toroot/bin"
for i in java \
jfr \
jpackage \
keytool \
rmid \
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" "$_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 15 (JDK)"
depends="$pkgname-jre"
provides=java-jdk
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/bin" "$_toroot"
mv "$_fromroot/include" "$_toroot"
}
sha512sums="c925ed48303a4b30504f3781c6aa55ac4f449310f09acc97c3282a18029175f839b1ad53f96b739c03a67087c9f55b97a78ddb90142c3f8489d38d0b7451e34b jdk-15.0.3-ga.tar.gz
e6283c667558e1fd6e49fa96e52af0e415a3c8037afe1d28b7ff1ec4c2ef8f49beb70a9327b7fc77eb4052a58c4ccad8b5260ec90e4bceeac7a46ff59c4369d7 gtest-1.8.1.tar.gz
83bc3c035add014048cafb651eef342d7412f18111ed39dea2e9e154430e57be90ec36c33ba01f618d525e4331a07c32f51bd694469a9e18a0234879e29c7d60 build.patch
af79b52faf6fbd7391cf8d6442a1883bb0c3b733d8302096c9faeba36f160aaf7b071f5f16ad18332136ea8a6f474fdc0db7305ef9269fa6873346e2f4c08767 aarch64.patch
5fc39e6936053f80c6d56093a7d995c2233fec4b736ea4a50efaab51c37a0a4f6fd672d2dc47339b01e6aa32aaae6ec45782f154e86765c3fbea4986addc14c1 ppc64le.patch
d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java
27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java
b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java
cc466f64fcc8762cf6e3c1f5739be6425209b27aa58acff4e7eb126003d61fa18266f0e79e57e9d84224654010185ab45dc0a8043543dea227258458a00a1eb1 Alpine_Bug_10126.java"

View file

@ -0,0 +1,13 @@
public class Alpine_Bug_10126 {
public static void main(String[] args) throws Exception {
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());
out.flush();
while (in.read(new byte[1024]) != -1) ;
}
System.out.println("Secured connection performed successfully");
}
}

View file

@ -0,0 +1,3 @@
public class HelloWorld {
public static void main(String[] args) { System.out.println("Hello World!"); }
}

View file

@ -0,0 +1,72 @@
/* TestCryptoLevel -- Ensure unlimited crypto policy is in use.
Copyright (C) 2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.security.Permission;
import java.security.PermissionCollection;
public class TestCryptoLevel
{
public static void main(String[] args)
throws NoSuchFieldException, ClassNotFoundException,
IllegalAccessException, InvocationTargetException
{
Class<?> cls = null;
Method def = null, exempt = null;
try
{
cls = Class.forName("javax.crypto.JceSecurity");
}
catch (ClassNotFoundException ex)
{
System.err.println("Running a non-Sun JDK.");
System.exit(0);
}
try
{
def = cls.getDeclaredMethod("getDefaultPolicy");
exempt = cls.getDeclaredMethod("getExemptPolicy");
}
catch (NoSuchMethodException ex)
{
System.err.println("Running IcedTea with the original crypto patch.");
System.exit(0);
}
def.setAccessible(true);
exempt.setAccessible(true);
PermissionCollection defPerms = (PermissionCollection) def.invoke(null);
PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null);
Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission");
Field apField = apCls.getDeclaredField("INSTANCE");
apField.setAccessible(true);
Permission allPerms = (Permission) apField.get(null);
if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms)))
{
System.err.println("Running with the unlimited policy.");
System.exit(0);
}
else
{
System.err.println("WARNING: Running with a restricted crypto policy.");
System.exit(-1);
}
}
}

View file

@ -0,0 +1,49 @@
/* TestECDSA -- Ensure ECDSA signatures are working.
Copyright (C) 2016 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.Signature;
/**
* @test
*/
public class TestECDSA {
public static void main(String[] args) throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
KeyPair key = keyGen.generateKeyPair();
byte[] data = "This is a string to sign".getBytes("UTF-8");
Signature dsa = Signature.getInstance("NONEwithECDSA");
dsa.initSign(key.getPrivate());
dsa.update(data);
byte[] sig = dsa.sign();
System.out.println("Signature: " + new BigInteger(1, sig).toString(16));
Signature dsaCheck = Signature.getInstance("NONEwithECDSA");
dsaCheck.initVerify(key.getPublic());
dsaCheck.update(data);
boolean success = dsaCheck.verify(sig);
if (!success) {
throw new RuntimeException("Test failed. Signature verification error");
}
System.out.println("Test passed.");
}
}

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_aarch64/os_linux_aarch64.cpp
+++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -75,7 +75,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#define REG_FP 29
#define REG_LR 30

View file

@ -0,0 +1,507 @@
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 <simon-alpine@fraho.eu>
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.
This patch contains mainly code from the portola project.
Adopted, enhanced and fixed so that it actually compiles with alpine.
--- old/make/ReleaseFile.gmk
+++ new/make/ReleaseFile.gmk
@@ -53,6 +53,7 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -68,6 +68,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
ifneq ($(HOTSPOT_BUILD_TIME), )
--- old/make/modules/java.base/lib/CoreLibraries.gmk
+++ new/make/modules/java.base/lib/CoreLibraries.gmk
@@ -183,6 +183,7 @@
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_EXTRA_FILES += \
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -103,7 +103,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -600,6 +599,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -617,6 +621,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -3195,20 +3200,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -76,9 +76,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -1121,7 +1121,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -112,7 +112,7 @@
#if defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -236,7 +236,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -33,7 +33,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md.c
+++ new/src/java.base/unix/native/libjli/java_md.c
@@ -230,6 +230,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -258,13 +273,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -277,7 +298,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -400,8 +400,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -442,13 +442,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -464,10 +464,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -522,12 +522,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -624,6 +624,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -662,6 +669,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1965,7 +2011,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);
--- old/test/hotspot/jtreg/runtime/TLS/exestack-tls.c
+++ new/test/hotspot/jtreg/runtime/TLS/exestack-tls.c
@@ -26,7 +26,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <gnu/libc-version.h>
// Declare the thread local variable(s) in the main executable. This can be
// used to demonstrate the issues associated with the on-stack static TLS blocks
@@ -56,6 +55,10 @@
// glibc 2.15 introduced __pthread_get_minstack
int glibc_has_pthread_get_minstack() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ return 0;
+#else
const char* glibc_vers = gnu_get_libc_version();
const int glibc_vers_major = atoi(glibc_vers);
const int glibc_vers_minor = atoi(strchr(glibc_vers, '.') + 1);;
@@ -65,6 +68,7 @@
}
printf("This version does not provide __pthread_get_minstack\n");
return 0;
+#endif
}
int run(jboolean addTLS) {

View file

@ -0,0 +1,247 @@
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
@@ -1290,7 +1294,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;
}
@@ -1353,11 +1361,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
@@ -51,6 +51,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;
@@ -912,7 +916,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::Linux::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
}
ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
@@ -259,7 +285,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");
@@ -616,6 +646,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);
@@ -624,8 +655,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));
@@ -648,12 +689,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();
}
--- 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");
@@ -56,8 +60,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
@@ -70,7 +79,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,288 @@
# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
# Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
pkgname=openjdk16
pkgver=16.0.1_p9
_pkgver=${pkgver%_p*}-ga
pkgrel=0
pkgdesc="Oracle OpenJDK 16"
provider_priority=16
url="https://hg.openjdk.java.net/jdk-updates/jdk16u"
arch="all !x86 !armhf !armv7 !mips !mips64" # oracle dropped support for 32 bit
license="GPL-2.0-with-classpath-exception"
makedepends="autoconf
bash
gawk
grep
make
openjdk15-jdk
zip
alsa-lib-dev
cups-dev
elfutils-dev
fontconfig-dev
freetype-dev
giflib-dev
lcms2-dev
libexecinfo-dev
libffi-dev
libjpeg-turbo-dev
libx11-dev
libxext-dev
libxrandr-dev
libxrender-dev
libxt-dev
libxtst-dev
linux-headers
zlib-dev"
depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-jdk" # for the virtual openjdk16 package
subpackages="$pkgname-jmods:_jmods:noarch
$pkgname-demos:_demos:noarch
$pkgname-doc:_doc:noarch
$pkgname-jre:_jre
$pkgname-src:_src:noarch
$pkgname-jre-headless:_jre_headless
$pkgname-jdk:_jdk"
source="jdk-$_pkgver.tar.gz::https://github.com/openjdk/jdk16u/archive/jdk-$_pkgver.tar.gz
gtest-1.8.1.tar.gz::https://github.com/google/googletest/archive/release-1.8.1.tar.gz
ppc64le.patch
HelloWorld.java
TestECDSA.java
TestCryptoLevel.java
Alpine_Bug_10126.java
"
builddir="$srcdir/jdk16u-jdk-${_pkgver/+/-}"
_java_home="/usr/lib/jvm/java-16-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
prepare() {
default_prepare
# update autoconf files to detect alpine
update_config_sub
update_config_guess
}
build() {
if [ $_run_jtreg -ne 0 ]; then
_with_jtreg="--with-jtreg=/usr/share/java/jtreg"
else
_with_jtreg="--with-jtreg=no"
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" \
--with-extra-cxxflags="$CXXFLAGS" \
--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-release-1.8.1 \
$_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
}
check() {
local _java_bin="./build/linux-*-server-release/images/jdk/bin"
# 1) compile and run a simple hello world
$_java_bin/javac -d . "$srcdir"/HelloWorld.java
$_java_bin/java HelloWorld
# 2) compile and run a testcase for unlimited policy
$_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java
$_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
# 3) compile and run a testcase for ECDSA signatures
$_java_bin/javac -d . "$srcdir"/TestECDSA.java
$_java_bin/java TestECDSA
# 4) compile and run testcase for bug 10126
$_java_bin/javac -d . "$srcdir"/Alpine_Bug_10126.java
$_java_bin/java Alpine_Bug_10126
# run the gtest unittest suites
# they don't take long, DO NOT DISABLE THEM!
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() {
mkdir -p "$pkgdir/$_java_home"
cp -r build/linux-*-server-release/images/jdk/* "$pkgdir/$_java_home"
}
_jmods() {
pkgdesc="Oracle OpenJDK 16 (jmods)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/jmods" "$_toroot"
}
_demos() {
pkgdesc="Oracle OpenJDK 16 (demos)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/demo" "$_toroot"
}
_doc() {
pkgdesc="Oracle OpenJDK 16 (Documentation)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/man" "$_toroot"
}
_jre() {
pkgdesc="Oracle OpenJDK 16 (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 16 (sources)"
depends="$pkgname-jre-headless"
mkdir -p "$subpkgdir/$_java_home"/lib
mv "$pkgdir"/$_java_home/lib/src.zip \
"$subpkgdir"/$_java_home/lib/
}
_jre_headless() {
pkgdesc="Oracle OpenJDK 16 (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"
mkdir -p "$_toroot/bin"
for i in java \
jfr \
jpackage \
keytool \
rmid \
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 16 (JDK)"
depends="$pkgname-jre"
provides=java-jdk
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/bin" "$_toroot"
mv "$_fromroot/include" "$_toroot"
}
sha512sums="372c55cd7897539dcfb4e3098271417da16eafceb05c316a425fc46ffe01c3b66c49cff43e59bb7e045fd2de5a68b28f0e3d256a16b28bf528d2fa635fa65062 jdk-16.0.1-ga.tar.gz
e6283c667558e1fd6e49fa96e52af0e415a3c8037afe1d28b7ff1ec4c2ef8f49beb70a9327b7fc77eb4052a58c4ccad8b5260ec90e4bceeac7a46ff59c4369d7 gtest-1.8.1.tar.gz
05845450afd2d8be9f9f3a69d24c92f2e18593beeb43d748efee53e92edaedacdde2bfcf46b07eb702e036fd3defe2e6418628c26d8e6114653aa521a5d309ce ppc64le.patch
d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java
27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java
b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java
cc466f64fcc8762cf6e3c1f5739be6425209b27aa58acff4e7eb126003d61fa18266f0e79e57e9d84224654010185ab45dc0a8043543dea227258458a00a1eb1 Alpine_Bug_10126.java"

View file

@ -0,0 +1,13 @@
public class Alpine_Bug_10126 {
public static void main(String[] args) throws Exception {
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());
out.flush();
while (in.read(new byte[1024]) != -1) ;
}
System.out.println("Secured connection performed successfully");
}
}

View file

@ -0,0 +1,3 @@
public class HelloWorld {
public static void main(String[] args) { System.out.println("Hello World!"); }
}

View file

@ -0,0 +1,72 @@
/* TestCryptoLevel -- Ensure unlimited crypto policy is in use.
Copyright (C) 2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.security.Permission;
import java.security.PermissionCollection;
public class TestCryptoLevel
{
public static void main(String[] args)
throws NoSuchFieldException, ClassNotFoundException,
IllegalAccessException, InvocationTargetException
{
Class<?> cls = null;
Method def = null, exempt = null;
try
{
cls = Class.forName("javax.crypto.JceSecurity");
}
catch (ClassNotFoundException ex)
{
System.err.println("Running a non-Sun JDK.");
System.exit(0);
}
try
{
def = cls.getDeclaredMethod("getDefaultPolicy");
exempt = cls.getDeclaredMethod("getExemptPolicy");
}
catch (NoSuchMethodException ex)
{
System.err.println("Running IcedTea with the original crypto patch.");
System.exit(0);
}
def.setAccessible(true);
exempt.setAccessible(true);
PermissionCollection defPerms = (PermissionCollection) def.invoke(null);
PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null);
Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission");
Field apField = apCls.getDeclaredField("INSTANCE");
apField.setAccessible(true);
Permission allPerms = (Permission) apField.get(null);
if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms)))
{
System.err.println("Running with the unlimited policy.");
System.exit(0);
}
else
{
System.err.println("WARNING: Running with a restricted crypto policy.");
System.exit(-1);
}
}
}

View file

@ -0,0 +1,49 @@
/* TestECDSA -- Ensure ECDSA signatures are working.
Copyright (C) 2016 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.Signature;
/**
* @test
*/
public class TestECDSA {
public static void main(String[] args) throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
KeyPair key = keyGen.generateKeyPair();
byte[] data = "This is a string to sign".getBytes("UTF-8");
Signature dsa = Signature.getInstance("NONEwithECDSA");
dsa.initSign(key.getPrivate());
dsa.update(data);
byte[] sig = dsa.sign();
System.out.println("Signature: " + new BigInteger(1, sig).toString(16));
Signature dsaCheck = Signature.getInstance("NONEwithECDSA");
dsaCheck.initVerify(key.getPublic());
dsaCheck.update(data);
boolean success = dsaCheck.verify(sig);
if (!success) {
throw new RuntimeException("Test failed. Signature verification error");
}
System.out.println("Test passed.");
}
}

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

@ -1,18 +1,22 @@
# Maintainer: Antoine Martin <dev@ayakael.net>
pkgname=papermc
_pkgver=1.16.5
_build=470
_pkgver=1.17.1
_build=96
_license_commit=4a7962c
pkgver="${_pkgver}.${_build}"
pkgrel=5
pkgrel=8
pkgdesc="Next generation of Minecraft server, compatible with Spigot plugins and offering uncompromising performance"
pkgusers="craftbukkit"
pkggroups="craftbukkit"
arch='noarch'
url="https://papermc.io/"
license='custom'
depends='openjdk11-jre-headless screen sudo bash gawk sed netcat-openbsd tar'
depends='openjdk16-jre-headless screen sudo bash gawk sed netcat-openbsd tar'
backup='etc/conf.d/papermc'
install="${pkgname}.post-install"
options="!check"
provides="craftbukkit=$_pkgver"
subpackages="${pkgname}-openrc"
source="papermc.${pkgver}.jar::https://papermc.io/api/v1/paper/${_pkgver}/${_build}/download
papermc.initd
papermc.conf
@ -30,6 +34,9 @@ package() {
install -Dm644 ${srcdir}/${_game}.${pkgver}.jar "${pkgdir}/${_server_root}/${_game}.${pkgver}.jar"
ln -s "${_game}.${pkgver}.jar" "${pkgdir}${_server_root}/${_game}_server.jar"
# Link to craftbukkit plugins var
ln -s "/var/lib/craftbukkit/plugins" "${pkgdir}/${_server_root}/plugins"
# Link the log files
mkdir -p "${pkgdir}/var/log/"
install -dm2755 "${pkgdir}/${_server_root}/logs"
@ -40,8 +47,8 @@ package() {
install -D ${srcdir}/./LICENSE_${pkgver}.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
sha512sums="d59eb45880c4f3cfc7e14573f1ad0563d6977d90e8b40e598a5e6101696cc640078aac46fe215722777da5ceee50dbc0a3fe15428aca2087b281563f199efe5b papermc.1.16.5.470.jar
sha512sums="eef416bb3ee52abead6a9813f212d82279f7346effab429271e311b419bc6c0c0fc4b4b419eeaa8e725e979c6b3c974aec01f6311e19a0f1c11121560c1a3e98 papermc.1.17.1.96.jar
c5d1bf85ceb74162aaaf2bcd2d06dc2e3dd2e37c39f0cee2be7c8dbff9970a6aff1e48a43e6d1e83e6a0ac610bd89f62b1279bf27b64afa88d9831a36aebbd3e papermc.initd
8787e4d9c9f4c3e11cee75b714003c42c07ca64867a62f761fe8f4865acbee9ec877d22c1319f20dc6f8eaab8abf4bb43aa5f9d13fc551d8b80549ba90b2fc56 papermc.conf
9b8e267428731ee9255f82a93f1e8674d7e917a0f154bd395cd2280a49aa248a4b8427520b08dbb4b3a74a5471dac0e439eedc8ab94bf2e53bb8d411d2d8a789 papermc.conf
943ba0d4c10173246bdc6497dcedd54da0788f966841c8d3381398711d79f8d5eb07a24ce28f519b6f24f59d99fa9e74bc6bb882059f343df4eeda5de3660ac7 papermc.sh
d4c645a58e1a17a0a1e42856a3cc43097711a05bf3d9f18c77c3bc9874417f223552859042ff00b7d3dda0003f49a9ee568540c2eb24e9f8fbb3c055f3b6e0a5 LICENSE_1.16.5.470.md"
d4c645a58e1a17a0a1e42856a3cc43097711a05bf3d9f18c77c3bc9874417f223552859042ff00b7d3dda0003f49a9ee568540c2eb24e9f8fbb3c055f3b6e0a5 LICENSE_1.17.1.96.md"

View file

@ -6,7 +6,7 @@ SERVER_ROOT="/var/lib/papermc"
BACKUP_DEST="/var/lib/papermc/backup"
BACKUP_PATHS="world" # World paths separated by spaces relative to SERVER_ROOT
KEEP_BACKUPS="10"
GAME_USER="papermc"
GAME_USER="craftbukkit"
MAIN_EXECUTABLE="papermc_server.jar"
SESSION_NAME="papermc"

2
apk/v3.13/main/papermc/papermc.post-install Normal file → Executable file
View file

@ -1,5 +1,5 @@
_game="papermc"
_user="papermc"
_user="craftbukkit"
_server_root="/var/lib/papermc"
echo "The world data is stored under ${_server_root} and the server runs as ${_user} user to increase security."

View file

@ -6,8 +6,8 @@ After=local-fs.target network.target multi-user.target
Type=forking
ExecStart=/usr/bin/papermc start
ExecStop=/usr/bin/papermc stop
User=papermc
Group=papermc
User=craftbukkit
Group=craftbukkit
[Install]
WantedBy=multi-user.target

View file

@ -1,7 +1,7 @@
# Maintainer: Antoine Martin <antoine.martin@protonmail.com>
pkgname=py3-envtpl
pkgver=20180204
pkgrel=3
pkgrel=4
pkgdesc="Render jinja2 templates on the command line using shell environment variables"
url='https://github.com/andreasjansson/envtpl'
arch="noarch"

View file

@ -1,6 +1,6 @@
# Maintainer: Antoine Martin <antoine.martin@protonmail.com>
pkgname=rmfakecloud
pkgver=20210501
pkgver=0.0.4
pkgrel=0
pkgdesc="rmfakecloud is fake of the cloud sync the remarkable tablet is using"
url="https://github.com/ddvk/rmfakecloud"
@ -8,16 +8,20 @@ arch="x86_64"
license="AGPL3"
depends="nginx"
makedepends="go yarn"
source="$pkgname-$pkgver.tar.gz rmfakecloud.conf rmfakecloud.nginx rmfakecloud.initd"
source="
$pkgname-$pkgver.tar.gz::https://github.com/ddvk/rmfakecloud/archive/refs/tags/v${pkgver}.tar.gz
rmfakecloud.conf
rmfakecloud.nginx
rmfakecloud.initd"
_giturl="https://github.com/ddvk/rmfakecloud"
_gittag=c3664274f667b115eb01ba9c277c5cec774d43c1
_gittag=ab6849ec995eee04d428faab504daa77bb8f3f3d
builddir="$srcdir/$pkgname"
subpackages="$pkgname-openrc"
options="!check chmod-clean"
builddir="${srcdir}/${pkgname}-${pkgver}"
snapshot() {
mkdir -p "$srcdir"
cd "${srcdir}"
cd "${builddir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
@ -47,10 +51,10 @@ package() {
install -Dm644 ${srcdir}/rmfakecloud.nginx "$pkgdir"/etc/nginx/conf.d/rmfakecloud.conf
install -Dm644 ${srcdir}/rmfakecloud.conf "$pkgdir"/etc/conf.d/rmfakecloud.conf
install -Dm755 ${srcdir}/rmfakecloud.initd "$pkgdir"/etc/init.d/rmfakecloud
install -Dm777 -d "$pkgdir"/var/lib/rmfakecloud
install -Dm777 -d "$pkgdir"/var/log/rmfakecloud
install -Dm700 -d "$pkgdir"/var/lib/rmfakecloud
install -Dm700 -d "$pkgdir"/var/log/rmfakecloud
}
sha512sums="46bd5df3ad7ccce8e80675380308645d454f03f11f6c0e6e7ee06c41c82c4bdd14578c06f63006f7827bf0c66529f736719542b7d7b8fe0ddb41141c8c7840c9 rmfakecloud-20210501.tar.gz
sha512sums="e9aae02871dff2aa84e48d7bc5711a69b70b6661e9d53b83368115f3772b5557b26bf906b0b4885a5b93b720790fa5b16a5e65a400a94cf120d8c8d5e76af263 rmfakecloud-0.0.4.tar.gz
b9f47b7a0a640b4ec565850f77df7356daa7760ea94499f13350cabc42c2bcb5c8d64188908e46b58b0f4a929776c6f0f42b67de014267a8674fc772c6efa10d rmfakecloud.conf
463f0a922c206dabd0dc4c6e43a3b0269245aeca6b4176c894e45e476aee6466965bd50863e60f619c6829dbf765ba66e3827f5eff06046e0a911fde50ef9e97 rmfakecloud.nginx
32ee768a73a8e16b3d8097f4f5136a5ac0258f6a33ea8bff2e94ae11e658f4ee013f3149bd695d11ad2caeb54c8f82251e568f37683fcd84d5e41c51a34018e9 rmfakecloud.initd"

View file

@ -5,12 +5,12 @@
pkgname=wallabag
pkgver=2.4.2
pkgrel=0
pkgrel=1
pkgdesc='Self hostable application for saving web pages'
arch='noarch'
url='http://www.wallabag.org/'
license='MIT'
depends='php7 php7-gd php7-tidy pcre php7-tokenizer php7-bcmath php7-dom php7-curl php7-session php7-ctype php7-simplexml php7-xml php7-sockets php7-xmlreader composer'
depends='php7 php7-gd php7-tidy pcre php7-tokenizer php7-bcmath php7-dom php7-curl php7-session php7-ctype php7-simplexml php7-xml php7-sockets php7-xmlreader composer php7-intl'
options='!strip'
source="https://static.wallabag.org/releases/wallabag-release-${pkgver}.tar.gz"
builddir="${srcdir}/${pkgver}"

View file

@ -6,7 +6,7 @@
pkgname=yadm
pkgver=3.1.0
pkgrel=0
pkgrel=3
pkgdesc="Yet Another Dotfiles Manager"
arch='noarch'
url="https://github.com/TheLocehiliosan/yadm"
@ -14,7 +14,8 @@ license='GPL3'
depends='gnupg py3-envtpl bash'
source="$pkgname-$pkgver.tar.gz::https://github.com/TheLocehiliosan/${pkgname}/archive/${pkgver}.tar.gz"
builddir="$srcdir/$pkgname-${pkgver}"
subpackages="$pkgname-doc"
subpackages="$pkgname-doc $pkgname-bash-completion $pkgname-zsh-completion"
options="!check"
package(){