Skip to content

Commit 5f86297

Browse files
fix(build): update patches, ndk and docker image to build newer versions
1 parent 691cab3 commit 5f86297

File tree

5 files changed

+11
-29
lines changed

5 files changed

+11
-29
lines changed

6_buildjdk.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ if [[ "$BUILD_IOS" != "1" ]]; then
5050

5151
AUTOCONF_x11arg="--x-includes=$ANDROID_INCLUDE/X11"
5252

53-
export CFLAGS+=" -mllvm -polly -DANDROID"
54-
export LDFLAGS+=" -L$PWD/dummy_libs"
53+
export CFLAGS+=" -mllvm -polly -DANDROID -Wno-error=implicit-function-declaration -Wno-error=int-conversion"
54+
export LDFLAGS+=" -L$PWD/dummy_libs -Wl,--undefined-version"
5555

5656
# Create dummy libraries so we won't have to remove them in OpenJDK makefiles
5757
mkdir -p dummy_libs
@@ -88,9 +88,9 @@ cd openjdk-${TARGET_VERSION}
8888
# Apply patches
8989
git reset --hard
9090
if [[ "$BUILD_IOS" != "1" ]]; then
91-
find ../patches/jre_${TARGET_VERSION}/android -name "*.diff" -print0 | xargs -0 -I {} sh -c 'echo "Applying {}" && git apply --reject --whitespace=fix {} || echo "git apply failed (Android patch set)"'
91+
find ../patches/jre_${TARGET_VERSION}/android -name "*.diff" -print0 | xargs -0 -I {} sh -c 'echo "Applying {}" && git apply --reject --whitespace=fix {} || (echo "git apply failed (Android patch set)" && exit 1)'
9292
else
93-
find ../patches/jre_${TARGET_VERSION}/ios -name "*.diff" -print0 | xargs -0 -I {} sh -c 'echo "Applying {}" && git apply --reject --whitespace=fix {} || echo "git apply failed (iOs patch set)"'
93+
find ../patches/jre_${TARGET_VERSION}/ios -name "*.diff" -print0 | xargs -0 -I {} sh -c 'echo "Applying {}" && git apply --reject --whitespace=fix {} || (echo "git apply failed (iOs patch set)" && exit 1)'
9494

9595
# Hack: exclude building macOS stuff
9696
desktop_mac=src/java.desktop/macosx

Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:jammy
1+
FROM ubuntu:23.10
22

33
RUN apt-get update
44

@@ -29,7 +29,9 @@ RUN apt-get install -y \
2929
clang \
3030
git \
3131
file \
32-
make
32+
make \
33+
cmake \
34+
xz-utils
3335

3436
# JDK 17
3537
RUN apt-get install -y openjdk-17-jdk
@@ -39,7 +41,7 @@ WORKDIR /home
3941

4042

4143
# NDK install
42-
ENV NDK_VERSION r25c
44+
ENV NDK_VERSION r27b
4345
ENV ANDROID_NDK_HOME /home/android-ndk-$NDK_VERSION
4446
RUN \
4547
wget -nc -nv -O android-ndk-$NDK_VERSION-linux-x86_64.zip "https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux.zip" \

patches/jre_17/android/1_fix_toolchain.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ index 5eed1138f..b4319de67 100644
3535
@@ -374,7 +374,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
3636
#### OS DEFINES, these should be independent on toolchain
3737
if test "x$OPENJDK_TARGET_OS" = xlinux; then
38-
CFLAGS_OS_DEF_JVM="-DLINUX"
38+
CFLAGS_OS_DEF_JVM="-DLINUX -D_FILE_OFFSET_BITS=64"
3939
- CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
4040
+ # CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
4141
+ CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -D__USE_BSD"

patches/jre_21/android/jdk21u_android.diff

-20
Original file line numberDiff line numberDiff line change
@@ -2258,26 +2258,6 @@ index 21ef40688..b8c2520d2 100644
22582258
#endif
22592259

22602260
if (exec_path == NULL) {
2261-
diff --git a/src/java.base/unix/native/libnet/net_util_md.c b/src/java.base/unix/native/libnet/net_util_md.c
2262-
index 4ec11a136..01b85db4d 100644
2263-
--- a/src/java.base/unix/native/libnet/net_util_md.c
2264-
+++ b/src/java.base/unix/native/libnet/net_util_md.c
2265-
@@ -129,6 +129,7 @@ jint IPv6_supported()
2266-
SOCKETADDRESS sa;
2267-
socklen_t sa_len = sizeof(SOCKETADDRESS);
2268-
2269-
+#ifndef __ANDROID__ // ANDROID: skip check, see libcore commit ae218d9b
2270-
fd = socket(AF_INET6, SOCK_STREAM, 0) ;
2271-
if (fd < 0) {
2272-
/*
2273-
@@ -172,6 +173,7 @@ jint IPv6_supported()
2274-
}
2275-
}
2276-
#endif
2277-
+#endif // !defined __ANDROID__
2278-
2279-
/*
2280-
* OK we may have the stack available in the kernel,
22812261
diff --git a/src/java.base/unix/native/libnet/net_util_md.h b/src/java.base/unix/native/libnet/net_util_md.h
22822262
index 902cf9673..3b8acd66b 100644
22832263
--- a/src/java.base/unix/native/libnet/net_util_md.h

setdevkitpath.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Description: Set the environment variables for the build scripts.
2-
export NDK_VERSION=r25c
2+
export NDK_VERSION=r27b
33

44
# Target version is either 17 or 21
55
if [[ -z "$TARGET_VERSION" ]]

0 commit comments

Comments
 (0)