Skip to content

Commit caffbde

Browse files
authored
Merge pull request #14 from ev3dev-lang-java/openjdk-10-stretch
Upgrade OpenJDK 10 system to Stretch
2 parents d673b58 + 2ed0334 commit caffbde

12 files changed

+63
-42
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# openjdk-9-ev3
2-
A custom build of OpenJDK 9 for EV3, a Lego Mindstorms programmable brick featuring a ARM926EJ-S CPU.
1+
# OpenJDK 10 for EV3
2+
A custom build of OpenJDK 10 for EV3, a Lego Mindstorms programmable brick featuring a ARM926EJ-S CPU.
33

44
## Components
55
The output consists of these parts:
66
* JRE running on the EV3 - `jre-ev3.zip`
77
* Stripped down version -- a runtime image
88
* JDK built for the EV3 - `jdk-ev3.zip`
99
* Basically the full build
10-
* [Official OpenJDK linux-amd64](http://jdk.java.net/9/) with EV3 jmods
10+
* [Official OpenJDK linux-amd64](http://jdk.java.net/10/) with EV3 jmods
1111
* Only a stripped down version -- also a runtime image
1212
* It can be used for creating custom JRE images. For this, jlink and the ev3 jmods are included.
1313
* It has `javac` (jdk.compiler module).
@@ -42,16 +42,16 @@ JShell JDI agent on the remote side, which is handled by SSH as well.
4242

4343
0. Clone/download this repo to your computer.
4444
1. Install [Docker](https://docs.docker.com/engine/installation/) for your operating system.
45-
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/)
46-
3. Build the jdk9 cross-compilation environment:
45+
2. Adjust the JAVA_VERSION variable in `build/config.sh` to match the current OpenJDK tip: [OpenJDK 10 updates](http://hg.openjdk.java.net/jdk-updates/jdk10u/)
46+
3. Build the jdk cross-compilation environment:
4747
```sh
48-
sudo docker build -t ev3dev-lang-java:jdk9-system -f build/Dockerfile.system build
49-
sudo docker build -t ev3dev-lang-java:jdk9-build -f build/Dockerfile.scripts build
48+
sudo docker build -t ev3dev-lang-java:jdk10-stretch -f build/Dockerfile.system build
49+
sudo docker build -t ev3dev-lang-java:jdk10-build -f build/Dockerfile.scripts build
5050
```
5151
4. Run the newly prepared container. You have to mount a host directory to the the `/build` directory in the container,
5252
otherwise the build would get discarded. The final build needs at least 6.5 GB of free space (in the build directory).
5353
```
54-
sudo docker run --rm -it -v <path on host, where the sources should be stored>:/build ev3dev-lang-java:jdk9-build
54+
sudo docker run --rm -it -v <path on host, where the sources should be stored>:/build ev3dev-lang-java:jdk10-build
5555
```
5656
5. Let's fetch the OpenJDK sources:
5757
```
@@ -65,5 +65,5 @@ sudo docker run --rm -it -v <path on host, where the sources should be stored>:/
6565
```
6666
./zip.sh
6767
```
68-
8. If the build was successful, JDK9 packages were created in `/build/jre-ev3.zip`, `/build/jdk-ev3.zip` and `/build/jdk-pc.zip`.
68+
8. If the build was successful, JDK packages were created in `/build/jre-ev3.zip`, `/build/jdk-ev3.zip` and `/build/jdk-pc.zip`.
6969
If you have mounted `/build`, you can access the files from the host.

build/Dockerfile.scripts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ev3dev-lang-java:jdk9-system
1+
FROM ev3dev-lang-java:jdk10-stretch
22

33
# copy build patches & scripts
44
COPY *.patch *.sh /opt/jdkcross/

build/Dockerfile.system

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
FROM debian:jessie
1+
FROM debian:stretch
22

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

55
# setup repositories and install required packages
66
COPY apt.sources.list.debian /etc/apt/sources.list
7+
COPY ev3dev-archive-keyring.gpg /etc/apt/trusted.gpg.d/
78
RUN dpkg --add-architecture armel && \
8-
apt-key adv --keyserver pgp.mit.edu --recv-keys D57D95AF93178A7C && \
9-
apt-key adv --keyserver pgp.mit.edu --recv-keys 7DE089671804772E && \
109
apt-get update && \
1110
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
1211
bash-completion \
1312
ca-certificates \
1413
cmake \
1514
build-essential \
1615
crossbuild-essential-armel \
17-
gdb \
16+
gdb-multiarch \
1817
less \
1918
man-db \
2019
nano \
@@ -27,6 +26,7 @@ RUN dpkg --add-architecture armel && \
2726
xz-utils \
2827
libcups2-dev:armel \
2928
libfreetype6-dev:armel \
29+
libfontconfig1-dev:armel \
3030
libasound2-dev:armel \
3131
libx11-dev:armel \
3232
libxext-dev:armel \
@@ -49,9 +49,9 @@ RUN dpkg --add-architecture armel && \
4949
mercurial \
5050
zlib1g-dev
5151

52-
# download JDK 9
52+
# download JDK 10
5353
RUN mkdir /opt/jdkcross
54-
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
54+
RUN curl -SL https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz | tar -xzC /opt/jdkcross
5555

5656
# prepare a nonroot user
5757
COPY compiler.sudoers /etc/sudoers.d/compiler

build/apt.sources.list.debian

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
deb http://ftp.debian.org/debian jessie main contrib non-free
2-
deb http://security.debian.org/ jessie/updates main contrib non-free
3-
deb http://archive.ev3dev.org/debian jessie main
4-
deb http://emdebian.org/tools/debian/ jessie main
1+
deb http://deb.debian.org/debian stretch main contrib non-free
2+
deb http://deb.debian.org/debian-security stretch/updates main contrib non-free
3+
deb http://archive.ev3dev.org/debian stretch main

build/barrier.patch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff -r b09e56145e11 src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp
2+
--- a/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp Thu Mar 08 04:23:31 2018 +0000
3+
+++ b/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp Tue Mar 27 22:40:37 2018 +0200
4+
@@ -71,7 +71,7 @@
5+
__asm__ volatile (
6+
".word 0xF57FF050 | 0xf" : : : "memory");
7+
#endif
8+
- } else {
9+
+ } else if (VM_Version::arm_arch() == 6) {
10+
intptr_t zero = 0;
11+
__asm__ volatile (
12+
"mcr p15, 0, %0, c7, c10, 5"
13+
@@ -95,7 +95,7 @@
14+
__asm__ volatile (
15+
".word 0xF57FF050 | 0xe" : : : "memory");
16+
#endif
17+
- } else {
18+
+ } else if (VM_Version::arm_arch() == 6) {
19+
intptr_t zero = 0;
20+
__asm__ volatile (
21+
"mcr p15, 0, %0, c7, c10, 5"

build/build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source config.sh
77
cd "$JDKDIR"
88

99
# refresh patched build system
10-
bash ./common/autoconf/autogen.sh
10+
bash ./make/autoconf/autogen.sh
1111

1212
## Description ##
1313
# Use the downloaded JDK: --with-boot-jdk=/opt/jdkcross/jdk-9.0.1
@@ -27,14 +27,15 @@ bash ./common/autoconf/autogen.sh
2727
# BUILD_NM="gcc-nm"
2828

2929
# configure the build
30-
bash ./configure --with-boot-jdk="$SCRIPTDIR/jdk-9.0.1" \
30+
bash ./configure --with-boot-jdk="$SCRIPTDIR/jdk-10" \
3131
--openjdk-target=arm-linux-gnueabi \
3232
--with-abi-profile=arm-ev3 \
3333
--enable-headless-only \
3434
--with-freetype-lib=/usr/lib/arm-linux-gnueabi \
3535
--with-freetype-include=/usr/include \
3636
--with-jvm-variants=client \
37-
--with-extra-cflags="-Wno-maybe-uninitialized -D__SOFTFP__" \
37+
--with-extra-cflags="-w -Wno-error -D__SOFTFP__" \
38+
--with-extra-cxxflags="-w -Wno-error -D__SOFTFP__" \
3839
--with-version-string="$JAVA_VERSION" \
3940
AR="arm-linux-gnueabi-gcc-ar" \
4041
NM="arm-linux-gnueabi-gcc-nm" \

build/config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
JAVA_VERSION="10+23"
4-
JAVA_REPO="http://hg.openjdk.java.net/jdk10/jdk10/"
3+
JAVA_VERSION="10+46"
4+
JAVA_REPO="http://hg.openjdk.java.net/jdk-updates/jdk10u/"
55
SCRIPTDIR="/opt/jdkcross"
66

77
BUILDDIR="/build"

build/ev3.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
diff -r a08cbfc0e4ec common/autoconf/flags.m4
2-
--- a/common/autoconf/flags.m4 Thu Aug 03 18:56:56 2017 +0000
3-
+++ b/common/autoconf/flags.m4 Wed Dec 27 00:52:44 2017 +0100
1+
diff -r b09e56145e11 make/autoconf/flags.m4
2+
--- a/make/autoconf/flags.m4 Thu Mar 08 04:23:31 2018 +0000
3+
+++ b/make/autoconf/flags.m4 Tue Mar 27 22:42:02 2018 +0200
44
@@ -30,7 +30,7 @@
55
AC_DEFUN([FLAGS_SETUP_ABI_PROFILE],
66
[
@@ -20,7 +20,7 @@ diff -r a08cbfc0e4ec common/autoconf/flags.m4
2020
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then
2121
ARM_FLOAT_TYPE=vfp-sflt
2222
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
23-
@@ -1305,6 +1308,8 @@
23+
@@ -1378,6 +1381,8 @@
2424
if test "x$OPENJDK_$1_OS" = xlinux; then
2525
if test "x$OPENJDK_$1_CPU" = xx86; then
2626
$2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -march=i586"

build/ev3dev-archive-keyring.gpg

2.42 KB
Binary file not shown.

build/fetch.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ hg clone "$JAVA_REPO" "$JDKDIR"
99

1010
# clone the rest of the tree
1111
cd "$JDKDIR"
12-
bash ./get_source.sh
1312

1413
# apply the EV3-specific patches
1514
# - build flags for arm926ej-s
16-
patch -p1 < "$SCRIPTDIR/ev3.patch"
15+
patch -p1 < "$SCRIPTDIR/ev3.patch"
1716
# - use the system-provided floating point implementation
18-
patch -p1 -d hotspot < "$SCRIPTDIR/float.patch"
17+
patch -p1 < "$SCRIPTDIR/float.patch"
1918

0 commit comments

Comments
 (0)