Bootstrap OpenJDK 11 on GNU/Linux
Required Packages
Required Patches
Installation
Installing GCC 4.0.4
tar -xf gcc-4.0.4.tar.bz2
cd gcc-4.0.4
patch -Np1 -i ../gcc-4.0.4-floor.patch
find ./ -type f -name '*.[ch]' |
xargs sed -i -e 's/struct ucontext/struct ucontext_t/g' \
-e 's/struct siginfo/siginfo_t/'
mkdir build
cd build
SED=sed \
../configure --prefix=/usr \
--disable-bootstrap \
--disable-libmudflap \
--disable-multilib \
--disable-nls \
--disable-shared \
--enable-languages=java \
--infodir=/usr/share/gcc-4.0.4/info \
--mandir=/usr/share/gcc-4.0.4/man \
--program-suffix=-4 \
--with-system-zlib
make
make install-fastjar install-gcc install-target-libjava
ln -sv gcc-4 /usr/bin/cc-4
Installing ECJ for GCC 4.9
mkdir ecj-4.9
cd ecj-4.9
tar -xf ../ecj-4.9-source.tar.bz2
patch -Np1 -i ../ecj-4.9-Makefile.patch
make checkout
patch -Np1 -i ../ecj-4.9-Main.patch
make compile
make ecj.jar
install -m644 ecj.jar /usr/share/java/ecj-4.9.jar
Installing GCC 6.3.0
tar -xf gcc-6.3.0.tar.bz2
cd gcc-6.3.0
patch -Np1 -i ../gcc-6.3.0-ubsan.patch
find ./ -type f -name '*.[ch]' |
xargs sed -i -e 's/struct ucontext/struct ucontext_t/g' \
-e 's/struct siginfo/siginfo_t/'
mkdir build
cd build
SED=sed \
../configure --prefix=/usr \
--disable-bootstrap \
--disable-libatomic \
--disable-libgomp \
--disable-libmpx \
--disable-libmudflap \
--disable-libquadmath \
--disable-libsanitizer \
--disable-libssp \
--disable-libvtv \
--disable-multilib \
--disable-nls \
--enable-java-home \
--enable-languages=c,c++,java \
--infodir=/usr/share/gcc-6.3.0/info \
--mandir=/usr/share/gcc-6.3.0/man \
--program-suffix=-6 \
--with-ecj-jar=/usr/share/java/ecj-4.9.jar \
--with-jvm-root-dir=/usr/lib/jvm/gcj-6.3.0 \
--with-system-zlib
make
make DESTDIR=dest install
rm -f dest/usr/lib*/*.{a,la}
rm -f dest/usr/lib*/libgcc_s*
rm -f dest/usr/lib*/*.so
rm -f dest/usr/lib*/libstdc*gdb-py
rm -f dest/usr/lib*/*.so.?
rm -f dest/usr/lib*/libcc1.so
ln -sv gcc-6 dest/usr/bin/cc-6
cp -r dest/* /
Installing Apache Ant 1.9.13
tar -xf apache-ant-1.9.13-src.tar.bz2
cd apache-ant-1.9.13
patch -Np1 -i ../apache-ant-1.9.13-compat.patch
mkdir path
ln -s /usr/bin/gcj-6 path/gcj
BOOTJAVAC_OPTS="-C" \
JAVAC=gcj \
JAVACMD=/usr/bin/gij-6 \
PATH=$PATH:$PWD/path \
./bootstrap.sh
install -dm755 /usr/share/apache-ant-1.9.13
cp -R bootstrap/{bin,lib} /usr/share/apache-ant-1.9.13
ln -s ../share/apache-ant-1.9.13/ant /usr/bin
Installing IcedTea 2.6.16
tar -xf icedtea-2.6.16.tar.xz
cd icedtea-2.6.16
ln -s /bin/find /usr/bin/find
ln -s /bin/head /usr/bin/head
ln -s /bin/test /usr/bin/test
ln -s /usr/bin/touch /bin/touch
[ ! -f /usr/bin/wget ] && echo 'curl -LO $@' > /usr/bin/wget && chmod a+x /usr/bin/wget
ln -s ../sys/xattr.h /usr/include/attr
CC=gcc-6 \
CXX=g++-6 \
PATH=$PATH:/usr/lib/jvm/gcj-6.3.0/bin \
./configure --prefix=/usr/lib/jvm/icedtea-2.6.16 \
--disable-system-gif \
--disable-system-gtk \
--disable-system-kerberos \
--disable-system-lcms \
--disable-system-pcsc \
--disable-system-sctp \
--with-ecj-jar=/usr/share/java/ecj-4.9.jar \
--with-gcj \
--with-jar=/usr/lib/jvm/gcj-6.3.0/bin/jar \
--with-jdk-home=/usr/lib/jvm/gcj-6.3.0 \
--without-rhino
make
mkdir openjdk.build/j2sdk-image/tapset
touch openjdk.build/j2sdk-image/tapset/something.stp
make install
rm -rf /usr/lib/jvm/icedtea-2.6.16/tapset
for i in /bin/touch /usr/bin/{find,head,test} /usr/include/attr/xattr
do
[ -L $i ] && rm $i
done
grep ^curl /usr/bin/wget && rm /usr/bin/wget
Installing OpenJDK 8
cd jdk8u-dev-jdk8u202-b01
for i in corba hotspot jaxp jaxws jdk jdk8u-dev langtools nashorn
do
ln -s ../$i-jdk8u202-b01 $i
done
CFLAGS="-Wno-error=deprecated-declarations"
CFLAGS="$CFLAGS -Wno-error=stringop-overflow="
CFLAGS="$CFLAGS -Wno-error=return-type -Wno-error=cpp"
CFLAGS="$CFLAGS -fno-lifetime-dse"
CFLAGS="$CFLAGS -fno-delete-null-pointer-checks"
bash configure --disable-headful \
--enable-unlimited-crypto \
--with-boot-jdk=/usr/lib/jvm/icedtea-2.6.16 \
--with-build-number=b01 \
--with-cacerts-file=/etc/ssl/ca-bundle.crt \
--with-extra-cflags="$CFLAGS" \
--with-extra-cxxflags="$CFLAGS" \
--with-milestone=fcs \
--with-update-version=202 \
--with-zlib=system
make images
install -dm755 /usr/lib/jvm/openjdk-8u202-b01
cp -r build/*/images/j2sdk-image/* /usr/lib/jvm/openjdk-8u202-b01
unset CFLAGS
Installing OpenJDK 9
cd jdk9-jdk-9+181
for i in corba hotspot jaxp jaxws jdk jdk8u-dev langtools nashorn
do
ln -s ../$i-jdk-9+181 $i
done
bash configure --disable-warnings-as-errors \
--enable-headless-only \
--enable-unlimited-crypto \
--with-boot-jdk=/usr/lib/jvm/openjdk-8u202-b01 \
--with-cacerts-file=/etc/ssl/ca-bundle.crt \
--with-libjpeg=system \
--with-libpng=system \
--with-stdc++lib=dynamic \
--with-version-build=181 \
--with-version-opt="" \
--with-version-pre="" \
--with-zlib=system
make images
cp -r build/*/images/jdk /usr/lib/jvm/openjdk-9+181
Installing OpenJDK 10
tar -xf jdk-10.0.2+13.tar.bz2
cd jdk11u-jdk-10.0.2+13
bash configure --disable-warnings-as-errors \
--enable-headless-only \
--enable-unlimited-crypto \
--with-boot-jdk=/usr/lib/jvm/openjdk-9+181 \
--with-cacerts-file=/etc/ssl/ca-bundle.crt \
--with-libjpeg=system \
--with-libpng=system \
--with-stdc++lib=dynamic \
--with-version-build=13 \
--with-version-opt="" \
--with-version-pre="" \
--with-zlib=system
make images
cp -r build/*/images/jdk /usr/lib/jvm/openjdk-10.0.2+13
Installing OpenJDK 11
tar -xf jdk-11.0.1+13.tar.bz2
cd jdk11u-jdk-11.0.1+13
bash configure --disable-warnings-as-errors \
--enable-headless-only \
--enable-unlimited-crypto \
--with-boot-jdk=/usr/lib/jvm/openjdk-10.0.2+13 \
--with-cacerts-file=/etc/ssl/ca-bundle.crt \
--with-libjpeg=system \
--with-libpng=system \
--with-stdc++lib=dynamic \
--with-version-build=13 \
--with-version-opt="" \
--with-version-pre="" \
--with-zlib=system
make images
cp -r build/*/images/jdk /usr/lib/jvm/openjdk-$CURRENT_VERSION