Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openjdk-9-ev3
# OpenJDK 9 for EV3
A custom build of OpenJDK 9 for EV3, a Lego Mindstorms programmable brick featuring a ARM926EJ-S CPU.

## Components
Expand Down Expand Up @@ -45,8 +45,8 @@ JShell JDI agent on the remote side, which is handled by SSH as well.
2. Adjust the JAVA_VERSION variable in `build/config.sh` to match the current OpenJDK tip: [OpenJDK 9 updates](http://hg.openjdk.java.net/jdk-updates/jdk9u/)
3. Build the jdk9 cross-compilation environment:
```sh
sudo docker build -t ev3dev-lang-java:jdk9-system -f build/Dockerfile.system build
sudo docker build -t ev3dev-lang-java:jdk9-build -f build/Dockerfile.scripts build
sudo docker build -t ev3dev-lang-java:jdk9-stretch -f build/Dockerfile.system build
sudo docker build -t ev3dev-lang-java:jdk9-build -f build/Dockerfile.scripts build
```
4. Run the newly prepared container. You have to mount a host directory to the the `/build` directory in the container,
otherwise the build would get discarded. The final build needs at least 6.5 GB of free space (in the build directory).
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.scripts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ev3dev-lang-java:jdk9-system
FROM ev3dev-lang-java:jdk9-stretch

# copy build patches & scripts
COPY *.patch *.sh /opt/jdkcross/
Expand Down
11 changes: 5 additions & 6 deletions build/Dockerfile.system
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
FROM debian:jessie
FROM debian:stretch

# this is a customized version of ev3dev-jessie-cross image
# this is a customized version of ev3dev-stretch-cross image

# setup repositories and install required packages
COPY apt.sources.list.debian /etc/apt/sources.list
COPY ev3dev-archive-keyring.gpg /etc/apt/trusted.gpg.d/
RUN dpkg --add-architecture armel && \
apt-key adv --keyserver pgp.mit.edu --recv-keys D57D95AF93178A7C && \
apt-key adv --keyserver pgp.mit.edu --recv-keys 7DE089671804772E && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
bash-completion \
ca-certificates \
cmake \
build-essential \
crossbuild-essential-armel \
gdb \
gdb-multiarch \
less \
man-db \
nano \
Expand Down Expand Up @@ -51,7 +50,7 @@ RUN dpkg --add-architecture armel && \

# download JDK 9
RUN mkdir /opt/jdkcross
RUN curl -SL http://download.java.net/java/GA/jdk9/9.0.1/binaries/openjdk-9.0.1_linux-x64_bin.tar.gz | tar -xzC /opt/jdkcross
RUN curl -SL https://download.java.net/java/GA/jdk9/9.0.4/binaries/openjdk-9.0.4_linux-x64_bin.tar.gz | tar -xzC /opt/jdkcross

# prepare a nonroot user
COPY compiler.sudoers /etc/sudoers.d/compiler
Expand Down
7 changes: 3 additions & 4 deletions build/apt.sources.list.debian
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
deb http://deb.debian.org/debian jessie main contrib non-free
deb http://deb.debian.org/debian-security jessie/updates main contrib non-free
deb http://archive.ev3dev.org/debian jessie main
deb http://emdebian.org/tools/debian/ jessie main
deb http://deb.debian.org/debian stretch main contrib non-free
deb http://deb.debian.org/debian-security stretch/updates main contrib non-free
deb http://archive.ev3dev.org/debian stretch main
5 changes: 3 additions & 2 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ bash ./common/autoconf/autogen.sh
# BUILD_NM="gcc-nm"

# configure the build
bash ./configure --with-boot-jdk="$SCRIPTDIR/jdk-9.0.1" \
bash ./configure --with-boot-jdk="$SCRIPTDIR/jdk-9.0.4" \
--openjdk-target=arm-linux-gnueabi \
--with-abi-profile=arm-ev3 \
--enable-headless-only \
--with-freetype-lib=/usr/lib/arm-linux-gnueabi \
--with-freetype-include=/usr/include \
--with-jvm-variants=client \
--with-extra-cflags="-Wno-maybe-uninitialized -D__SOFTFP__" \
--with-extra-cflags="-w -Wno-error -D__SOFTFP__" \
--with-extra-cxxflags="-w -Wno-error -D__SOFTFP__" \
--with-version-string="$JAVA_VERSION" \
AR="arm-linux-gnueabi-gcc-ar" \
NM="arm-linux-gnueabi-gcc-nm" \
Expand Down
2 changes: 1 addition & 1 deletion build/config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

JAVA_VERSION="9.0.4+11"
JAVA_VERSION="9.0.4+12"
JAVA_REPO="http://hg.openjdk.java.net/jdk-updates/jdk9u/"
SCRIPTDIR="/opt/jdkcross"

Expand Down
Binary file added build/ev3dev-archive-keyring.gpg
Binary file not shown.
10 changes: 5 additions & 5 deletions build/zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rm -rf ./jshell-support
rm -f ./jdk-ev3

# build ev3 runtime image
"$SCRIPTDIR/jdk-9.0.1/bin/jlink" \
"$SCRIPTDIR/jdk-9.0.4/bin/jlink" \
--module-path ./jmods/ \
--endian little \
--compress 0 \
Expand All @@ -25,8 +25,8 @@ rm -f ./jdk-ev3
--output ./jre-ev3

# build microjdk
"$SCRIPTDIR/jdk-9.0.1/bin/jlink" \
--module-path "$SCRIPTDIR/jdk-9.0.1/jmods" \
"$SCRIPTDIR/jdk-9.0.4/bin/jlink" \
--module-path "$SCRIPTDIR/jdk-9.0.4/jmods" \
--compress 2 \
--strip-debug \
--no-header-files \
Expand All @@ -41,8 +41,8 @@ ln -s ./jdk ./jdk-ev3

# JShell hack
mkdir jshell-support
"$SCRIPTDIR/jdk-9.0.1/bin/javac" -d ./jshell-support "$SCRIPTDIR/jshellhack/DumpPort.java"
"$SCRIPTDIR/jdk-9.0.1/bin/jar" cf ./jshellhack.jar -C ./jshell-support jshellhack/DumpPort.class
"$SCRIPTDIR/jdk-9.0.4/bin/javac" -d ./jshell-support "$SCRIPTDIR/jshellhack/DumpPort.java"
"$SCRIPTDIR/jdk-9.0.4/bin/jar" cf ./jshellhack.jar -C ./jshell-support jshellhack/DumpPort.class
cp ./jshellhack.jar ./jdk-pc/bin
cp "$SCRIPTDIR/jshell-launch.sh" ./jdk-pc/bin

Expand Down