Monday, March 30, 2026

[fix] devel/jdk/{21,25}: Fix missing call to generate_atomic_entry_points on aarch64

I've been reviewing the jdk code base as part of the bsd-port
upstreaming efforts. I noticed we were missing a call to
StubGenerator::generate_atomic_entry_points() on aarch64. This
likely would have an impact on cpus that support HWCAP_ATOMICS
such as Apple's M2 processor. Although I don't have a test case
this fixes, this has been reviewed by my fellow bsd-port developers.

okay?

Index: 21/Makefile
===================================================================
RCS file: /cvs/ports/devel/jdk/21/Makefile,v
diff -u -p -u -r1.14 Makefile
--- 21/Makefile 30 Jan 2026 16:30:56 -0000 1.14
+++ 21/Makefile 30 Mar 2026 20:45:47 -0000
@@ -12,7 +12,7 @@ PACKAGE_VER= ${BASE_VER}.${BUILD_VER}.${
PKGNAME= jdk-${PACKAGE_VER}
PKGSTEM= jdk-21
EPOCH= 0
-REVISION= 0
+REVISION= 1

DIST_SUBDIR= jdk
DISTNAME= jdk-${VERSION_STR}
Index: 21/patches/patch-src_hotspot_cpu_aarch64_stubGenerator_aarch64_cpp
===================================================================
RCS file: 21/patches/patch-src_hotspot_cpu_aarch64_stubGenerator_aarch64_cpp
diff -N 21/patches/patch-src_hotspot_cpu_aarch64_stubGenerator_aarch64_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 21/patches/patch-src_hotspot_cpu_aarch64_stubGenerator_aarch64_cpp 30 Mar 2026 20:45:47 -0000
@@ -0,0 +1,28 @@
+Fix missing call to generate_atomic_entry_points()
+
+Index: src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
+--- src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp.orig
++++ src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
+@@ -7109,7 +7109,7 @@ class StubGenerator: public StubCodeGenerator {
+ return start;
+ }
+
+-#if (defined (LINUX) && !defined (__ARM_FEATURE_ATOMICS)) || defined(_BSDONLY_SOURCE)
++#if (defined (LINUX) || defined (_BSDONLY_SOURCE)) && !defined (__ARM_FEATURE_ATOMICS)
+
+ // ARMv8.1 LSE versions of the atomic stubs used by Atomic::PlatformXX.
+ //
+@@ -8737,11 +8737,11 @@ class StubGenerator: public StubCodeGenerator {
+ StubRoutines::_poly1305_processBlocks = generate_poly1305_processBlocks();
+ }
+
+-#if defined (LINUX) && !defined (__ARM_FEATURE_ATOMICS)
++#if (defined (LINUX) || defined (_BSDONLY_SOURCE)) && !defined (__ARM_FEATURE_ATOMICS)
+
+ generate_atomic_entry_points();
+
+-

No comments:

Post a Comment