Skip to content

Commit 9a9bcb2

Browse files
committed
Merge JDK9 to master
2 parents 6b23be0 + c969492 commit 9a9bcb2

15 files changed

+307
-90
lines changed

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 69 deletions
This file was deleted.

jdk9/Dockerfile.scripts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ev3dev-lang-java:jdk9-stretch
2+
3+
# copy build patches & scripts
4+
COPY *.patch *.sh /opt/jdkcross/
5+
RUN chmod +x /opt/jdkcross/*.sh && mkdir /opt/jdkcross/jshellhack
6+
COPY DumpPort.java /opt/jdkcross/jshellhack/
7+
8+
# this directory should be mounted
9+
VOLUME /build
10+
11+
USER compiler
12+
WORKDIR /opt/jdkcross
13+
CMD ["/bin/bash"] ["--login"]

jdk9/Dockerfile.system

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM debian:stretch
2+
3+
# this is a customized version of ev3dev-stretch-cross image
4+
5+
# setup repositories and install required packages
6+
COPY apt.sources.list.debian /etc/apt/sources.list
7+
COPY ev3dev-archive-keyring.gpg /etc/apt/trusted.gpg.d/
8+
RUN dpkg --add-architecture armel && \
9+
apt-get update && \
10+
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
11+
bash-completion \
12+
ca-certificates \
13+
cmake \
14+
build-essential \
15+
crossbuild-essential-armel \
16+
gdb-multiarch \
17+
less \
18+
man-db \
19+
nano \
20+
pkg-config \
21+
qemu-user-static \
22+
sudo \
23+
tree \
24+
vim \
25+
wget \
26+
xz-utils \
27+
libcups2-dev:armel \
28+
libfreetype6-dev:armel \
29+
libasound2-dev:armel \
30+
libx11-dev:armel \
31+
libxext-dev:armel \
32+
libxrender-dev:armel \
33+
libxtst-dev:armel \
34+
libxt-dev:armel \
35+
curl \
36+
make \
37+
m4 \
38+
cpio \
39+
gawk \
40+
file \
41+
zip \
42+
unzip \
43+
procps \
44+
autoconf \
45+
autoconf-archive \
46+
automake \
47+
autotools-dev \
48+
mercurial \
49+
zlib1g-dev
50+
51+
# download JDK 9
52+
RUN mkdir /opt/jdkcross
53+
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
54+
55+
# prepare a nonroot user
56+
COPY compiler.sudoers /etc/sudoers.d/compiler
57+
RUN chmod 0440 /etc/sudoers.d/compiler && \
58+
adduser --disabled-password --gecos \"\" compiler && \
59+
usermod -a -G sudo compiler

jdk9/DumpPort.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package jshellhack;
2+
3+
import java.nio.file.*;
4+
import java.lang.*;
5+
6+
import static java.nio.file.StandardOpenOption.CREATE;
7+
import static java.nio.file.StandardOpenOption.WRITE;
8+
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
9+
10+
public class DumpPort {
11+
12+
public static void main(String[] args) throws Exception {
13+
StringBuilder build = new StringBuilder();
14+
build.append(args[0]);
15+
build.append("\n");
16+
OpenOption[] opts = new OpenOption[] { CREATE, WRITE, TRUNCATE_EXISTING };
17+
Files.write(Paths.get("/tmp/jshellargs"), build.toString().getBytes(), opts);
18+
}
19+
}

jdk9/apt.sources.list.debian

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
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

jdk9/build.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd "$(dirname ${BASH_SOURCE[0]})"
5+
source config.sh
6+
7+
cd "$JDKDIR"
8+
9+
# refresh patched build system
10+
bash ./common/autoconf/autogen.sh
11+
12+
## Description ##
13+
# Use the downloaded JDK: --with-boot-jdk=/opt/jdkcross/jdk-9.0.1
14+
# Cross-compiling for ARM: --openjdk-target=arm-linux-gnueabi
15+
# Tune for ARM926EJ-S softfp: --with-abi-profile=arm-ev3
16+
# Disable GUI: --enable-headless-only
17+
# Help to find freetype: --with-freetype-lib=/usr/lib/arm-linux-gnueabi
18+
# --with-freetype-include=/usr/include
19+
# Build only the Client VM: --with-jvm-variants=client
20+
# Add extra build flags: --with-extra-cflags="-Wno-maybe-uninitialized -D__SOFTFP__"
21+
# - Fix the build on new GCC: -Wno-maybe-uninitialized
22+
# - Force softfloat runtime: -D__SOFTFP__
23+
# Fix the "internal" string: --with-version-string="9.0.1+11"
24+
# Fix for GCC and LTO objects: AR="arm-linux-gnueabi-gcc-ar"
25+
# NM="arm-linux-gnueabi-gcc-nm"
26+
# BUILD_AR="gcc-ar"
27+
# BUILD_NM="gcc-nm"
28+
29+
# configure the build
30+
bash ./configure --with-boot-jdk="$SCRIPTDIR/jdk-9.0.4" \
31+
--openjdk-target=arm-linux-gnueabi \
32+
--with-abi-profile=arm-ev3 \
33+
--enable-headless-only \
34+
--with-freetype-lib=/usr/lib/arm-linux-gnueabi \
35+
--with-freetype-include=/usr/include \
36+
--with-jvm-variants=client \
37+
--with-extra-cflags="-w -Wno-error -D__SOFTFP__" \
38+
--with-extra-cxxflags="-w -Wno-error -D__SOFTFP__" \
39+
--with-version-string="$JAVA_VERSION" \
40+
AR="arm-linux-gnueabi-gcc-ar" \
41+
NM="arm-linux-gnueabi-gcc-nm" \
42+
BUILD_AR="gcc-ar" \
43+
BUILD_NM="gcc-nm"
44+
45+
# start the build
46+
make clean images

jdk9/compiler.sudoers

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
compiler ALL=(ALL) NOPASSWD:ALL

jdk9/config.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
JAVA_VERSION="9.0.4+12"
4+
JAVA_REPO="http://hg.openjdk.java.net/jdk-updates/jdk9u/"
5+
SCRIPTDIR="/opt/jdkcross"
6+
7+
BUILDDIR="/build"
8+
JDKDIR="/build/jdk"
9+
IMAGEDIR="/build/jdk/build/linux-arm-normal-client-release/images"

jdk9/ev3.patch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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
4+
@@ -30,7 +30,7 @@
5+
AC_DEFUN([FLAGS_SETUP_ABI_PROFILE],
6+
[
7+
AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile],
8+
- [specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])])
9+
+ [specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt,arm-ev3,armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])])
10+
11+
if test "x$with_abi_profile" != x; then
12+
if test "x$OPENJDK_TARGET_CPU" != xarm && \
13+
@@ -51,6 +51,9 @@
14+
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then
15+
ARM_FLOAT_TYPE=sflt
16+
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
17+
+ elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-ev3; then
18+
+ ARM_FLOAT_TYPE=sflt
19+
+ ARM_ARCH_TYPE_FLAGS='-mcpu=arm926ej-s -marm'
20+
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then
21+
ARM_FLOAT_TYPE=vfp-sflt
22+
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
23+
@@ -1305,6 +1308,8 @@
24+
if test "x$OPENJDK_$1_OS" = xlinux; then
25+
if test "x$OPENJDK_$1_CPU" = xx86; then
26+
$2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -march=i586"
27+
+ elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-ev3; then
28+
+ $2JVM_ASFLAGS="-mcpu=arm926ej-s"
29+
fi
30+
elif test "x$OPENJDK_$1_OS" = xmacosx; then
31+
$2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -x assembler-with-cpp -mno-omit-leaf-frame-pointer -mstack-alignment=16"

0 commit comments

Comments
 (0)