Skip to content

Commit 7e68e08

Browse files
committed
Merge JDK10 to master
2 parents 9a9bcb2 + a0bf803 commit 7e68e08

File tree

10 files changed

+261
-0
lines changed

10 files changed

+261
-0
lines changed

jdk10/Dockerfile.scripts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM ev3dev-lang-java:jdk10-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+
7+
# this directory should be mounted
8+
VOLUME /build
9+
10+
USER compiler
11+
WORKDIR /opt/jdkcross
12+
CMD ["/bin/bash"] ["--login"]

jdk10/Dockerfile.system

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

jdk10/all.patch

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 Wed Mar 28 01:46:33 2018 +0200
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+
@@ -1378,6 +1381,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"
32+
diff -r b09e56145e11 src/hotspot/cpu/arm/assembler_arm_32.hpp
33+
--- a/src/hotspot/cpu/arm/assembler_arm_32.hpp Thu Mar 08 04:23:31 2018 +0000
34+
+++ b/src/hotspot/cpu/arm/assembler_arm_32.hpp Wed Mar 28 01:46:33 2018 +0200
35+
@@ -498,7 +498,7 @@
36+
void dmb(DMB_Opt opt, Register reg) {
37+
if (VM_Version::arm_arch() >= 7) {
38+
emit_int32(0xF57FF050 | opt);
39+
- } else {
40+
+ } else if (VM_Version::arm_arch() == 6) {
41+
bool preserve_tmp = (reg == noreg);
42+
if(preserve_tmp) {
43+
reg = Rtemp;
44+
@@ -1239,10 +1239,17 @@
45+
46+
// Imported code from glibc soft-fp bundle for
47+
// calculation accuracy improvement. See CR 6757269.
48+
-extern double __aeabi_fadd_glibc(float, float);
49+
-extern double __aeabi_fsub_glibc(float, float);
50+
-extern double __aeabi_dadd_glibc(double, double);
51+
-extern double __aeabi_dsub_glibc(double, double);
52+
+
53+
+//extern double __aeabi_fadd_glibc(float, float);
54+
+//extern double __aeabi_fsub_glibc(float, float);
55+
+//extern double __aeabi_dadd_glibc(double, double);
56+
+//extern double __aeabi_dsub_glibc(double, double);
57+
+
58+
+// We don't need very accurate floating point math.
59+
+#define __aeabi_fadd_glibc __aeabi_fadd
60+
+#define __aeabi_fsub_glibc __aeabi_fsub
61+
+#define __aeabi_dadd_glibc __aeabi_dadd
62+
+#define __aeabi_dsub_glibc __aeabi_dsub
63+
};
64+
#endif // __SOFTFP__
65+
66+
diff -r b09e56145e11 src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp
67+
--- a/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp Thu Mar 08 04:23:31 2018 +0000
68+
+++ b/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp Wed Mar 28 01:46:33 2018 +0200
69+
@@ -71,7 +71,7 @@
70+
__asm__ volatile (
71+
".word 0xF57FF050 | 0xf" : : : "memory");
72+
#endif
73+
- } else {
74+
+ } else if (VM_Version::arm_arch() == 6) {
75+
intptr_t zero = 0;
76+
__asm__ volatile (
77+
"mcr p15, 0, %0, c7, c10, 5"
78+
@@ -95,7 +95,7 @@
79+
__asm__ volatile (
80+
".word 0xF57FF050 | 0xe" : : : "memory");
81+
#endif
82+
- } else {
83+
+ } else if (VM_Version::arm_arch() == 6) {
84+
intptr_t zero = 0;
85+
__asm__ volatile (
86+
"mcr p15, 0, %0, c7, c10, 5"

jdk10/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

jdk10/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 ./make/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-10" \
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

jdk10/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

jdk10/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="10+46"
4+
JAVA_REPO="http://hg.openjdk.java.net/jdk-updates/jdk10u/"
5+
SCRIPTDIR="/opt/jdkcross"
6+
7+
BUILDDIR="/build"
8+
JDKDIR="/build/jdk"
9+
IMAGEDIR="/build/jdk/build/linux-arm-normal-client-release/images"

jdk10/ev3dev-archive-keyring.gpg

2.42 KB
Binary file not shown.

jdk10/fetch.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd "$(dirname ${BASH_SOURCE[0]})"
5+
source config.sh
6+
7+
# clone the root project
8+
hg clone "$JAVA_REPO" "$JDKDIR"
9+
10+
# clone the rest of the tree
11+
cd "$JDKDIR"
12+
13+
# apply the EV3-specific patches
14+
patch -p1 < "$SCRIPTDIR/all.patch"
15+

jdk10/zip.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd "$(dirname ${BASH_SOURCE[0]})"
5+
source config.sh
6+
7+
# enter images directory
8+
cd "$IMAGEDIR"
9+
10+
# clean destinations
11+
rm -rf ./jre-ev3
12+
13+
# build ev3 runtime image
14+
"$SCRIPTDIR/jdk-10/bin/jlink" \
15+
--module-path ./jmods/ \
16+
--endian little \
17+
--compress 0 \
18+
--strip-debug \
19+
--no-header-files \
20+
--no-man-pages \
21+
--add-modules java.se,jdk.jdwp.agent \
22+
--output ./jre-ev3
23+
24+
# create zip files
25+
tar -cf - jre-ev3 | pigz -9 > "$BUILDDIR/jre-ev3.tar.gz"
26+
tar -cf - jdk | pigz -9 > "$BUILDDIR/jdk-ev3.tar.gz"
27+
tar -cf - jmods | pigz -9 > "$BUILDDIR/jmods.tar.gz"

0 commit comments

Comments
 (0)