diff options
Diffstat (limited to 'user/openjdk8')
-rw-r--r-- | user/openjdk8/APKBUILD | 177 | ||||
-rw-r--r-- | user/openjdk8/icedtea-hotspot-musl-ppc.patch | 201 | ||||
-rw-r--r-- | user/openjdk8/icedtea-hotspot-musl.patch | 4 | ||||
-rw-r--r-- | user/openjdk8/icedtea-jdk-getmntent-buffer.patch | 88 | ||||
-rw-r--r-- | user/openjdk8/icedtea-jdk-includes.patch | 23 | ||||
-rw-r--r-- | user/openjdk8/icedtea-jdk-musl.patch | 32 | ||||
-rw-r--r-- | user/openjdk8/icedtea-jdk-tls-nist-curves.patch | 47 | ||||
-rwxr-xr-x | user/openjdk8/maintain | 162 | ||||
-rw-r--r-- | user/openjdk8/project-autoconf-2xx.patch | 30 |
9 files changed, 445 insertions, 319 deletions
diff --git a/user/openjdk8/APKBUILD b/user/openjdk8/APKBUILD index 8ac3960b4..42b261ee8 100644 --- a/user/openjdk8/APKBUILD +++ b/user/openjdk8/APKBUILD @@ -1,19 +1,19 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=openjdk8 -_icedteaver=3.11.0 +_icedteaver=3.21.0 # pkgver is <JDK version>.<JDK update>.<JDK build> # Check https://icedtea.classpath.org/wiki/Main_Page when updating -pkgver=8.201.08 -pkgrel=0 +pkgver=8.312.07 +pkgrel=1 pkgdesc="Libre Java development kit for Java 8" url="https://icedtea.classpath.org/" -arch="all" +arch="all !armv7" #1007 +options="sover-namecheck" license="GPL-2.0-only" depends="$pkgname-jre java-cacerts" -options="sover-namecheck" makedepends="bash findutils libarchive-tools zip file util-linux libxslt autoconf automake linux-headers sed xz coreutils - openjdk7 ca-certificates libjpeg-turbo-dev cmd:which + fastjar ca-certificates libjpeg-turbo-dev cmd:which nss-dev nss-static cups-dev giflib-dev libpng-dev libxt-dev lcms2-dev libxp-dev libxtst-dev libxinerama-dev zlib-dev libxrender-dev alsa-lib-dev freetype-dev fontconfig-dev @@ -29,7 +29,7 @@ ppc64) _jarch=ppc64 *) _jarch="$CARCH";; esac -_bootstrap_java_home="/usr/lib/jvm/java-1.7-openjdk" +_bootstrap_java_home="$srcdir/boot-home/$CARCH" _java_home="/usr/lib/jvm/java-1.8-openjdk" _jrelib="$_java_home/jre/lib/$_jarch" @@ -38,6 +38,8 @@ _jrelib="$_java_home/jre/lib/$_jarch" ldpath="$_jrelib:$_jrelib/native_threads:$_jrelib/headless:$_jrelib/server:$_jrelib/jli" sonameprefix="$pkgname:" +provides="$pkgname-bootstrap=$pkgver-r$pkgrel" + subpackages="$pkgname-dbg $pkgname-jre-lib:jrelib:noarch $pkgname-jre $pkgname-jre-base:jrebase $pkgname-doc $pkgname-demos" @@ -62,14 +64,66 @@ source="https://icedtea.classpath.org/download/source/icedtea-$_icedteaver.tar.x icedtea-jdk-fix-libjvm-load.patch icedtea-jdk-musl.patch icedtea-jdk-includes.patch - icedtea-jdk-getmntent-buffer.patch icedtea-autoconf-config.patch - icedtea-jdk-tls-nist-curves.patch remove-gawk.patch + + project-autoconf-2xx.patch + " +_targets="aarch64 ppc64 ppc x86_64 pmmx" +for target in $_targets; do + source="$source + https://distfiles.adelielinux.org/source/openjdk/openjdk8-bootstrap-$target.txz " +done builddir="$srcdir/icedtea-$_icedteaver" # secfixes: +# 8.252.09-r0: +# - CVE-2019-2602 +# - CVE-2019-2684 +# - CVE-2019-2698 +# - CVE-2019-2745 +# - CVE-2019-2762 +# - CVE-2019-2766 +# - CVE-2019-2769 +# - CVE-2019-2786 +# - CVE-2019-2816 +# - CVE-2019-2842 +# - CVE-2019-2894 +# - CVE-2019-2933 +# - CVE-2019-2945 +# - CVE-2019-2949 +# - CVE-2019-2958 +# - CVE-2019-2962 +# - CVE-2019-2964 +# - CVE-2019-2973 +# - CVE-2019-2975 +# - CVE-2019-2978 +# - CVE-2019-2981 +# - CVE-2019-2983 +# - CVE-2019-2987 +# - CVE-2019-2988 +# - CVE-2019-2989 +# - CVE-2019-2992 +# - CVE-2019-2999 +# - CVE-2019-7317 +# - CVE-2020-2583 +# - CVE-2020-2590 +# - CVE-2020-2593 +# - CVE-2020-2601 +# - CVE-2020-2604 +# - CVE-2020-2654 +# - CVE-2020-2659 +# - CVE-2020-2754 +# - CVE-2020-2755 +# - CVE-2020-2756 +# - CVE-2020-2757 +# - CVE-2020-2773 +# - CVE-2020-2781 +# - CVE-2020-2800 +# - CVE-2020-2803 +# - CVE-2020-2805 +# - CVE-2020-2830 # 8.201.08-r0: # - CVE-2019-2422 # - CVE-2019-2426 @@ -98,28 +152,28 @@ unpack() { fi mkdir -p "$srcdir" msg "Unpacking sources..." - tar -C "$srcdir" -Jxf icedtea-$_icedteaver.tar.xz + tar -C "$srcdir" -xJf icedtea-$_icedteaver.tar.xz + tar -C "$srcdir" -xJf openjdk8-bootstrap-$CARCH.txz \ + || die "Architecture $CARCH not bootstrapped" } prepare() { - cd "$builddir" - - local ver_u="$(sed -En 's/^\s*JDK_UPDATE_VERSION\s*=\s*(\S+).*/\1/p' acinclude.m4)" - local ver_b="$(sed -En 's/^\s*BUILD_VERSION\s*=\s*b(\S+).*/\1/p' acinclude.m4)" - [ "${pkgver#*.}" = "$ver_u.$ver_b" ] \ - || die "Version mismatch, source is 8.$ver_u.$ver_b, but abuild defines $pkgver!" + _ver_u="$(sed -En 's/^\s*JDK_UPDATE_VERSION\s*=\s*(\S+).*/\1/p' acinclude.m4)" + _ver_b="$(sed -En 's/^\s*BUILD_VERSION\s*=\s*b(\S+).*/\1/p' acinclude.m4)" + [ "${pkgver#*.}" = "$_ver_u.$_ver_b" ] \ + || die "Version mismatch, source is 8.$_ver_u.$_ver_b, but abuild defines $pkgver!" # Busybox sha256 does not support longopts. sed -e "s/--check/-c/g" -i Makefile.am - local patch; for patch in $source; do - case $patch in + for _patch in $source; do + case $_patch in icedtea-*.patch) - cp ../$patch patches + cp ../$_patch patches ;; *.patch) - msg "Applying patch $patch" - patch -p1 -i "$srcdir"/$patch + msg "Applying patch $_patch" + patch -p1 -i "$srcdir"/$_patch ;; esac done @@ -136,17 +190,16 @@ build() { fi DISTRIBUTION_PATCHES="" - local patch; for patch in $source; do - case $patch in + for _patch in $source; do + case $_patch in icedtea-*.patch) - DISTRIBUTION_PATCHES="$DISTRIBUTION_PATCHES patches/$patch" + DISTRIBUTION_PATCHES="$DISTRIBUTION_PATCHES patches/$_patch" ;; esac done export DISTRIBUTION_PATCHES echo "icedtea patches: $DISTRIBUTION_PATCHES" - cd "$builddir" bash ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -168,11 +221,12 @@ build() { --with-jdk-src-zip="$srcdir/jdk-$_dropsver.tar.xz" \ --with-langtools-src-zip="$srcdir/langtools-$_dropsver.tar.xz" \ --with-nashorn-src-zip="$srcdir/nashorn-$_dropsver.tar.xz" \ - --with-pax=paxmark \ --with-jdk-home="$_bootstrap_java_home" \ --with-pkgversion="Adelie ${pkgver}-r${pkgrel}" \ --enable-nss \ - --enable-non-nss-curves + --enable-non-nss-curves \ + --disable-jfr `# configure error without this` \ + ; make } @@ -184,8 +238,6 @@ check() { } package() { - cd "$builddir" - mkdir -p "$pkgdir"/$_java_home cp -a openjdk.build/images/j2sdk-image/* "$pkgdir"/$_java_home/ @@ -196,9 +248,6 @@ package() { # running `java -Xshare:dump`. rm -f "$pkgdir"/$_jrelib/server/classes.jsa - # pax mark again (due to fakeroot xattr handling bug) - ./pax-mark-vm "$pkgdir"/$_java_home true - # symlink to shared java cacerts store rm -f "$pkgdir"/$_java_home/jre/lib/security/cacerts ln -sf /etc/ssl/certs/java/cacerts \ @@ -209,8 +258,7 @@ jrelib() { pkgdesc="OpenJDK 8 Java Runtime (class libraries)" depends="" - local file dir - for file in jre/lib/images \ + for _file in jre/lib/images \ jre/lib/*.jar \ jre/lib/security \ jre/lib/ext/*.jar \ @@ -219,18 +267,17 @@ jrelib() { jre/THIRD_PARTY_README \ jre/LICENSE; do - dir=${file%/*} - mkdir -p "$subpkgdir"/$_java_home/$dir - mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir + _dir=${_file%/*} + mkdir -p "$subpkgdir"/$_java_home/$_dir + mv "$pkgdir"/$_java_home/$_file "$subpkgdir"/$_java_home/$_dir done } jre() { pkgdesc="OpenJDK 8 Java Runtime" - local file dir mkdir -p "$subpkgdir" - for file in jre/bin/policytool \ + for _file in jre/bin/policytool \ bin/appletviewer \ bin/policytool \ jre/lib/$_jarch/libawt_xawt.so \ @@ -239,13 +286,10 @@ jre() { jre/lib/$_jarch/libjsoundalsa.so \ jre/lib/$_jarch/libsplashscreen.so; do - dir=${file%/*} - mkdir -p "$subpkgdir"/$_java_home/$dir - mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir + _dir=${_file%/*} + mkdir -p "$subpkgdir"/$_java_home/$_dir + mv "$pkgdir"/$_java_home/$_file "$subpkgdir"/$_java_home/$_dir done - - # Pax mark again (due to fakeroot xattr handling bug). - "$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true } jrebase() { @@ -258,16 +302,13 @@ jrebase() { mv "$pkgdir"/$_java_home/lib/$_jarch/jli \ "$subpkgdir"/$_java_home/lib/$_jarch/ - local file; for file in java orbd rmid servertool unpack200 keytool \ + for _file in java orbd rmid servertool unpack200 keytool \ pack200 rmiregistry tnameserv; do - mv "$pkgdir"/$_java_home/bin/$file "$subpkgdir"/$_java_home/bin/ + mv "$pkgdir"/$_java_home/bin/$_file "$subpkgdir"/$_java_home/bin/ done # Rest of the jre subdir (which were not taken by -jre subpkg). mv "$pkgdir"/$_java_home/jre "$subpkgdir"/$_java_home/ - - # Pax mark again (due to fakeroot xattr handling bug). - "$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true } doc() { @@ -286,24 +327,28 @@ demos() { "$subpkgdir"/$_java_home/ } -sha512sums="a71c9318d49077f8ae27f5c3e0b61df0709eded241f557c886f6b93aa98c13ad78f713d1286da286989bf62866dfff7538ad783eb804a705a160cbc096dea851 icedtea-3.11.0.tar.xz -fc3faa7d7b9531f10c40241d89c36854043921f6f1a0851f284bcab36fc54fb0bb8cf8365dd4b2fb22b3ee8ddb8ed4a79e0807f79cb95b4b00f164993f1acc0b openjdk-3.11.0.tar.xz -9b8a44dda0bbfba8dc0d659e0fabf22e84b9931518e4b199a238faa103cbc4ed814c97f0f38f0aed263846b46fc7eab4500ba9759503373083e12cb8b5b364b5 corba-3.11.0.tar.xz -9eba0f6ada2ae8adc1791a91ceb4fba9bd06aee0626cd1b4310ff16c7c8006045fed5fb7f109e490395b70695be4e6bfd6f1f5cbcdb095fb17abf123012a03de jaxp-3.11.0.tar.xz -ce5f0c2aced1af59f002dc9dc6cba4b9332167e9e019a3040267901ef7f325e05b8c99ed1f276b88ddb4e43cdd1b0c456e0c4dc2222ae6b3800c0502ffa840de jaxws-3.11.0.tar.xz -411508ed91f14ae1c51ea54de72a943db222ff572f3991631fe1a1fa97f9bb42da1e01ca98893f7236b4b44bae2917fc3f8622d7f94a085be30d437451acd272 jdk-3.11.0.tar.xz -363c376848870c6c28415967561c4b151f1256c38a315fabc69c90425f5255224182045349a00c9433db52c416b7ebffedaa4825c980460541a3f9338adbaa5e langtools-3.11.0.tar.xz -13fa35f4a4fe01b3da4efb8476c0cb3482a36596eb422f2ad958a4c51efc286962ac3123a75853e84c4db477ac064a0fd3ee5e03f1ea0ec4f7e2c8ac07aa2d0e hotspot-3.11.0.tar.xz -2b46a8599d530a351522420cae8ac780cd2e64a6d7adbff87397a178f12f0a992bccd0f56435582dbd10be2157d4a4540c41b3dca488566162eed680102e58a9 nashorn-3.11.0.tar.xz -c0776ff52e11a353fee29419319cd9e1fc4e5bb922832547616e8499fd52852a935a6a6fb93b49a67ab7b3fd2f7a63320f917e354cc7123220139e80694a7b5a icedtea-hotspot-musl.patch -e5cf4d70f96fc1e72ae8b97a887adb96092ff36584711cbb8de9d9fa9e859cb8731d638838de0d9591239fc44ffe5c74422d1842bd9f10a0c00dff1627bdeeef icedtea-hotspot-musl-ppc.patch +sha512sums="874f91f3c3311d7017efb91aaff4e2fb660f55c58a626bcf5b120b7158df15e9b94abda7cd28f9620ad76c50bfa89cc8c1d251c193404c0db51ff1430167b018 icedtea-3.21.0.tar.xz +6a1706dfcb5e5d79191c01db6da30ca0ca48cea628a26a3a35f6e43c710091e25c97ec95122e8bc19b4ac69ede27a8dae37b49e1a7e4db07a635ded69e2e0336 openjdk-3.21.0.tar.xz +55110b92c6eddeb29eab97cbe644d8cc171a489b9fa806c81e4af88a1e5e3e6776fb97371715782935222944464f68e7d6783c46bd0d0de5659123f46c577a7a corba-3.21.0.tar.xz +ff14c9b63cee2a7b9213872b8710b1c5b901ccaf4122c8ddf5d8437d1cdd35cf9af50f461d05f004b74802ba8a21c7e9f288ec080b2b5f7daad065d40dc39258 jaxp-3.21.0.tar.xz +e21bd36b6cfa92f648856532647150243f2184943dc6f5003fea02cf69aa9b6a94fb18d6478db28d5ee5e3af9b780122c0539fd3207cf4dfcb69a042835c13d6 jaxws-3.21.0.tar.xz +06385f14d093be250aa530d0659576d75aed57b0264ec7329d6b2c9309cf4ed660a9ecbfb6f199868ae23aedfbdb97036fccda501c00e9d2e3b1562c92b0ed37 jdk-3.21.0.tar.xz +949366138278104fc06452d8227bbe5d0829a9124503928cab34e5e9df37e25d25964a5c755e46d9ca74e63f1b318b2e3366f8f08e144524a8043bc2a7ca626e langtools-3.21.0.tar.xz +678f6c53db5858ba828e063eeeddb727dbeb0586ff26a4287f9735dc01ad00ddcd9f41fa65343b81d5f5c512a944f47a447d4bdc929ca26ba78a68a7e3dfc1cd hotspot-3.21.0.tar.xz +eda17f94ed2f34dd5bc4670dd3340d50de956723213948fd15963b0a589433bbe2e0ba8be7761974754b6a5d875ef58c31839daa6fef7215af552842f787bb44 nashorn-3.21.0.tar.xz +bfbeccc931b9eab04fca94167b7569af26195297130e2effd9175d33b74dec3dc5727fea6e0cbf3cce21ba09641ddd868179544d3fabe8b128baaaccb9c2711c icedtea-hotspot-musl.patch +86e77c1e5e8a48f121e608dce5eafad7a714e4029b55dbd554c2c94633b49a4239f71a40a41273b54d62fcdcfdee21340c8b85f96001cf15b719b02a520e8d9a icedtea-hotspot-musl-ppc.patch 19459dbb922f5a71cd15b53199481498626a783c24f91d2544d55b7dddd2cdb34a64bbf0226b99548612dd1743af01b3f9ff32c30abbbc90ce727ca2dbbbd1f9 icedtea-hotspot-noagent-musl.patch f6365cfafafa008bd6c1bf0ccec01a63f8a39bd1a8bc87baa492a27234d47793ba02d455e5667a873ef50148df3baaf6a8421e2da0b15faac675867da714dd5f icedtea-jdk-execinfo.patch 48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774 icedtea-jdk-fix-ipv6-init.patch b135991c76b0db8fa7c363e0903624668e11eda7b54a943035c214aa4d7fc8c3e8110ed200edcec82792f3c9393150a9bd628625ddf7f3e55720ff163fbbb471 icedtea-jdk-fix-libjvm-load.patch -1fbc32ddc528c7c0099dbc1e48f88d29dccf55e7b8997793aa1d3d8408003a1223d898cca4248e1a12d343d3feec5144f875e6cdac8460d763c73ab3ad7e49f9 icedtea-jdk-musl.patch -e8d9f1b867bf4fc84aa00d1237b264bcf503b1ed5f34735e14b0b747a728953fe0051a5af69ed058d377fbf65d8be1ed9e38fe5fc6edb2d50b31f34bf3ba91dc icedtea-jdk-includes.patch -7e6fa46b10c630517bfa46943858aea1d032c12d32ba3fcb7a2143ae1e896c34fa4cb8f925af80cb19f8e29149b835aa054adfd30ebb00539f6c78588d6f5211 icedtea-jdk-getmntent-buffer.patch +17c78db081a85e37721c23e0c0e7cab85e2201a0969bd4858cb90375b97d1703c9bf867f8ac02f6b33f9775b78bae41e38223b7a887918d4a6c9f29b75f3de28 icedtea-jdk-musl.patch +974fb54532b7e7d738f4278187fc6bd9f9b2d99866b94f68a617ee4911c89a3b8cc41ecfdcaefecf9157492d006b1844b6b0b41ac4209d84f9e8d13c9e485dd3 icedtea-jdk-includes.patch 662d662d0a7a84be2978e921317589f212f3ba3b7629527ba0f1140b5ac4c1024893e0ed176211688ed1a4505968c4befc841ed57ffcdbb9d355c2cb0571b167 icedtea-autoconf-config.patch -9ea7ac942baf29cc619bc2e1acd59201b9f6d38f39a517b495d7613aec746459200c81afb57c5fcdcb856f6bc8b33f7566c8593fed07e5c73f43e08f1072d458 icedtea-jdk-tls-nist-curves.patch -b0f6d07c6a949acdc8b4a25bf924f134f468e162f01dd440fd4ca80769fb84a0a54210f93efbe88012404fe3db6701aad31cdbc772bc054ad69021c37db5538c remove-gawk.patch" +b0f6d07c6a949acdc8b4a25bf924f134f468e162f01dd440fd4ca80769fb84a0a54210f93efbe88012404fe3db6701aad31cdbc772bc054ad69021c37db5538c remove-gawk.patch +6dd39baca14f088d0b2157308e3d9657ab64ecdb7daab09137486e212e3a8c53f6deae6167b6212217c6ef29c1406347e21ca6bb193ced9ebeb399aeb06bda4b project-autoconf-2xx.patch +2bbf44ce9145554829c9645e12645fed671201a2af73891d0552295a0a38d45d2d98dccf7db888926450481537e9aebaf4fe12701494e432af10b3ed79bf524e openjdk8-bootstrap-aarch64.txz +2c0aa356ad015e4176250eda49060f73fef85e8cd457144ab131c03ff79acc5721062755c60b0efa8058602244e2c4f79ec0985e219ff37a4fc933c485a070ce openjdk8-bootstrap-ppc64.txz +c4c5d65b41a5928b0583c5a7a82530f802380d6104dfa60c0613682e29193760505ca06427a30613d72a9d45609038e5192440f799d348ce89f213ede0659d4a openjdk8-bootstrap-ppc.txz +c4e6e620f43a9b71e06a616853abce95452044147ca26ac2f484d1e4e4c23f03682ad650a77968f96d88a554832b341f6aa6e7cb059ae87f99349fe8d68a5d6c openjdk8-bootstrap-x86_64.txz +9281ac1dee1bf35fbdb320cac615de1bfd731853cc1ade59896341f28a2d126f3106fffcdda25375e8c96d224cbe60962e6862893bfc7fff1fe2efbf3900e06c openjdk8-bootstrap-pmmx.txz" diff --git a/user/openjdk8/icedtea-hotspot-musl-ppc.patch b/user/openjdk8/icedtea-hotspot-musl-ppc.patch index eca684884..6d8c9586d 100644 --- a/user/openjdk8/icedtea-hotspot-musl-ppc.patch +++ b/user/openjdk8/icedtea-hotspot-musl-ppc.patch @@ -1,13 +1,93 @@ ---- openjdk.orig/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp +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. + +--- openjdk/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp ++++ openjdk/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +@@ -1243,7 +1243,11 @@ bool MacroAssembler::is_load_from_polling_page(int instruction, void* ucontext, + // 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; + } +@@ -1264,15 +1268,24 @@ bool MacroAssembler::is_memory_serialization(int instruction, JavaThread* thread + int rb = inv_rb_field(instruction); + + // look up content of ra and rb in ucontext ++#if defined(__GLIBC__) || defined(__UCLIBC__) + address ra_val=(address)uc->uc_mcontext.regs->gpr[ra]; + long rb_val=(long)uc->uc_mcontext.regs->gpr[rb]; ++#else // Musl ++ address ra_val=(address)uc->uc_mcontext.gp_regs[ra]; ++ long rb_val=(long)uc->uc_mcontext.gp_regs[rb]; ++#endif + return os::is_memory_serialize_page(thread, ra_val+rb_val); + } else if (is_stw(instruction) || is_stwu(instruction)) { + int ra = inv_ra_field(instruction); + int d1 = inv_d1_field(instruction); + + // look up content of ra in ucontext ++#if defined(__GLIBC__) || defined(__UCLIBC__) + address ra_val=(address)uc->uc_mcontext.regs->gpr[ra]; ++#else // Musl ++ address ra_val=(address)uc->uc_mcontext.gp_regs[ra]; ++#endif + return os::is_memory_serialize_page(thread, ra_val+d1); + } else { + return false; +@@ -1335,11 +1348,20 @@ address MacroAssembler::get_stack_bang_address(int instruction, void *ucontext) + || (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 + } +--- openjdk/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp +++ openjdk/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp -@@ -110,11 +110,19 @@ +@@ -75,6 +75,10 @@ + # include <poll.h> + # include <ucontext.h> + ++#if ! (defined(__GLIBC__) || defined(__UCLIBC__)) ++# include <asm/ptrace.h> ++#endif ++ + + address os::current_stack_pointer() { + intptr_t* csp; +@@ -110,11 +114,19 @@ address os::Linux::ucontext_get_pc(ucontext_t * uc) { // it because the volatile registers are not needed to make setcontext() work. // Hopefully it was zero'd out beforehand. guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context"); +#if defined(__GLIBC__) || defined(__UCLIBC__) return (address)uc->uc_mcontext.regs->nip; +#else // Musl -+ return (address)uc->uc_mcontext.gp_regs[32]; ++ return (address)uc->uc_mcontext.gp_regs[PT_NIP]; +#endif } @@ -20,55 +100,55 @@ } intptr_t* os::Linux::ucontext_get_fp(ucontext_t * uc) { -@@ -213,7 +221,11 @@ +@@ -213,7 +225,11 @@ JVM_handle_linux_signal(int sig, if (uc) { address const pc = os::Linux::ucontext_get_pc(uc); if (pc && StubRoutines::is_safefetch_fault(pc)) { +#if defined(__GLIBC__) || defined(__UCLIBC__) uc->uc_mcontext.regs->nip = (unsigned long)StubRoutines::continuation_for_safefetch_fault(pc); +#else // Musl -+ uc->uc_mcontext.gp_regs[32] = (unsigned long)StubRoutines::continuation_for_safefetch_fault(pc); ++ uc->uc_mcontext.gp_regs[PT_NIP] = (unsigned long)StubRoutines::continuation_for_safefetch_fault(pc); +#endif return true; } } -@@ -364,7 +376,11 @@ +@@ -364,7 +380,11 @@ JVM_handle_linux_signal(int sig, // continue at the next instruction after the faulting read. Returning // garbage from this read is ok. thread->set_pending_unsafe_access_error(); +#if defined(__GLIBC__) || defined(__UCLIBC__) uc->uc_mcontext.regs->nip = ((unsigned long)pc) + 4; +#else // Musl -+ uc->uc_mcontext.gp_regs[32] = ((unsigned long)pc) + 4; ++ uc->uc_mcontext.gp_regs[PT_NIP] = ((unsigned long)pc) + 4; +#endif return true; } } -@@ -383,7 +399,11 @@ +@@ -383,7 +403,11 @@ JVM_handle_linux_signal(int sig, // continue at the next instruction after the faulting read. Returning // garbage from this read is ok. thread->set_pending_unsafe_access_error(); +#if defined(__GLIBC__) || defined(__UCLIBC__) uc->uc_mcontext.regs->nip = ((unsigned long)pc) + 4; +#else // Musl -+ uc->uc_mcontext.gp_regs[32] = ((unsigned long)pc) + 4; ++ uc->uc_mcontext.gp_regs[PT_NIP] = ((unsigned long)pc) + 4; +#endif return true; } } -@@ -406,7 +426,11 @@ +@@ -406,7 +430,11 @@ JVM_handle_linux_signal(int sig, if (stub != NULL) { // Save all thread context in case we need to restore it. if (thread != NULL) thread->set_saved_exception_pc(pc); +#if defined(__GLIBC__) || defined(__UCLIBC__) uc->uc_mcontext.regs->nip = (unsigned long)stub; +#else -+ uc->uc_mcontext.gp_regs[32] = (unsigned long)stub; ++ uc->uc_mcontext.gp_regs[PT_NIP] = (unsigned long)stub; +#endif return true; } -@@ -564,6 +588,7 @@ +@@ -564,6 +592,7 @@ void os::print_context(outputStream *st, void *context) { ucontext_t* uc = (ucontext_t*)context; st->print_cr("Registers:"); @@ -76,26 +156,24 @@ 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); -@@ -572,8 +597,18 @@ +@@ -572,6 +601,16 @@ void os::print_context(outputStream *st, void *context) { st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]); if (i % 3 == 2) st->cr(); } +#else // Musl -+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[32]); -+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[36]); -+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[35]); - st->cr(); ++ 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(); + st->cr(); - intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc); - st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp)); -@@ -600,7 +635,11 @@ +@@ -600,7 +639,11 @@ void os::print_register_info(outputStream *st, void *context) { // this is only for the "general purpose" registers for (int i = 0; i < 32; i++) { st->print("r%-2d=", i); @@ -107,63 +185,42 @@ } st->cr(); } ---- openjdk.orig/hotspot.orig/src/cpu/ppc/vm/macroAssembler_ppc.cpp -+++ openjdk/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp -@@ -1242,7 +1242,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; - } -@@ -1263,15 +1267,24 @@ - int rb = inv_rb_field(instruction); +--- openjdk/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp ++++ openjdk/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp +@@ -27,6 +27,10 @@ + #include "runtime/frame.inline.hpp" + #include "runtime/thread.hpp" - // look up content of ra and rb in ucontext -+#if defined(__GLIBC__) || defined(__UCLIBC__) - address ra_val=(address)uc->uc_mcontext.regs->gpr[ra]; - long rb_val=(long)uc->uc_mcontext.regs->gpr[rb]; -+#else // Musl -+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra]; -+ long rb_val=(long)uc->uc_mcontext.gp_regs[rb]; ++#if ! (defined(__GLIBC__) || defined(__UCLIBC__)) ++#include <asm/ptrace.h> +#endif - return os::is_memory_serialize_page(thread, ra_val+rb_val); - } else if (is_stw(instruction) || is_stwu(instruction)) { - int ra = inv_ra_field(instruction); - int d1 = inv_d1_field(instruction); ++ + bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) { + assert(this->is_Java_thread(), "must be JavaThread"); - // look up content of ra in ucontext -+#if defined(__GLIBC__) || defined(__UCLIBC__) - address ra_val=(address)uc->uc_mcontext.regs->gpr[ra]; -+#else // Musl -+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra]; -+#endif - return os::is_memory_serialize_page(thread, ra_val+d1); - } else { - return false; -@@ -1334,11 +1347,20 @@ - || (is_stdu(instruction) && rs == 1)) { - int ds = inv_ds_field(instruction); - // return banged address +@@ -42,8 +46,13 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, + // if we were running Java code when SIGPROF came in. + if (isInJava) { + ucontext_t* uc = (ucontext_t*) ucontext; +#if defined(__GLIBC__) || defined(__UCLIBC__) - return ds+(address)uc->uc_mcontext.regs->gpr[ra]; + frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/], + (address)uc->uc_mcontext.regs->nip); +#else // Musl -+ return ds+(address)uc->uc_mcontext.gp_regs[ra]; ++ frame ret_frame((intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/], ++ (address)uc->uc_mcontext.gp_regs[PT_NIP]); +#endif - } else if (is_stdux(instruction) && rs == 1) { - int rb = inv_rb_field(instruction); + + if (ret_frame.pc() == NULL) { + // ucontext wasn't useful +@@ -56,7 +65,11 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, + if (m == NULL || !m->is_valid_method()) return false; + if (!Metaspace::contains((const void*)m)) return false; + +#if defined(__GLIBC__) || defined(__UCLIBC__) - address sp = (address)uc->uc_mcontext.regs->gpr[1]; - long rb_val = (long)uc->uc_mcontext.regs->gpr[rb]; + uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/]; +#else // Musl -+ address sp = (address)uc->uc_mcontext.gp_regs[1]; -+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb]; ++ uint64_t reg_bcp = uc->uc_mcontext.gp_regs[14/*R14_bcp*/]; +#endif - return ra != 1 || rb_val >= 0 ? NULL // not a stack bang - : sp + rb_val; // banged address - } + uint64_t istate_bcp = istate->bcp; + uint64_t code_start = (uint64_t)(m->code_base()); + uint64_t code_end = (uint64_t)(m->code_base() + m->code_size()); diff --git a/user/openjdk8/icedtea-hotspot-musl.patch b/user/openjdk8/icedtea-hotspot-musl.patch index 6cfb3e606..5d6f688a1 100644 --- a/user/openjdk8/icedtea-hotspot-musl.patch +++ b/user/openjdk8/icedtea-hotspot-musl.patch @@ -82,8 +82,8 @@ index d2c10e0..20f657f 100644 -# include <fpu_control.h> +# include <linux/types.h> /* provides __u64 */ - #ifdef BUILTIN_SIM - #define REG_SP REG_RSP + #define REG_FP 29 + diff --git openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index 38388cb..2505ba8 100644 --- openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp diff --git a/user/openjdk8/icedtea-jdk-getmntent-buffer.patch b/user/openjdk8/icedtea-jdk-getmntent-buffer.patch deleted file mode 100644 index 075a9d423..000000000 --- a/user/openjdk8/icedtea-jdk-getmntent-buffer.patch +++ /dev/null @@ -1,88 +0,0 @@ -Give a much bigger buffer to getmntent_r. - -https://bugs.alpinelinux.org/issues/7093 - -diff --git a/openjdk/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c b/openjdk/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c -index c8500db..d0b85d6 100644 ---- openjdk/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c -+++ openjdk/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c -@@ -33,6 +33,7 @@ - #include <dlfcn.h> - #include <errno.h> - #include <mntent.h> -+#include <limits.h> - - #include "sun_nio_fs_LinuxNativeDispatcher.h" - -@@ -173,8 +174,8 @@ Java_sun_nio_fs_LinuxNativeDispatcher_getmntent(JNIEnv* env, jclass this, - jlong value, jobject entry) - { - struct mntent ent; -- char buf[1024]; -- int buflen = sizeof(buf); -+ char *buf = NULL; -+ const size_t buflen = PATH_MAX * 4; - struct mntent* m; - FILE* fp = jlong_to_ptr(value); - jsize len; -@@ -183,10 +184,17 @@ Java_sun_nio_fs_LinuxNativeDispatcher_getmntent(JNIEnv* env, jclass this, - char* dir; - char* fstype; - char* options; -+ jint res = -1; - -- m = getmntent_r(fp, &ent, (char*)&buf, buflen); -- if (m == NULL) -+ buf = malloc(buflen); -+ if (buf == NULL) { -+ JNU_ThrowOutOfMemoryError(env, "native heap"); - return -1; -+ } -+ m = getmntent_r(fp, &ent, buf, buflen); -+ if (m == NULL) -+ goto out; -+ - name = m->mnt_fsname; - dir = m->mnt_dir; - fstype = m->mnt_type; -@@ -195,32 +203,35 @@ Java_sun_nio_fs_LinuxNativeDispatcher_getmntent(JNIEnv* env, jclass this, - len = strlen(name); - bytes = (*env)->NewByteArray(env, len); - if (bytes == NULL) -- return -1; -+ goto out; - (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name); - (*env)->SetObjectField(env, entry, entry_name, bytes); - - len = strlen(dir); - bytes = (*env)->NewByteArray(env, len); - if (bytes == NULL) -- return -1; -+ goto out; - (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir); - (*env)->SetObjectField(env, entry, entry_dir, bytes); - - len = strlen(fstype); - bytes = (*env)->NewByteArray(env, len); - if (bytes == NULL) -- return -1; -+ goto out; - (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype); - (*env)->SetObjectField(env, entry, entry_fstype, bytes); - - len = strlen(options); - bytes = (*env)->NewByteArray(env, len); - if (bytes == NULL) -- return -1; -+ goto out; - (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options); - (*env)->SetObjectField(env, entry, entry_options, bytes); - -- return 0; -+ res = 0; -+out: -+ free(buf); -+ return res; - } - - JNIEXPORT void JNICALL diff --git a/user/openjdk8/icedtea-jdk-includes.patch b/user/openjdk8/icedtea-jdk-includes.patch index 6443a1973..5acbb9efb 100644 --- a/user/openjdk8/icedtea-jdk-includes.patch +++ b/user/openjdk8/icedtea-jdk-includes.patch @@ -53,17 +53,6 @@ /* O Flags */ ---- openjdk.orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c -+++ openjdk/jdk/src/solaris/native/java/net/PlainSocketImpl.c -@@ -28,7 +28,7 @@ - #include <sys/types.h> - #include <sys/socket.h> - #if defined(__linux__) && !defined(USE_SELECT) --#include <sys/poll.h> -+#include <poll.h> - #endif - #include <netinet/tcp.h> /* Defines TCP_NODELAY, needed for 2.6 */ - #include <netinet/in.h> --- openjdk.orig/jdk/src/solaris/native/java/net/bsd_close.c +++ openjdk/jdk/src/solaris/native/java/net/bsd_close.c @@ -36,7 +36,7 @@ @@ -88,14 +77,14 @@ * Stack allocated by thread when doing blocking operation --- openjdk.orig/jdk/src/solaris/native/java/net/net_util_md.h +++ openjdk/jdk/src/solaris/native/java/net/net_util_md.h -@@ -33,7 +33,7 @@ - #include <unistd.h> - - #ifndef USE_SELECT +@@ -27,7 +27,7 @@ + #define NET_UTILS_MD_H + + #include <netdb.h> -#include <sys/poll.h> +#include <poll.h> - #endif - + #include <sys/socket.h> + int NET_Timeout(int s, long timeout); --- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c +++ openjdk/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c diff --git a/user/openjdk8/icedtea-jdk-musl.patch b/user/openjdk8/icedtea-jdk-musl.patch index 97946ba42..7dbd6872c 100644 --- a/user/openjdk8/icedtea-jdk-musl.patch +++ b/user/openjdk8/icedtea-jdk-musl.patch @@ -47,32 +47,10 @@ diff -ru openjdk.orig/jdk/src/solaris/native/java/net/Inet4AddressImpl.c openjdk #define HAS_GLIBC_GETHOSTBY_R 1 #endif -diff -ru openjdk.orig/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c openjdk/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c ---- openjdk.orig/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2017-01-25 04:22:03.000000000 +0000 -+++ openjdk/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2017-02-06 11:23:47.047832009 +0000 -@@ -41,7 +41,6 @@ - #endif - #ifdef __linux__ - #include <unistd.h> --#include <sys/sysctl.h> - #include <sys/utsname.h> - #include <netinet/ip.h> - -diff -ru openjdk.orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c openjdk/jdk/src/solaris/native/java/net/PlainSocketImpl.c ---- openjdk.orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c 2017-01-25 04:22:03.000000000 +0000 -+++ openjdk/jdk/src/solaris/native/java/net/PlainSocketImpl.c 2017-02-06 11:23:47.047832009 +0000 -@@ -43,7 +43,6 @@ - #endif - #ifdef __linux__ - #include <unistd.h> --#include <sys/sysctl.h> - #endif - - #include "jvm.h" diff -ru openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c openjdk/jdk/src/solaris/native/java/net/linux_close.c ---- openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c 2017-01-25 04:22:03.000000000 +0000 -+++ openjdk/jdk/src/solaris/native/java/net/linux_close.c 2017-02-06 11:23:47.047832009 +0000 -@@ -56,7 +56,7 @@ +--- openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c 2020-04-29 12:33:10.000000000 +0000 ++++ openjdk/jdk/src/solaris/native/java/net/linux_close.c 2020-05-02 19:35:51.590000000 +0000 +@@ -58,7 +58,7 @@ typedef struct { /* * Signal to unblock thread */ @@ -80,8 +58,8 @@ diff -ru openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c openjdk/jdk/ +static int sigWakeup; /* - * The fd table and the number of file descriptors -@@ -95,6 +95,9 @@ + * fdTable holds one entry per file descriptor, up to a certain +@@ -147,6 +147,9 @@ static void __attribute((constructor)) i /* * Setup the signal handler */ diff --git a/user/openjdk8/icedtea-jdk-tls-nist-curves.patch b/user/openjdk8/icedtea-jdk-tls-nist-curves.patch deleted file mode 100644 index 75fb3af8c..000000000 --- a/user/openjdk8/icedtea-jdk-tls-nist-curves.patch +++ /dev/null @@ -1,47 +0,0 @@ -Bug #7404 TLS negotiation error in OpenJDK 8 u131 - -Fixes an OpenJDK 8 regression discovered in docker-library/openjdk#115 -on Alpine Linux 3.5 (u121) and 3.6 (u131) that causes TLS negotiation -errors for some clients. - -Root cause appears to be OpenJDK announcing support for NIST curves the -underlying NSS library does doesn't. This patch limits OpenJDK's -announcement to elliptic curves 23 (secp256r1), 24 (secp384r1), and 25 -(secp521r1). - -Related issues: - -* https://github.com/docker-library/openjdk/issues/115 -* https://bugs.alpinelinux.org/issues/7404 -* https://access.redhat.com/discussions/2339811 -* https://bugzilla.redhat.com/show_bug.cgi?id=1022017 -* https://bugzilla.redhat.com/show_bug.cgi?id=1348525 - ---- openjdk.orig/jdk/src/share/classes/sun/security/ssl/EllipticCurvesExtension.java 2017-05-08 20:03:50.000000000 -0700 -+++ openjdk/jdk/src/share/classes/sun/security/ssl/EllipticCurvesExtension.java 2017-06-14 13:37:00.000000000 -0700 -@@ -168,21 +168,10 @@ - "contains no supported elliptic curves"); - } - } else { // default curves -- int[] ids; -- if (requireFips) { -- ids = new int[] { -- // only NIST curves in FIPS mode -- 23, 24, 25, 9, 10, 11, 12, 13, 14, -- }; -- } else { -- ids = new int[] { -- // NIST curves first -- 23, 24, 25, 9, 10, 11, 12, 13, 14, -- // non-NIST curves -- 22, -- }; -- } -- -+ int[] ids = new int[] { -+ // NSS currently only supports these three NIST curves -+ 23, 24, 25 -+ }; - idList = new ArrayList<>(ids.length); - for (int curveId : ids) { - if (isAvailableCurve(curveId)) { diff --git a/user/openjdk8/maintain b/user/openjdk8/maintain new file mode 100755 index 000000000..41133cf7f --- /dev/null +++ b/user/openjdk8/maintain @@ -0,0 +1,162 @@ +#!/bin/sh -e + +## +# The purpose of this script is for reproducibility, +# not to be used except for creation of the bootstrap +# tarballs and to document how they were created for +# the RC3 release. This is a TEMPORARY WORKAROUND so +# that we do not unnecessarily postpone RC3 over Java. +# +# Files are uploaded to: +# +# * https://distfiles.adelielinux.org/source/openjdk/ +# +# This script downloads RC2 'openjdk8' .apk files, +# extracts some JVM bits, and produces tarballs for +# bootstrapping this package, suitable for upload to +# https://distfiles.adelielinux.org/source/openjdk/. +# +# Shared libraries may be added for compatibility to +# avoid using system-provided libraries which may be +# incompatible with the existing binaries. +# +# Note: checksums may vary between 'tar' versions or +# implementations; please do not rely on this. The +# output has been verified by 'diff -qr', may differ +# in packing order, compression, or headers only. +# +# Based on https://git.adelielinux.org/-/snippets/172. +# +HERE="$(dirname $(readlink -f ${0}))"; + + +## +# mirror for input binaries +# +host=https://distfiles.adelielinux.org; +from=1.0-rc2; + + +## +# supported architectures +# +# Note: empty or broken tarballs may be created for +# architectures that are missing ingredients. We do +# not treat this as an error; we want to have a full +# set of bootstrap tarballs, fix as needed, and not +# have to update code in multiple places. +# +arch="aarch64 armv7 ppc64 ppc x86_64 pmmx"; + + +## +# packages to fetch +# +# Note: order is important; we assume tree structure +# during the manipulation stage. Does not matter for +# extraction, which we do before manipulation anyway. +# This is easily refactored but I can't be bothered. +# +apks=" +user/openjdk8-jre-lib:8.252.09-r0 +user/openjdk8-jre-base:8.252.09-r0 +user/openjdk8-jre:8.252.09-r0 +user/openjdk8:8.252.09-r0 +system/libffi:3.2.1-r6 +"; + + +## +# global variables +# +vers=; # 3.2.1-r6 +repo=; # system +name=; # libffi + + +## +# supporting routines +# +set_metadata () +{ + vers=${apk#*:}; + repo=${apk%/*}; + temp=${apk%:${vers}}; + name=${temp#*/}; +} + +brk_unsupport () +{ + printf "E: target is missing dependency '%s'.\n" "${1}"; + break; +} + + +## +# H. P. Lovecraft +# knows this is daft. +# +for cpu in $arch; do + + printf "\n%s\n" "$cpu"; + + # output directory (specific to APKBUILD) + keep="${HERE}"/$cpu/boot-home; + + # always start fresh + rm -fr "${HERE}"/$cpu; + mkdir -p "${keep}"; + + # initial download/extract + for apk in $apks; do + + set_metadata $apk; + + printf " * %s\n" "$name-$vers.apk"; + + curl -s $host/adelie/$from/$repo/$cpu/$name-$vers.apk \ + | tar -C "${HERE}"/$cpu -xzf - 2>/dev/null \ + || brk_unsupport "$name-$vers.apk"; # armv7 + + done + + # optional special-case manipulation + for apk in $apks; do + + set_metadata $apk; + + case "${name}" in + libffi) + # naming does not match $cpu! + # e.g. { x86_64 --> amd64, ppc64 --> ppc, pmmx --> i386 } + # so we look for a known file and work relative to it + _tmp=$(find "${keep}" -name libjvm.so || brk_unsupport "libjvm.so"); # armv7 + _dst=${_tmp%/*}; + cp -a $(find "${HERE}"/$cpu/usr/lib -name "libffi.so*") \ + "${_dst}" \ + || brk_unsupport "libffi.so*"; # armv7 + ;; + openjdk8) + cp -a "${HERE}"/$cpu/usr/lib/jvm/java-1.8-openjdk \ + "${keep}"/$cpu \ + || brk_unsupport "openjdk8"; # armv7 + ;; + esac + + done + + # create bootstrap tarball + ( + cd "${HERE}"/$cpu; + + # cleanup unnecessary files (specific to APKBUILD) + rm -fr usr; + + chown -R 1000:1000 .; + tar -cJf "${HERE}"/openjdk8-bootstrap-$cpu.txz .; + ) + + # cleanup intermediates + rm -fr "${HERE}"/$cpu; + +done diff --git a/user/openjdk8/project-autoconf-2xx.patch b/user/openjdk8/project-autoconf-2xx.patch new file mode 100644 index 000000000..7930aac2a --- /dev/null +++ b/user/openjdk8/project-autoconf-2xx.patch @@ -0,0 +1,30 @@ +diff -ur a/autogen.sh b/autogen.sh +--- a/autogen.sh 2022-02-04 04:38:57.470000000 +0000 ++++ b/autogen.sh 2022-02-04 04:40:25.330000000 +0000 +@@ -11,7 +11,7 @@ + AUTOCONF_VERSION=`${AUTOCONF} --version | head -1 | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` + # echo ${AUTOCONF_VERSION} + case ${AUTOCONF_VERSION} in +- 2.59* | 2.6[0-9]* ) ++ 2.59* | 2.[0-9]* ) + HAVE_AUTOCONF=true + break; + ;; +@@ -28,7 +28,7 @@ + AUTOHEADER_VERSION=`${AUTOHEADER} --version | head -1 | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` + # echo ${AUTOHEADER_VERSION} + case ${AUTOHEADER_VERSION} in +- 2.59* | 2.6[0-9]* ) ++ 2.59* | 2.[0-9]* ) + HAVE_AUTOHEADER=true + break; + ;; +@@ -45,7 +45,7 @@ + AUTORECONF_VERSION=`${AUTORECONF} --version | head -1 | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` + # echo ${AUTORECONF_VERSION} + case ${AUTORECONF_VERSION} in +- 2.59* | 2.6[0-9]* ) ++ 2.59* | 2.[0-9]* ) + HAVE_AUTORECONF=true + break; + ;; |