Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdoptOpenJDK 17 Support #80

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion packaging/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG DEBIAN_RELEASE=stretch
ARG DEBIAN_RELEASE=buster
FROM ev3dev/ev3dev-$DEBIAN_RELEASE-ev3-base

ARG DEBIAN_RELEASE
Expand Down
2 changes: 1 addition & 1 deletion scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG DEBIAN_RELEASE=stretch
ARG DEBIAN_RELEASE=buster
ARG BUILD_TYPE=cross

FROM ev3dev-lang-java:jdk-$BUILD_TYPE-$DEBIAN_RELEASE
Expand Down
29 changes: 28 additions & 1 deletion scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,33 @@ elif [ "$JDKVER" == "15" ]; then
HOTSPOT_ABI=arm-sflt
JNI_PATH_FLAGS="--with-jni-libpath=/usr/lib/$DEB_HOST_MULTIARCH/jni:/lib/$DEB_HOST_MULTIARCH:/usr/lib/$DEB_HOST_MULTIARCH:/usr/lib/jni:/lib:/usr/lib"

# OpenJDK 17
elif [ "$JDKVER" == "17" ]; then
VERSION_POLICY="latest_general_availability"
JAVA_REPO="https://github.com/adoptium/jdk17u.git"
JAVA_SCM="git"
PATCHVER="jdk17"
AUTOGEN_STYLE="v2"
if [ "$BUILDER_TYPE" = "native" ]; then
HOSTJDK="$BUILDDIR/jdk-ev3"
HOSTJDK_RENAME_FROM="$BUILDDIR/jdk"
HOSTJDK_FILE="$BUILDDIR/jdk-ev3.tar.gz"
# stretch and buster have different versions
if [ "$BUILDER_DISTRO" = "stretch" ]; then
HOSTJDK_URL="https://ci.adoptium.net/job/eljbuild/job/stretch-bleeding/85/artifact/build/jdk-ev3.tar.gz"
else
HOSTJDK_URL="https://ci.adoptium.net/job/eljbuild/job/buster-bleeding/84/artifact/build/jdk-ev3.tar.gz"
fi
else
# same for both stretch & buster
HOSTJDK="$BUILDDIR/jdk-17.0.10+7"
HOSTJDK_FILE="$BUILDDIR/OpenJDK17U-jdk_x64_linux_hotspot_17.0.10_7.tar.gz"
HOSTJDK_URL="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.10%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.10_7.tar.gz"
fi
IMAGEDIR="$JDKDIR/build/linux-arm-${JDKVM}-${HOTSPOT_DEBUG}/images"
HOTSPOT_ABI=arm-sflt
JNI_PATH_FLAGS="--with-jni-libpath=/usr/lib/$DEB_HOST_MULTIARCH/jni:/lib/$DEB_HOST_MULTIARCH:/usr/lib/$DEB_HOST_MULTIARCH:/usr/lib/jni:/lib:/usr/lib"

# OpenJDK Loom & Master+dev
elif [ "$JDKVER" == "loom" ] || [ "$JDKVER" == "tip" ]; then
if [ "$JDKVER" == "loom" ]; then
Expand All @@ -327,7 +354,7 @@ elif [ "$JDKVER" == "loom" ] || [ "$JDKVER" == "tip" ]; then
else
VERSION_POLICY="latest_tag"
JAVA_REPO="https://github.com/openjdk/jdk.git"
PATCHVER="jdk16"
PATCHVER="jdk17"
fi
JAVA_SCM="git"
AUTOGEN_STYLE="v2"
Expand Down
46 changes: 46 additions & 0 deletions scripts/jdk17_new.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/make/autoconf/hotspot.m4 b/make/autoconf/hotspot.m4
index 43653c115..4c5f960a8 100644
--- a/make/autoconf/hotspot.m4
+++ b/make/autoconf/hotspot.m4
@@ -138,6 +138,11 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_MISC],
HOTSPOT_TARGET_CPU_DEFINE="ARM32"
fi

+ if test "x$OPENJDK_BUILD_CPU" = xarm; then
+ HOTSPOT_BUILD_CPU=arm_32
+ HOTSPOT_BUILD_CPU_DEFINE="ARM32"
+ fi
+
# --with-cpu-port is no longer supported
UTIL_DEPRECATED_ARG_WITH(with-cpu-port)

diff --git a/src/hotspot/share/memory/metaspaceShared.cpp b/src/hotspot/share/memory/metaspaceShared.cpp
index 7adecd141..e895e21d1 100644
--- a/src/hotspot/share/memory/metaspaceShared.cpp
+++ b/src/hotspot/share/memory/metaspaceShared.cpp
@@ -71,6 +71,7 @@
#include "utilities/ostream.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/hashtable.inline.hpp"
+#include "gc/shared/softRefPolicy.hpp"
#if INCLUDE_G1GC
#include "gc/g1/g1CollectedHeap.inline.hpp"
#endif
diff --git a/src/hotspot/share/oops/constantPool.cpp b/src/hotspot/share/oops/constantPool.cpp
index 1761efa7a..cd0602cd0 100644
--- a/src/hotspot/share/oops/constantPool.cpp
+++ b/src/hotspot/share/oops/constantPool.cpp
@@ -443,8 +443,12 @@ void ConstantPool::remove_unshareable_info() {
}

int ConstantPool::cp_to_object_index(int cp_index) {
+ Array<u2> *map = reference_map();
+ if (map == 0)
+ return _no_index_sentinel;
+
// this is harder don't do this so much.
- int i = reference_map()->find(cp_index);
+ int i = map->find(cp_index);
// We might not find the index for jsr292 call.
return (i < 0) ? _no_index_sentinel : i;
}
20 changes: 20 additions & 0 deletions scripts/jdk17_nosflt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/src/hotspot/cpu/arm/assembler_arm_32.hpp b/src/hotspot/cpu/arm/assembler_arm_32.hpp
index dd04ad1ab..d43e29e5a 100644
--- a/src/hotspot/cpu/arm/assembler_arm_32.hpp
+++ b/src/hotspot/cpu/arm/assembler_arm_32.hpp
@@ -1248,10 +1248,11 @@ extern int __aeabi_dcmpgt(double, double);

// Imported code from glibc soft-fp bundle for
// calculation accuracy improvement. See CR 6757269.
-extern double __aeabi_fadd_glibc(float, float);
-extern double __aeabi_fsub_glibc(float, float);
-extern double __aeabi_dadd_glibc(double, double);
-extern double __aeabi_dsub_glibc(double, double);
+#define __aeabi_fadd_glibc __aeabi_fadd
+#define __aeabi_fsub_glibc __aeabi_fsub
+#define __aeabi_dadd_glibc __aeabi_dadd
+#define __aeabi_dsub_glibc __aeabi_dsub
+
};
#endif // __SOFTFP__

8 changes: 5 additions & 3 deletions system/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG DEBIAN_RELEASE=stretch
ARG DEBIAN_RELEASE=buster
ARG ARCH=armel
FROM debian:$DEBIAN_RELEASE
ARG DEBIAN_RELEASE
Expand All @@ -7,9 +7,11 @@ ARG ARCH
# this is a customized version of ev3dev-stretch-cross image

# setup repositories and install required packages
COPY sources.list.$DEBIAN_RELEASE /etc/apt/sources.list
#COPY sources.list.$DEBIAN_RELEASE /etc/apt/sources.list
COPY ev3dev-archive-keyring.gpg /etc/apt/trusted.gpg.d/
RUN dpkg --add-architecture $ARCH && \
apt-get update && \
apt-get install apt-transport-https -y && \
apt-get -qq update && \
DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \
bash-completion \
Expand Down Expand Up @@ -64,7 +66,7 @@ RUN dpkg --add-architecture $ARCH && \
git \
zlib1g-dev && \
( if [ "$DEBIAN_RELEASE" = "stretch" ]; then \
wget http://ftp.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_3.1-2_$ARCH.deb -O /tmp/systemtap.deb; \
wget http://archive.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_3.1-2_$ARCH.deb -O /tmp/systemtap.deb; \
elif [ "$DEBIAN_RELEASE" = "buster" ]; then \
wget http://ftp.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_4.0-1_$ARCH.deb -O /tmp/systemtap.deb; \
fi ) && \
Expand Down
2 changes: 1 addition & 1 deletion system/Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG DEBIAN_RELEASE=stretch
ARG DEBIAN_RELEASE=buster
ARG ARCH=armel
FROM ev3dev/debian-$DEBIAN_RELEASE-$ARCH-qemu-minbase
ARG DEBIAN_RELEASE
Expand Down
10 changes: 7 additions & 3 deletions system/sources.list.buster
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
deb http://httpredir.debian.org/debian buster main contrib non-free
#deb-src http://httpredir.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free
deb http://deb.debian.org/debian-security buster/updates main contrib non-free
deb http://archive.ev3dev.org/debian buster main
#deb http://security.debian.org/ buster/updates main contrib non-free
#deb-src http://security.debian.org/ buster/updates main contrib non-free

deb http://archive.ev3dev.org/debian buster main
#deb-src http://archive.ev3dev.org/debian buster main
4 changes: 1 addition & 3 deletions system/sources.list.stretch
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
deb http://deb.debian.org/debian stretch main contrib non-free
deb http://deb.debian.org/debian stretch-updates main contrib non-free
deb http://deb.debian.org/debian-security stretch/updates main contrib non-free
deb http://archive.debian.org/debian stretch main contrib non-free
deb http://archive.ev3dev.org/debian stretch main