git: a936fb9b16ba - main - java/openjdk23: FreeBSD updates and fixes
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 25 Sep 2025 03:18:22 UTC
The branch main has been updated by jrm:
URL: https://cgit.FreeBSD.org/ports/commit/?id=a936fb9b16bac7cc5945213c7edf8c6a57709591
commit a936fb9b16bac7cc5945213c7edf8c6a57709591
Author: Harald Eilertsen <haraldei@anduin.net>
AuthorDate: 2025-09-24 15:03:22 +0000
Commit: Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2025-09-25 02:42:32 +0000
java/openjdk23: FreeBSD updates and fixes
- Enable IPv6 dual protocol socket support on FreeBSD.
- Fixed a performance issue when looking up committed memory size and
number of open file handles via the OperatingSystemMXBean interface.
This affected some large ElasticSearch clusters, but potentially also
other large high performance systems.
Reviewed by: emaste, jrm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52381
---
java/openjdk23/Makefile | 8 +-
java/openjdk23/distinfo | 6 +-
...native_libmanagement__ext_OperatingSystemImpl.c | 89 ----------------------
3 files changed, 7 insertions(+), 96 deletions(-)
diff --git a/java/openjdk23/Makefile b/java/openjdk23/Makefile
index 66a35c8dde55..fc20c675bde0 100644
--- a/java/openjdk23/Makefile
+++ b/java/openjdk23/Makefile
@@ -3,7 +3,6 @@ DISTVERSIONPREFIX= jdk-
DISTVERSION= ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION}
CATEGORIES= java devel
PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION}
-PORTREVISION= 3
MAINTAINER= java@FreeBSD.org
COMMENT= Java Development Kit ${JDK_MAJOR_VERSION}
@@ -40,8 +39,9 @@ USE_XORG= x11 xext xi xrandr xrender xt xtst
CPE_VENDOR= oracle
USE_GITHUB= yes
-GH_ACCOUNT= battleblow
-GH_PROJECT= jdk23u
+GH_ACCOUNT= freebsd
+GH_PROJECT= openjdk
+GH_TAGNAME= jdk-23.0.2+7-freebsd-2
NO_CCACHE= yes
@@ -69,7 +69,7 @@ JDK_MAJOR_VERSION= 23
JDK_MINOR_VERSION= 0
JDK_PATCH_VERSION= 2
JDK_BUILD_NUMBER= 7
-BSD_JDK_VERSION= 1
+BSD_JDK_VERSION= 2
JDK_BUG_URL= https://bugs.freebsd.org/bugzilla/enter_bug.cgi?product=Ports%20%26%20Packages&component=Individual%20Port(s)&short_desc=java/${PORTNAME}${JDK_MAJOR_VERSION}%3A%20
diff --git a/java/openjdk23/distinfo b/java/openjdk23/distinfo
index c4503618142a..110eeb899a39 100644
--- a/java/openjdk23/distinfo
+++ b/java/openjdk23/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1739592718
-SHA256 (battleblow-jdk23u-jdk-23.0.2+7-1_GH0.tar.gz) = 092147404af068e85dbd1535f36da32c9a2077708154f69ba3a94ba64fa2aaba
-SIZE (battleblow-jdk23u-jdk-23.0.2+7-1_GH0.tar.gz) = 117326728
+TIMESTAMP = 1756989931
+SHA256 (freebsd-openjdk-jdk-23.0.2+7-2-jdk-23.0.2+7-freebsd-2_GH0.tar.gz) = ec011f440f6e3f0eff1b67811a3a9fc5094be772f30519af2bfb914abaa6d666
+SIZE (freebsd-openjdk-jdk-23.0.2+7-2-jdk-23.0.2+7-freebsd-2_GH0.tar.gz) = 117311366
diff --git a/java/openjdk23/files/patch-src_jdk.management_unix_native_libmanagement__ext_OperatingSystemImpl.c b/java/openjdk23/files/patch-src_jdk.management_unix_native_libmanagement__ext_OperatingSystemImpl.c
deleted file mode 100644
index 421548d0f4a5..000000000000
--- a/java/openjdk23/files/patch-src_jdk.management_unix_native_libmanagement__ext_OperatingSystemImpl.c
+++ /dev/null
@@ -1,89 +0,0 @@
---- src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c.orig 2023-10-01 03:54:04 UTC
-+++ src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
-@@ -58,6 +58,7 @@
- #include <unistd.h>
-
- #ifdef __FreeBSD__
-+#include <sys/user.h>
- #include <vm/vm_param.h>
- #endif
-
-@@ -177,23 +178,43 @@ Java_com_sun_management_internal_OperatingSystemImpl_g
- }
- return t_info.virtual_size;
- #elif defined(__FreeBSD__)
-- FILE *fp;
-- unsigned long end, start;
-- jlong total = 0;
-+ int mib[4];
-+ struct kinfo_vmentry *kve;
-+ long total = 0;
-+ size_t len = 0;
-+ int error;
-+ char *buf, *bp, *eb;
-
-- if ((fp = fopen("/proc/curproc/map", "r")) == NULL) {
-- throw_internal_error(env, "Unable to open /proc/curproc/map");
-+ mib[0] = CTL_KERN;
-+ mib[1] = KERN_PROC;
-+ mib[2] = KERN_PROC_VMMAP;
-+ mib[3] = getpid();
-+ error = sysctl(mib, 4, NULL, &len, NULL, 0);
-+ if (error) {
-+ throw_internal_error(env, "Cannot sysctl(kern.proc.vvmap)");
- return -1;
- }
--
-- for (;;) {
-- // Ignore everything except start and end entries
-- if (fscanf(fp, "0x%lx 0x%lx %*[^\n]\n", &start, &end) != 2 || start > end)
-- break;
-- total += end - start;
-+ len = len * 4 / 3;
-+ buf = malloc(len);
-+ if (buf == NULL) {
-+ throw_internal_error(env, "Fail to allocate memory");
-+ return -1;
- }
--
-- fclose(fp);
-+ error = sysctl(mib, 4, buf, &len, NULL, 0);
-+ if (error) {
-+ throw_internal_error(env, "Cannot sysctl(kern.proc.vvmap)");
-+ return -1;
-+ }
-+ bp = buf;
-+ eb = buf + len;
-+ while (bp < eb) {
-+ kve = (struct kinfo_vmentry *)(uintptr_t)bp;
-+ if (kve->kve_structsize == 0)
-+ break;
-+ bp += kve->kve_structsize;
-+ total += kve->kve_end - kve->kve_start;
-+ }
-+ free(buf);
- return total;
- #else /* _ALLBSD_SOURCE */
- /*
-@@ -403,6 +424,21 @@ Java_com_sun_management_internal_OperatingSystemImpl_g
- return nfiles;
- #elif defined(__OpenBSD__)
- return getdtablecount();
-+#elif defined(__FreeBSD__)
-+ int mib[4];
-+ int error;
-+ int nfds;
-+ size_t len;
-+
-+ len = sizeof(nfds);
-+ mib[0] = CTL_KERN;
-+ mib[1] = KERN_PROC;
-+ mib[2] = KERN_PROC_NFDS;
-+ mib[3] = 0;
-+
-+ if (sysctl(mib, 4, &nfds, &len, NULL, 0) == -1)
-+ return -1;
-+ return nfds;
- #else /* solaris/linux */
- DIR *dirp;
- struct dirent* dentp;