Browse Source

Upgrade java bootstrap

master
mid-kid 2 months ago
parent
commit
90c825b1cb
  1. 2
      java/build_icedtea8.sh
  2. 17
      java/build_jdk.sh
  3. 48
      java/download.sh
  4. 10
      java/download.sha256
  5. 12
      java/files/jdk-10.0.2+13-disarm-timebomb.patch
  6. 12
      java/files/jdk-9+181-disarm-timebomb.patch
  7. 8
      java/install_gentoo.txt
  8. 3
      java/strip.sh

2
java/build_icedtea8.sh

@ -11,7 +11,7 @@ makeopts_jobs() {
echo ${jobs:-1}
}
version_icedtea8=3.29.0
version_icedtea8=3.30.0
dir_download="$PWD/download"
mkdir -p build; cd build

17
java/build_jdk.sh

@ -11,17 +11,17 @@ makeopts_jobs() {
echo ${jobs:-1}
}
version_jdk21=21.0.1+12
version_jdk21=21.0.3+6
version_jdk20=20.0.2+9
version_jdk19=19.0.2+7
version_jdk18=18.0.2.1+1
version_jdk17=17.0.10+6
version_jdk17=17.0.11+6
version_jdk16=16.0.2+7
version_jdk15=15.0.10+5
version_jdk14=14.0.2+12
version_jdk13=13.0.14+5
version_jdk12=12.0.2+10
version_jdk11=11.0.22+6
version_jdk11=11.0.23+6
version_jdk10=10.0.2+13
version_jdk9=9+181
@ -47,19 +47,19 @@ CFLAGS=""
CXXFLAGS=""
case "$version_jdk_major" in
jdk9)
patch -p1 -i "$dir_files/jdk-9+181-disarm-timebomb.patch"
patch -p1 -i "$dir_files/jdk-9+181-fix-pointer-comparison.patch"
sed -i -e '/^ *COMPILER_VERSION_NUMBER=/{N;s/\[1-9\]/&[0-9]*/}' \
common/autoconf/generated-configure.sh
export PATH="$PWD/../install-make42:$PATH"
export MAKE="$PWD/../install-make42/make"
CFLAGS="$CFLAGS -fcommon"
CXXFLAGS="$CFLAGS -fcommon"
;;
jdk10)
patch -p1 -i "$dir_files/jdk-10.0.2+13-disarm-timebomb.patch"
patch -p1 -i "$dir_files/jdk-10.0.2+13-fix-pointer-comparison.patch"
sed -i -e '/^ *COMPILER_VERSION_NUMBER=/{N;s/\[1-9\]/&[0-9]*/}' \
make/autoconf/generated-configure.sh
export PATH="$PWD/../install-make42:$PATH"
export MAKE="$PWD/../install-make42/make"
CFLAGS="$CFLAGS -fcommon"
CXXFLAGS="$CFLAGS -fcommon"
@ -67,7 +67,6 @@ jdk10)
jdk12)
sed -i -e '/^ *COMPILER_VERSION_NUMBER=/{N;s/@<:@1-9@:>@/&@<:@0-9@:>@*/}' \
make/autoconf/toolchain.m4
export PATH="$PWD/../install-make42:$PATH"
export MAKE="$PWD/../install-make42/make"
CFLAGS="$CFLAGS -fcommon"
CXXFLAGS="$CFLAGS -fcommon"
@ -79,6 +78,9 @@ jdk13)
CXXFLAGS="$CFLAGS -fcommon"
;;
jdk14)
## Don't detect WSL
#sed -i -e 's/grep -i microsoft/false/' \
#make/autoconf/build-aux/config.guess
CFLAGS="$CFLAGS -fcommon"
CXXFLAGS="$CFLAGS -fcommon"
;;
@ -92,13 +94,14 @@ unset _JAVA_OPTIONS JAVAC
# Configure source
CONFIG_SHELL=/bin/bash ./configure \
--build="$(uname -m)-pc-linux-gnu" \
--prefix="$dir_install" \
--with-boot-jdk="$PWD/../install-$version_jdk_bootstrap" \
--with-jobs="$(makeopts_jobs)" \
--with-extra-cflags="$CFLAGS -w" \
--with-extra-cxxflags="$CXXFLAGS -w" \
--disable-full-docs \
--enable-headless-only \
--disable-full-docs \
--disable-warnings-as-errors
echo "$version_jdk" > .src-rev

48
java/download.sh

@ -1,21 +1,21 @@
#!/bin/sh
set -eu
version_jdk21=21.0.1+12 # https://github.com/openjdk/jdk21u/tags
version_jdk21=21.0.3+6 # https://github.com/openjdk/jdk21u/tags
version_jdk20=20.0.2+9 # https://github.com/openjdk/jdk20u/tags
version_jdk19=19.0.2+7 # https://github.com/openjdk/jdk19u/tags
version_jdk18=18.0.2.1+1 # https://github.com/openjdk/jdk18u/tags
version_jdk17=17.0.10+6 # https://github.com/openjdk/jdk17u/tags
version_jdk17=17.0.11+6 # https://github.com/openjdk/jdk17u/tags
version_jdk16=16.0.2+7 # https://github.com/openjdk/jdk16u/tags
version_jdk15=15.0.10+5 # https://github.com/openjdk/jdk15u/tags
version_jdk14=14.0.2+12 # https://github.com/openjdk/jdk14u/tags
version_jdk13=13.0.14+5 # https://github.com/openjdk/jdk13u/tags
version_jdk12=12.0.2+10 # https://github.com/openjdk/jdk12u/tags
version_jdk11=11.0.22+6 # https://github.com/openjdk/jdk11u/tags
version_jdk11=11.0.23+6 # https://github.com/openjdk/jdk11u/tags
version_jdk10=10.0.2+13 # https://github.com/openjdk/jdk10u/tags
version_jdk9=9+181 # https://github.com/openjdk/jdk9u/tags
version_make42=4.2.1 # https://ftp.gnu.org/gnu/make/
version_icedtea8=3.29.0 # https://icedtea.classpath.org/wiki/Main_Page#Getting_IcedTea
version_icedtea8=3.30.0 # https://icedtea.classpath.org/wiki/Main_Page#Getting_IcedTea
version_icedtea7=2.6.28 # https://icedtea.classpath.org/wiki/Main_Page#Getting_IcedTea
version_ant=1.9.16 # https://ant.apache.org/manual-1.9.x/index.html
version_gcc=6.5.0 # Final version
@ -24,26 +24,26 @@ version_ecj=4.9 # Final version
mkdir -p download
cd download
#wget -O "jdk21u-jdk-$version_jdk21.tar.gz" -c "https://github.com/openjdk/jdk21u/archive/refs/tags/jdk-$version_jdk21.tar.gz"
#wget -O "jdk20u-jdk-$version_jdk20.tar.gz" -c "https://github.com/openjdk/jdk20u/archive/refs/tags/jdk-$version_jdk20.tar.gz"
#wget -O "jdk19u-jdk-$version_jdk19.tar.gz" -c "https://github.com/openjdk/jdk19u/archive/refs/tags/jdk-$version_jdk19.tar.gz"
#wget -O "jdk18u-jdk-$version_jdk18.tar.gz" -c "https://github.com/openjdk/jdk18u/archive/refs/tags/jdk-$version_jdk18.tar.gz"
#wget -O "jdk17u-jdk-$version_jdk17.tar.gz" -c "https://github.com/openjdk/jdk17u/archive/refs/tags/jdk-$version_jdk17.tar.gz"
#wget -O "jdk16u-jdk-$version_jdk16.tar.gz" -c "https://github.com/openjdk/jdk16u/archive/refs/tags/jdk-$version_jdk16.tar.gz"
#wget -O "jdk15u-jdk-$version_jdk15.tar.gz" -c "https://github.com/openjdk/jdk15u/archive/refs/tags/jdk-$version_jdk15.tar.gz"
#wget -O "jdk14u-jdk-$version_jdk14.tar.gz" -c "https://github.com/openjdk/jdk14u/archive/refs/tags/jdk-$version_jdk14.tar.gz"
#wget -O "jdk13u-jdk-$version_jdk13.tar.gz" -c "https://github.com/openjdk/jdk13u/archive/refs/tags/jdk-$version_jdk13.tar.gz"
#wget -O "jdk12u-jdk-$version_jdk12.tar.gz" -c "https://github.com/openjdk/jdk12u/archive/refs/tags/jdk-$version_jdk12.tar.gz"
#wget -O "jdk11u-jdk-$version_jdk11.tar.gz" -c "https://github.com/openjdk/jdk11u/archive/refs/tags/jdk-$version_jdk11.tar.gz"
#wget -O "jdk10u-jdk-$version_jdk10.tar.gz" -c "https://github.com/openjdk/jdk10u/archive/refs/tags/jdk-$version_jdk10.tar.gz"
#wget -O "jdk9u-jdk-$version_jdk9.tar.gz" -c "https://github.com/openjdk/jdk9u/archive/refs/tags/jdk-$version_jdk9.tar.gz"
#wget -c "https://ftp.gnu.org/gnu/make/make-$version_make42.tar.bz2"
#wget -c "http://icedtea.classpath.org/download/source/icedtea-$version_icedtea8.tar.xz"
#wget -c "http://icedtea.classpath.org/download/source/icedtea-$version_icedtea7.tar.xz"
#wget -c "https://archive.apache.org/dist/ant/source/apache-ant-$version_ant-src.tar.bz2"
#wget -c "https://ftp.gnu.org/gnu/gcc/gcc-$version_gcc/gcc-$version_gcc.tar.xz"
#wget -c "ftp://sourceware.org/pub/java/ecj-$version_ecj.jar"
#wget -O javac.in -c 'https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-java/gcj-jdk/files/javac.in?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d'
wget -O "jdk21u-jdk-$version_jdk21.tar.gz" -c "https://github.com/openjdk/jdk21u/archive/refs/tags/jdk-$version_jdk21.tar.gz"
wget -O "jdk20u-jdk-$version_jdk20.tar.gz" -c "https://github.com/openjdk/jdk20u/archive/refs/tags/jdk-$version_jdk20.tar.gz"
wget -O "jdk19u-jdk-$version_jdk19.tar.gz" -c "https://github.com/openjdk/jdk19u/archive/refs/tags/jdk-$version_jdk19.tar.gz"
wget -O "jdk18u-jdk-$version_jdk18.tar.gz" -c "https://github.com/openjdk/jdk18u/archive/refs/tags/jdk-$version_jdk18.tar.gz"
wget -O "jdk17u-jdk-$version_jdk17.tar.gz" -c "https://github.com/openjdk/jdk17u/archive/refs/tags/jdk-$version_jdk17.tar.gz"
wget -O "jdk16u-jdk-$version_jdk16.tar.gz" -c "https://github.com/openjdk/jdk16u/archive/refs/tags/jdk-$version_jdk16.tar.gz"
wget -O "jdk15u-jdk-$version_jdk15.tar.gz" -c "https://github.com/openjdk/jdk15u/archive/refs/tags/jdk-$version_jdk15.tar.gz"
wget -O "jdk14u-jdk-$version_jdk14.tar.gz" -c "https://github.com/openjdk/jdk14u/archive/refs/tags/jdk-$version_jdk14.tar.gz"
wget -O "jdk13u-jdk-$version_jdk13.tar.gz" -c "https://github.com/openjdk/jdk13u/archive/refs/tags/jdk-$version_jdk13.tar.gz"
wget -O "jdk12u-jdk-$version_jdk12.tar.gz" -c "https://github.com/openjdk/jdk12u/archive/refs/tags/jdk-$version_jdk12.tar.gz"
wget -O "jdk11u-jdk-$version_jdk11.tar.gz" -c "https://github.com/openjdk/jdk11u/archive/refs/tags/jdk-$version_jdk11.tar.gz"
wget -O "jdk10u-jdk-$version_jdk10.tar.gz" -c "https://github.com/openjdk/jdk10u/archive/refs/tags/jdk-$version_jdk10.tar.gz"
wget -O "jdk9u-jdk-$version_jdk9.tar.gz" -c "https://github.com/openjdk/jdk9u/archive/refs/tags/jdk-$version_jdk9.tar.gz"
wget -c "https://ftp.gnu.org/gnu/make/make-$version_make42.tar.bz2"
wget -c "http://icedtea.classpath.org/download/source/icedtea-$version_icedtea8.tar.xz"
wget -c "http://icedtea.classpath.org/download/source/icedtea-$version_icedtea7.tar.xz"
wget -c "https://archive.apache.org/dist/ant/source/apache-ant-$version_ant-src.tar.bz2"
wget -c "https://ftp.gnu.org/gnu/gcc/gcc-$version_gcc/gcc-$version_gcc.tar.xz"
wget -c "ftp://sourceware.org/pub/java/ecj-$version_ecj.jar"
wget -O javac.in -c 'https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-java/gcj-jdk/files/javac.in?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d'
for part in corba hotspot jaxp jaxws jdk langtools openjdk; do
wget -O "icedtea-$version_icedtea7-$part.tar.bz2" -c "http://icedtea.classpath.org/download/drops/icedtea7/$version_icedtea7/$part.tar.bz2"

10
java/download.sha256

@ -9,20 +9,20 @@ fd93e65a4692593c2100963be2c75d697a32ba51ee2c02c7e7dccc524dfb1788 icedtea-2.6.28
24799d5ebebfb1e316f9434db1db5a360ac7c86e5783ce58693536f978a0aa47 icedtea-2.6.28-langtools.tar.bz2
78e5e89fc510280401e227d980abe30d49ea508c3eec537035481fd21a3b2c32 icedtea-2.6.28-openjdk.tar.bz2
951188e6c0e3599de22f5cb2d95b5da9bf480763b5c8c600dae9fec88cff1735 icedtea-2.6.28.tar.xz
74d33382e17a757728bc209595a89068528406428fe3c66fc0bbf9d489ecfc14 icedtea-3.29.0-openjdk-git.tar.xz
9954bf4ee8f7f4dbdec621419e6f2c42d3e97102987a7edb374e3bda7baf5169 icedtea-3.29.0.tar.xz
1b205735e518f8fd172b2c945f8f28fe7564b378ce5cc1730484a9e325e6d478 icedtea-3.30.0-openjdk-git.tar.xz
600beb80f1c5a6dc6c6a8ed88a068a2c6d3777e225f6c97fcb812b9a35094940 icedtea-3.30.0.tar.xz
3bb23cff0a6e5a7a820e19cce4b9b0f51a7b84ee9e0eeb048b463a5f3e996db0 javac.in
39ce1238d5b2066ffe1c1a09d87c170766309fe18290f27a4ab7d15844d34dc1 jdk10u-jdk-10.0.2+13.tar.gz
8bae7c5e608de84aa32010365514bb59cd0d8ba709f6730cc473e159c6bfb918 jdk11u-jdk-11.0.22+6.tar.gz
c25a966a1159d060c5d589cf876b2776daecf3d71099e43707941d92a155b7eb jdk11u-jdk-11.0.23+6.tar.gz
8494fa3a6ffef590c86b403379422f325101bc86607557cb27c6774d59710b84 jdk12u-jdk-12.0.2+10.tar.gz
4c8e88490ed30276ea0145d37f33e094fcf436ce528bab29f6a9a3546820faf4 jdk13u-jdk-13.0.14+5.tar.gz
582e3d805ab74582332250f95f9845608c8f3d3273aa92af6f683c45d1a4f8e8 jdk14u-jdk-14.0.2+12.tar.gz
7aaeab4a68471e630d91eaf5540d067c8ffd5f023031be082b889763c1f94f3a jdk15u-jdk-15.0.10+5.tar.gz
b4a0e71e41a11175e8a7c1dba86ed5b0aa878413158c8d48813db1b64ac9536c jdk16u-jdk-16.0.2+7.tar.gz
3d5ef3a18c4edfa6e2a16c74d9e771b09eed433006b1380df450aa88725c7238 jdk17u-jdk-17.0.10+6.tar.gz
c57e2ad86125b93b38794742471d71d13699cd8348c0eca4cebf17789c27807c jdk17u-jdk-17.0.11+6.tar.gz
7d026848a48e8777d3242bab2adf30122f0acda88abbd3f92636f8793eaf3455 jdk18u-jdk-18.0.2.1+1.tar.gz
5903efd527dd08e9c235c8822e3d5699c3d18a8618c3e533307e8d6491ffbbf0 jdk19u-jdk-19.0.2+7.tar.gz
4d6f176075d5f2ce62fd16ebd5cc4c27a3e551ce4d3d3bc0e9946454e52fc88d jdk20u-jdk-20.0.2+9.tar.gz
9943e3814d3c1a31f1449f09a8b67df54841944f855a1d372be892c5e6b19217 jdk21u-jdk-21.0.1+12.tar.gz
75a6ca52299ee2f5b028a5a4acedd6139ae740cbf1af034e2d50489e74598dd3 jdk21u-jdk-21.0.3+6.tar.gz
a80c59433d394b241ebcd36968ec6ff017fab3fdf3700a459a5b59e978dab396 jdk9u-jdk-9+181.tar.gz
d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589 make-4.2.1.tar.bz2

12
java/files/jdk-10.0.2+13-disarm-timebomb.patch

@ -0,0 +1,12 @@
--- jdk10u-jdk-10.0.2-13.orig/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
+++ jdk10u-jdk-10.0.2-13/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
@@ -284,9 +284,6 @@
checkCurrencyCode(newCurrency);
String timeString = currencyInfo.substring(4, length - 4);
long time = format.parse(timeString).getTime();
- if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) {
- throw new RuntimeException("time is more than 10 years from present: " + time);
- }
specialCaseCutOverTimes[specialCaseCount] = time;
specialCaseOldCurrencies[specialCaseCount] = oldCurrency;
specialCaseOldCurrenciesDefaultFractionDigits[specialCaseCount] = getDefaultFractionDigits(oldCurrency);

12
java/files/jdk-9+181-disarm-timebomb.patch

@ -0,0 +1,12 @@
--- jdk9u-jdk-9-181.orig/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
+++ jdk9u-jdk-9-181/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
@@ -284,9 +284,6 @@
checkCurrencyCode(newCurrency);
String timeString = currencyInfo.substring(4, length - 4);
long time = format.parse(timeString).getTime();
- if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) {
- throw new RuntimeException("time is more than 10 years from present: " + time);
- }
specialCaseCutOverTimes[specialCaseCount] = time;
specialCaseOldCurrencies[specialCaseCount] = oldCurrency;
specialCaseOldCurrenciesDefaultFractionDigits[specialCaseCount] = getDefaultFractionDigits(oldCurrency);

8
java/install_gentoo.txt

@ -2,18 +2,18 @@ sudo emerge -1 dev-java/java-config
# NOTE: All of these commands rely on a same-version sdk not previously being installed
# TODO: Try setting JAVA_PKG_FORCE_VM=openjdk-8, and setting JAVA_HOME manually
sudo rsync -rvP build/install-icedtea8/ /opt/icedtea8
cat << 'EOF' | sudo tee /usr/share/java-config-2/vm/openjdk-8 > /dev/null
sudo mkdir -p /usr/share/java-config-2/vm
cat << 'EOF' | sudo tee /usr/share/java-config-2/vm/openjdk-bin-8 > /dev/null
JAVA_HOME=/opt/icedtea8
PATH="${JAVA_HOME}/bin"
LDPATH=
LDPATH=''
PROVIDES_TYPE='JDK JRE'
PROVIDES_VERSION=1.8
GENERATION=2
EOF
sudo emerge --buildpkg=n -O1 dev-java/openjdk:8
sudo rm -rf /opt/icedtea8
sudo rm -rf /opt/icedtea8 /usr/share/java-config-2/vm/openjdk-bin-8
sudo emerge dev-java/openjdk:8
sudo rsync -rvP build/install-jdk11/ /opt/jdk11

3
java/strip.sh

@ -1,3 +0,0 @@
#!/bin/sh
set -eu
find "$1" -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs -L1 -t strip --strip-unneeded
Loading…
Cancel
Save