aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2023-01-24 05:15:43 +0000
committerGreg Lewis <glewis@FreeBSD.org>2023-01-24 05:19:21 +0000
commitb39d592147e2c549d009e01dba155f14128e600f (patch)
treeb6f45615671f647524fef243f68da51e68d907c4
parent209f714d29ffd6cd46d8d02a687cc24be6039aad (diff)
downloadports-b39d592147e2c549d009e01dba155f14128e600f.tar.gz
ports-b39d592147e2c549d009e01dba155f14128e600f.zip
java/openjdk17: Fix the build on some aarch64 machines
* Disable CompressedClassPointers on aarch64. This fixes the build on some aarch64 machines where it previously failed, e.g. RPI4, and doesn't seem to affect the build on others (AWS aarch64 hardware). This is based on and uses a patch initially created by ronald@ PR: 260187 Tested by: ronald@
-rw-r--r--java/openjdk17/Makefile5
-rw-r--r--java/openjdk17/files/extra-patch-src_hotspot_share_runtime_arguments.cpp21
2 files changed, 26 insertions, 0 deletions
diff --git a/java/openjdk17/Makefile b/java/openjdk17/Makefile
index 38dc8ac87719..d880897b027c 100644
--- a/java/openjdk17/Makefile
+++ b/java/openjdk17/Makefile
@@ -161,6 +161,11 @@ CONFIGURE_ARGS+= --disable-dtrace
.if ${ARCH} == powerpc64 && ${OSREL:C/\.[0-9]//} == 12
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src_hotspot_cpu_ppc_vm__version__ppc.hpp
.endif
+.if ${ARCH} == aarch64
+CONFIGURE_ARGS+= --with-boot-jdk-jvmargs=-XX:-UseCompressedClassPointers
+MAKE_ENV+= JAVA_TOOL_OPTIONS="-XX:-UseCompressedClassPointers"
+EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src_hotspot_share_runtime_arguments.cpp
+.endif
.if empty(ICONV_LIB)
ICONV_CFLAGS= -DLIBICONV_PLUG
diff --git a/java/openjdk17/files/extra-patch-src_hotspot_share_runtime_arguments.cpp b/java/openjdk17/files/extra-patch-src_hotspot_share_runtime_arguments.cpp
new file mode 100644
index 000000000000..80ef25c560f6
--- /dev/null
+++ b/java/openjdk17/files/extra-patch-src_hotspot_share_runtime_arguments.cpp
@@ -0,0 +1,21 @@
+--- src/hotspot/share/runtime/arguments.cpp.orig 2023-01-15 10:13:55.469227000 -0800
++++ src/hotspot/share/runtime/arguments.cpp 2023-01-15 10:20:49.218102000 -0800
+@@ -1557,6 +1557,10 @@
+ // set_use_compressed_oops().
+ void Arguments::set_use_compressed_klass_ptrs() {
+ #ifdef _LP64
++# if defined(__FreeBSD__) && defined(AARCH64)
++ FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
++ FLAG_SET_ERGO(UseCompressedClassPointers, false);
++# else
+ // On some architectures, the use of UseCompressedClassPointers implies the use of
+ // UseCompressedOops. The reason is that the rheap_base register of said platforms
+ // is reused to perform some optimized spilling, in order to use rheap_base as a
+@@ -1582,6 +1586,7 @@
+ }
+ }
+ }
++# endif // __FreeBSD__ && AARCH64
+ #endif // _LP64
+ }
+