diff --git a/README.md b/README.md index bc378b8..52f6a6d 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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). diff --git a/build/Dockerfile.scripts b/build/Dockerfile.scripts index b5fcb3e..150683e 100644 --- a/build/Dockerfile.scripts +++ b/build/Dockerfile.scripts @@ -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/ diff --git a/build/Dockerfile.system b/build/Dockerfile.system index 751464c..2c32e7c 100644 --- a/build/Dockerfile.system +++ b/build/Dockerfile.system @@ -1,12 +1,11 @@ -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 \ @@ -14,7 +13,7 @@ RUN dpkg --add-architecture armel && \ cmake \ build-essential \ crossbuild-essential-armel \ - gdb \ + gdb-multiarch \ less \ man-db \ nano \ @@ -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 diff --git a/build/apt.sources.list.debian b/build/apt.sources.list.debian index c39e83a..a9b855c 100644 --- a/build/apt.sources.list.debian +++ b/build/apt.sources.list.debian @@ -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 diff --git a/build/build.sh b/build/build.sh index 63dcc8b..d1f10b7 100644 --- a/build/build.sh +++ b/build/build.sh @@ -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" \ diff --git a/build/config.sh b/build/config.sh index 366d159..51502f9 100644 --- a/build/config.sh +++ b/build/config.sh @@ -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" diff --git a/build/ev3dev-archive-keyring.gpg b/build/ev3dev-archive-keyring.gpg new file mode 100644 index 0000000..b095dfb Binary files /dev/null and b/build/ev3dev-archive-keyring.gpg differ diff --git a/build/zip.sh b/build/zip.sh index 282ce0a..ac1c3c7 100644 --- a/build/zip.sh +++ b/build/zip.sh @@ -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 \ @@ -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 \ @@ -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