tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to create OpenJDK bootstrap kit for NetBSD/aarch64?



On Wed, 11 May 2022 22:54:58 +0900
Ryo ONODERA <ryo%tetera.org@localhost> wrote:

> Could you share your procedure to create the bootstrap kit for
> NetBSD/aarch64 with me?
> I have Raspberry Pi 4 and Pine A64 to build OpenJDK 17 for NetBSD/aarch64.

Hello,

For OpenJDK 8 and earlier it was very complicated because
the cross-compile support was generally busted. But from
OpenJDK 11 I was able to cross-compile for NetBSD/evbarm
from NetBSD/amd64 using a "build.sh tools" toolchain and
then copy that JDK over to the evbarm box for a final
native rebuild.

So the process for openjdk11 was roughly like this:

1. build.sh -m evbarm -a earmv7hf -x distribution
2. manually create directories /work/openjdk11/cups/include, /work/openjdk11/alsa and copy cups headers in there if/when the build complains that they are missing
3. make configure in pkgsrc/lang/openjdk11 (to apply pkgsrc patches)
4. apply SUBST from hacks.mk manually
5. mkdir /work/openjdk11/build; cd /work/openjdk11/build
6. configure roughly like this and run make:

bash /tmp/pkgsrc-obj/lang/openjdk11/work/openjdk-jdk11u-jdk-11.0.11-9-1/configure \
--openjdk-target=armv7--netbsdelf-eabihf \
--with-boot-jdk=/usr/pkg/java/openjdk11 \
--with-zlib=bundled \
--with-giflib=bundled \
--with-lcms=bundled \
--with-cups-include=/work/openjdk11/cups/include \
--with-freetype=bundled \
--with-fontconfig-include=/work/evbarm/obj/destdir.evbarm/usr/X11R7/include \
--disable-precompiled-headers \
--disable-ccache \
--disable-javac-server \
--disable-warnings-as-errors \
--with-toolchain-type=gcc \
--enable-unlimited-crypto \
--x-includes=/work/evbarm/obj/destdir.evbarm/usr/X11R7/include \
--x-libraries=/work/evbarm/obj/destdir.evbarm/usr/X11R7/lib \
--enable-headless-only \
--with-native-debug-symbols=zipped \
--enable-dtrace=no \
--with-stdc++lib=dynamic \
--with-jvm-variants=server \
--prefix=/tmp/bootjdk \
--enable-option-checking=yes \
--enable-debug \
--with-native-debug-symbols=internal \
--with-tools-dir=/work/evbarm/tools/bin \
--with-extra-cflags="--sysroot=/work/evbarm/obj/destdir.evbarm" \
--with-extra-cxxflags="--sysroot=/work/evbarm/obj/destdir.evbarm" \
--with-extra-ldflags="--sysroot=/work/evbarm/obj/destdir.evbarm" \
--with-alsa=/work/openjdk11/alsa

-Tobias


Home | Main Index | Thread Index | Old Index