git: 642e35da1071 - main - java/openjdk27: Add port
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 22 Sep 2026 11:50:39 UTC
The branch main has been updated by haraldei:
URL: https://cgit.FreeBSD.org/ports/commit/?id=642e35da10717d8920464fdde18f7d322d194ce8
commit 642e35da10717d8920464fdde18f7d322d194ce8
Author: Harald Eilertsen <haraldei@FreeBSD.org>
AuthorDate: 2026-09-04 10:49:02 +0000
Commit: Harald Eilertsen <haraldei@FreeBSD.org>
CommitDate: 2026-09-22 11:49:52 +0000
java/openjdk27: Add port
Upstream release notes:
https://jdk.java.net/27/release-notes
In addition this release contains the following BSD specific fixes:
- Fix os::naked_short_nanosleep on OpenBSD when < 20 miliseconds.
- Only return symbols that match the requested address for dladdr(3) on
BSD.
Reviewed by: pkubaj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59519
---
Mk/Uses/java.mk | 9 +-
java/Makefile | 1 +
java/openjdk27/Makefile | 209 +++++++++++++++++++++
java/openjdk27/distinfo | 11 ++
java/openjdk27/files/patch-configure | 14 ++
.../files/patch-make_autoconf_flags-cflags.m4 | 12 ++
.../files/patch-make_autoconf_libraries.m4 | 15 ++
...pot_os__cpu_bsd__ppc_atomicAccess__bsd__ppc.hpp | 30 +++
...spot_os__cpu_bsd__ppc_orderAccess__bsd__ppc.hpp | 80 ++++++++
...h-src_hotspot_os__cpu_bsd__ppc_os__bsd__ppc.cpp | 89 +++++++++
...spot_os__cpu_bsd__ppc_vm__version__bsd__ppc.cpp | 49 +++++
.../files/patch-src_hotspot_os_bsd_os__bsd.cpp | 22 +++
.../patch-src_hotspot_os_bsd_os__perf__bsd.cpp | 13 ++
java/openjdk27/pkg-descr | 1 +
java/openjdk27/pkg-message | 15 ++
15 files changed, 567 insertions(+), 3 deletions(-)
diff --git a/Mk/Uses/java.mk b/Mk/Uses/java.mk
index f090e83f56b4..2be68ab30712 100644
--- a/Mk/Uses/java.mk
+++ b/Mk/Uses/java.mk
@@ -30,7 +30,7 @@
# JAVA_VERSION List of space-separated suitable java versions for the
# port. An optional "+" allows you to specify a range of
# versions. (allowed values: 8[+] 11[+] 17[+]
-# 21[+] 25[+] 26[+])
+# 21[+] 25[+] 26[+] 27[+])
# JAVA_DEFAULT (Mk/bsd.default-versions.mk) is used if this
# variable is omitted or if JAVA_DEFAULT is part of the range.
# Otherwise the latest LTS from the range is preferred over
@@ -205,7 +205,7 @@ SUB_LIST+= JAVA_OS="${JAVA_OS}"
. endif
# The complete list of Java versions, os and vendors supported.
-__JAVA_VERSION_LIST= 8 11 17 21 25 26
+__JAVA_VERSION_LIST= 8 11 17 21 25 26 27
_JAVA_VERSION_LIST= ${__JAVA_VERSION_LIST} ${__JAVA_VERSION_LIST:S/$/+/}
_JAVA_OS_LIST= native linux
_JAVA_VENDOR_LIST= openjdk oracle
@@ -224,6 +224,8 @@ _JAVA_PORT_NATIVE_OPENJDK_JDK_25_INFO= PORT=java/openjdk25 HOME=${LOCALBASE}/
VERSION=25 OS=native VENDOR=openjdk
_JAVA_PORT_NATIVE_OPENJDK_JDK_26_INFO= PORT=java/openjdk26 HOME=${LOCALBASE}/openjdk26 \
VERSION=26 OS=native VENDOR=openjdk
+_JAVA_PORT_NATIVE_OPENJDK_JDK_27_INFO= PORT=java/openjdk27 HOME=${LOCALBASE}/openjdk27 \
+ VERSION=27 OS=native VENDOR=openjdk
_JAVA_PORT_LINUX_ORACLE_JDK_8_INFO= PORT=java/linux-oracle-jdk18 HOME=${LOCALBASE}/linux-oracle-jdk1.8.0 \
VERSION=8 OS=linux VENDOR=oracle
@@ -243,6 +245,7 @@ __JAVA_PORTS_NATIVE_LTS= \
JAVA_PORT_NATIVE_OPENJDK_JDK_11 \
JAVA_PORT_NATIVE_OPENJDK_JDK_8
__JAVA_PORTS_NATIVE_NON_LTS= \
+ JAVA_PORT_NATIVE_OPENJDK_JDK_27 \
JAVA_PORT_NATIVE_OPENJDK_JDK_26
__JAVA_PORTS_ALL= \
${__JAVA_PORTS_NATIVE_LTS} \
@@ -310,7 +313,7 @@ check-makevars::
. undef _JAVA_PORTS_INSTALLED
. undef _JAVA_PORTS_POSSIBLE
. if defined(JAVA_VERSION)
-_JAVA_VERSION= ${JAVA_VERSION:S/^8+/8 11+/:S/^11+/11 17+/:S/^17+/17 21+/:S/^21+/21 25+/:S/^25+/25 26+/:S/^26+/26/}
+_JAVA_VERSION= ${JAVA_VERSION:S/^8+/8 11+/:S/^11+/11 17+/:S/^17+/17 21+/:S/^21+/21 25+/:S/^25+/25 26+/:S/^26+/26 27+/:S/^27+/27/}
. else
_JAVA_VERSION= ${__JAVA_VERSION_LIST}
. endif
diff --git a/java/Makefile b/java/Makefile
index c906f0188037..d77b61fb8191 100644
--- a/java/Makefile
+++ b/java/Makefile
@@ -85,6 +85,7 @@
SUBDIR += openjdk21-jre
SUBDIR += openjdk25
SUBDIR += openjdk26
+ SUBDIR += openjdk27
SUBDIR += openjdk8
SUBDIR += openjdk8-jre
SUBDIR += openjfx14
diff --git a/java/openjdk27/Makefile b/java/openjdk27/Makefile
new file mode 100644
index 000000000000..9020b6ee8f59
--- /dev/null
+++ b/java/openjdk27/Makefile
@@ -0,0 +1,209 @@
+PORTNAME= openjdk
+DISTVERSIONPREFIX= jdk-
+DISTVERSION= ${JDK_FULL_VERSION:S/.0.0//}
+CATEGORIES= java devel
+MASTER_SITES= LOCAL/openjdk:boot
+PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION}
+DISTFILES= ${BOOTSTRAPJDKFILE}:boot
+
+MAINTAINER= java@FreeBSD.org
+COMMENT= ${COMMENT_${FLAVOR}} ${JDK_MAJOR_VERSION}
+COMMENT_jdk= Java Development Kit
+COMMENT_headless= Java Development Kit (headless version)
+COMMENT_jre= Java Runtime Environment
+COMMENT_jre_headless= Java Runtime Environment (headless version)
+
+WWW= https://openjdk.java.net/projects/jdk/27/
+
+LICENSE= GPLv2
+
+ONLY_FOR_ARCHS= aarch64 amd64 powerpc64 powerpc64le
+
+BUILD_DEPENDS= ${LOCALBASE}/include/cups/cups.h:print/cups \
+ bash:shells/bash \
+ gsed:textproc/gsed \
+ zip:archivers/zip
+
+LIB_DEPENDS= libasound.so:audio/alsa-lib \
+ libfontconfig.so:x11-fonts/fontconfig \
+ libfreetype.so:print/freetype2 \
+ libgif.so:graphics/giflib \
+ libharfbuzz.so:print/harfbuzz \
+ liblcms2.so:graphics/lcms2 \
+ libpng.so:graphics/png
+
+RUN_DEPENDS= javavm:java/javavmwrapper
+
+# This port supports the following flavors:
+#
+# - jdk (default) Full OpenJDK including dev tools and x11 support
+# - headless Full OpenJDK including dev tools, but without x11 support
+# - jre Java Runtime Environment including x11 support
+# - jre_headless Java Runtime Environment without x11 support
+FLAVORS= jdk jre headless jre_headless
+FLAVOR?= ${BUILD_JRE:?jre:${FLAVORS:[1]}}
+
+headless_PKGNAMESUFFIX= ${JDK_MAJOR_VERSION}-headless
+jre_PKGNAMESUFFIX= ${JDK_MAJOR_VERSION}-jre
+jre_headless_PKGNAMESUFFIX= ${JDK_MAJOR_VERSION}-jre-headless
+
+.if ${FLAVOR:M*headless} == ""
+RUN_DEPENDS+= xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype
+USES= autoreconf:build compiler:features cpe gmake iconv jpeg \
+ pkgconfig xorg
+.else
+USES= autoreconf:build compiler:features cpe gmake iconv jpeg \
+ pkgconfig
+.endif
+
+CPE_VENDOR= oracle
+
+USE_GITHUB= yes
+GH_ACCOUNT= freebsd
+
+USE_XORG= x11 xext xi xrandr xrender xt xtst
+
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS= --disable-ccache \
+ --disable-javac-server \
+ --with-alsa=${LOCALBASE} \
+ --with-boot-jdk=${BOOTSTRAPJDKDIR} \
+ --with-cups=${LOCALBASE} \
+ --with-debug-level=release \
+ --with-fontconfig=${LOCALBASE} \
+ --with-freetype=system \
+ --with-giflib-include=${LOCALBASE}/include \
+ --with-giflib-lib=${LOCALBASE}/lib \
+ --with-giflib=system \
+ --with-harfbuzz=system \
+ --with-lcms=system \
+ --with-libjpeg=system \
+ --with-libpng=system \
+ --with-native-debug-symbols=none \
+ --with-num-cores=${MAKE_JOBS_NUMBER} \
+ --with-vendor-bug-url="${JDK_BUG_URL}" \
+ --with-vendor-name="OpenJDK BSD Porting Team" \
+ --with-vendor-url="https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/" \
+ --with-vendor-vm-bug-url="${JDK_BUG_URL}" \
+ --with-version-string=${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION} \
+ --with-zlib=system \
+ --x-includes=${LOCALBASE}/include \
+ --x-libraries=${LOCALBASE}/lib
+.if ${FLAVOR:M*headless}
+CONFIGURE_ARGS+= --enable-headless-only
+.endif
+
+CONFIGURE_ENV= ac_cv_path_SED=${LOCALBASE}/bin/gsed
+CONFIGURE_TARGET= ${JDK_ARCH}-portbld-${OPSYS:tl}${OSREL}
+
+# Suppress passing -j to do-build target via Mk/bsd.port.mk
+# In the JDK build the number of parallel jobs is passed in via configure --with-num-cores=N
+_MAKE_JOBS= #
+MAKE_ENV= CLASSPATH="" \
+ JAVA_HOME="" \
+ LD_LIBRARY_PATH="" \
+ LOG=cmdlines \
+ MAKEFLAGS="CONF_CHECK=ignore"
+
+.if ${FLAVOR:Mjre*}
+ALL_TARGET= legacy-images
+.else
+ALL_TARGET= images
+.endif
+JDK_BUILD_TYPE= release
+
+JDK_ARCH= ${ARCH:S/amd64/x86_64/:S/powerpc64/ppc64/}
+BOOTSTRAPJDKFILE= openjdk26-26.0.2+10.1.${JDK_ARCH}.tar.xz
+JDK_OSARCH= bsd-${JDK_ARCH}
+JDK_BUILDDIR= ${WRKSRC}/build/${JDK_OSARCH}-${JDK_BUILD_JVM}-${JDK_BUILD_TYPE}
+.if ${FLAVOR:Mjre*}
+BUILD_JRE= true
+JDK_IMAGEDIR= ${JDK_BUILDDIR}/images/jre
+.else
+JDK_IMAGEDIR= ${JDK_BUILDDIR}/images/jdk
+.endif
+INSTALLDIR= ${PREFIX}/${PKGBASE}
+BOOTSTRAPJDKDIR= ${WRKDIR}/boot-jdk
+
+NO_CCACHE= yes
+NOPRECIOUSMAKEVARS= yes
+
+JDK_MAJOR_VERSION= 27
+JDK_MINOR_VERSION= 0
+JDK_PATCH_VERSION= 0
+JDK_BUILD_NUMBER= 35
+BSD_JDK_VERSION= 2
+JDK_FULL_VERSION= ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION}
+
+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
+
+.ifnmake portclippy
+JAVAVMS_COMMENT= OpenJDK${JDK_MAJOR_VERSION}
+.endif
+
+.include <bsd.port.pre.mk>
+
+JDK_BUILD_JVM= server
+
+MAKE_ENV+= --with-toolchain-type=${COMPILER_TYPE}
+CONFIGURE_ARGS+= --with-toolchain-type=${COMPILER_TYPE}
+CONFIGURE_ARGS+= --disable-warnings-as-errors
+
+.if ${COMPILER_TYPE} == gcc
+USE_GCC= yes
+CONFIGURE_ARGS+= --with-extra-cflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \
+ --with-extra-cxxflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \
+ --with-extra-ldflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT} -L${LOCALBASE}/lib/gcc${GCC_DEFAULT}"
+.else
+MAKE_ENV+= USE_CLANG=true
+EXTRA_CFLAGS+= -Wno-unused-but-set-parameter
+EXTRA_CFLAGS+= -Wno-bitwise-instead-of-logical \
+ -Wno-error=deprecated-non-prototype
+CONFIGURE_ARGS+= --with-extra-cflags="${EXTRA_CFLAGS}"
+CONFIGURE_ARGS+= --with-extra-cxxflags="${EXTRA_CFLAGS}"
+.endif
+
+.if ${ARCH} == aarch64
+CONFIGURE_ARGS+= --disable-dtrace
+.endif
+
+.if empty(ICONV_LIB)
+ICONV_CFLAGS= -DLIBICONV_PLUG
+.else
+ICONV_CFLAGS= -I${LOCALBASE}/include
+ICONV_LDFLAGS= -L${LOCALBASE}/lib
+ICONV_LIBS= ${ICONV_LIB}
+.endif
+
+pre-configure:
+ @${RM} ${WRKSRC}/src/hotspot/os_cpu/bsd_ppc/thread_bsd_ppc.cpp
+ @${MV} ${WRKSRC}/src/hotspot/os_cpu/bsd_ppc/thread_bsd_ppc.hpp \
+ ${WRKSRC}/src/hotspot/os_cpu/bsd_ppc/javaThread_bsd_ppc.hpp
+
+ @${FIND} ${WRKSRC} -name '*.orig' -delete
+ @${CHMOD} 755 ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
+ ${WRKSRC}/configure \
+ ${WRKSRC}/src/hotspot/os/bsd/os_bsd.cpp
+ @${REINPLACE_CMD} -e 's|%%ICONV_CFLAGS%%|${ICONV_CFLAGS}|' \
+ -e 's|%%ICONV_LDFLAGS%%|${ICONV_LDFLAGS}|' \
+ -e 's|%%ICONV_LIBS%%|${ICONV_LIBS}|' \
+ ${WRKSRC}/make/autoconf/libraries.m4
+
+post-build:
+.if defined(OPENJDK_SYMLINK_CACERTS)
+ @${RM} ${JDK_IMAGEDIR}/lib/security/cacerts
+ @${LN} -sf ${OPENJDK_SYMLINK_CACERTS} ${JDK_IMAGEDIR}/lib/security/cacerts
+.endif
+
+do-install:
+ @${MKDIR} ${STAGEDIR}${INSTALLDIR}
+ @cd ${JDK_IMAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR}
+ @cd ${STAGEDIR}${INSTALLDIR} && \
+ ${FIND} bin -type f -exec ${CHMOD} ${BINMODE} {} \;
+ @${CHMOD} ${BINMODE} ${STAGEDIR}${INSTALLDIR}/lib/jspawnhelper
+ @${ECHO} "@javavm ${INSTALLDIR}/bin/java" >> ${TMPPLIST}
+ @${FIND} ${STAGEDIR}${INSTALLDIR} -not -type d | ${SORT} | \
+ ${SED} -e 's|^${STAGEDIR}${PREFIX}/||' >> ${TMPPLIST}
+
+.include <bsd.port.post.mk>
diff --git a/java/openjdk27/distinfo b/java/openjdk27/distinfo
new file mode 100644
index 000000000000..4d6d1a831435
--- /dev/null
+++ b/java/openjdk27/distinfo
@@ -0,0 +1,11 @@
+TIMESTAMP = 1789128188
+SHA256 (openjdk26-26.0.2+10.1.aarch64.tar.xz) = 7b99121085736fea4684c8d206fb8092cc6646714cb98cd86ac47531f696be94
+SIZE (openjdk26-26.0.2+10.1.aarch64.tar.xz) = 193206720
+SHA256 (openjdk26-26.0.2+10.1.ppc64.tar.xz) = 1e34fc7388f0a1c2e8428272b838ffa9ce334269b95b9ee1042033a333e6d88c
+SIZE (openjdk26-26.0.2+10.1.ppc64.tar.xz) = 191014556
+SHA256 (openjdk26-26.0.2+10.1.ppc64le.tar.xz) = 10d93bdd5b77d32e83bb1fea07565aa5bdb4fb79c5eb7142e0435b842727166d
+SIZE (openjdk26-26.0.2+10.1.ppc64le.tar.xz) = 192368584
+SHA256 (openjdk26-26.0.2+10.1.x86_64.tar.xz) = 7ac6abf0c5629ff3e3969680b589269693169557254b26891c586ff3be38a165
+SIZE (openjdk26-26.0.2+10.1.x86_64.tar.xz) = 195287176
+SHA256 (freebsd-openjdk-jdk-27+35-2_GH0.tar.gz) = af0153831347365b8ceaa7d9ec2ad49401c2c6948e00b99a6bdb2b951e1c8796
+SIZE (freebsd-openjdk-jdk-27+35-2_GH0.tar.gz) = 121625688
diff --git a/java/openjdk27/files/patch-configure b/java/openjdk27/files/patch-configure
new file mode 100644
index 000000000000..4c97fddabcd2
--- /dev/null
+++ b/java/openjdk27/files/patch-configure
@@ -0,0 +1,14 @@
+--- configure.orig 2025-10-24 11:51:54 UTC
++++ configure
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!%%LOCALBASE%%/bin/bash
+ #
+ # Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+@@ -36,4 +36,4 @@ fi
+ # Delegate to wrapper, forcing wrapper to believe $0 is this script by using -c.
+ # This trick is needed to get autoconf to co-operate properly.
+ # The ${-:+-$-} construction passes on bash options.
+-bash ${-:+-$-} -c ". \"${this_script_dir}/make/autoconf/configure\"" "${this_script_dir}/configure" CHECKME "${this_script_dir}" "$@"
++%%LOCALBASE%%/bin/bash ${-:+-$-} -c ". \"${this_script_dir}/make/autoconf/configure\"" "${this_script_dir}/configure" CHECKME "${this_script_dir}" "$@"
diff --git a/java/openjdk27/files/patch-make_autoconf_flags-cflags.m4 b/java/openjdk27/files/patch-make_autoconf_flags-cflags.m4
new file mode 100644
index 000000000000..81bc372519f5
--- /dev/null
+++ b/java/openjdk27/files/patch-make_autoconf_flags-cflags.m4
@@ -0,0 +1,12 @@
+--- make/autoconf/flags-cflags.m4.orig 2025-09-16 10:24:48 UTC
++++ make/autoconf/flags-cflags.m4
+@@ -780,6 +780,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
+ # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
+ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10"
+ fi
++ if test "x$FLAGS_CPU" = xppc64; then
++ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=powerpc64 -mtune=power5"
++ fi
+ fi
+ if test "x$OPENJDK_TARGET_OS" = xaix; then
+ $1_CFLAGS_CPU="-mcpu=pwr8"
diff --git a/java/openjdk27/files/patch-make_autoconf_libraries.m4 b/java/openjdk27/files/patch-make_autoconf_libraries.m4
new file mode 100644
index 000000000000..9c86f7093ac7
--- /dev/null
+++ b/java/openjdk27/files/patch-make_autoconf_libraries.m4
@@ -0,0 +1,15 @@
+--- make/autoconf/libraries.m4.orig 2025-10-24 12:39:13 UTC
++++ make/autoconf/libraries.m4
+@@ -212,9 +212,9 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
+ ICONV_LDFLAGS="-L/usr/local/lib"
+ ICONV_LIBS=-liconv
+ elif test "x$OPENJDK_TARGET_OS_ENV" = "xbsd.freebsd"; then
+- ICONV_CFLAGS=-DLIBICONV_PLUG
+- ICONV_LDFLAGS=
+- ICONV_LIBS=
++ ICONV_CFLAGS=%%ICONV_CFLAGS%%
++ ICONV_LDFLAGS=%%ICONV_LDFLAGS%%
++ ICONV_LIBS=%%ICONV_LIBS%%
+ else
+ ICONV_CFLAGS=
+ ICONV_LDFLAGS=
diff --git a/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_atomicAccess__bsd__ppc.hpp b/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_atomicAccess__bsd__ppc.hpp
new file mode 100644
index 000000000000..b72ed96107c4
--- /dev/null
+++ b/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_atomicAccess__bsd__ppc.hpp
@@ -0,0 +1,30 @@
+--- src/hotspot/os_cpu/bsd_ppc/atomicAccess_bsd_ppc.hpp.orig 2026-04-13 10:20:52 UTC
++++ src/hotspot/os_cpu/bsd_ppc/atomicAccess_bsd_ppc.hpp
+@@ -0,0 +1,27 @@
++/*
++ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 2025 SAP SE. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ *
++ */
++
++// Including inline assembler functions that are shared between multiple PPC64 platforms.
++#include "atomicAccess_ppc.hpp"
diff --git a/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_orderAccess__bsd__ppc.hpp b/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_orderAccess__bsd__ppc.hpp
new file mode 100644
index 000000000000..07877328b08c
--- /dev/null
+++ b/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_orderAccess__bsd__ppc.hpp
@@ -0,0 +1,80 @@
+--- src/hotspot/os_cpu/bsd_ppc/orderAccess_bsd_ppc.hpp.orig 2026-04-13 11:00:19 UTC
++++ src/hotspot/os_cpu/bsd_ppc/orderAccess_bsd_ppc.hpp
+@@ -1,6 +1,6 @@
+ /*
+- * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
+- * Copyright (c) 2012, 2014 SAP SE. All rights reserved.
++ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 2025 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -23,66 +23,5 @@
+ *
+ */
+
+-#ifndef OS_CPU_BSD_PPC_VM_ORDERACCESS_BSD_PPC_HPP
+-#define OS_CPU_BSD_PPC_VM_ORDERACCESS_BSD_PPC_HPP
+-
+-// Included in orderAccess.hpp header file.
+-
+-#ifndef PPC64
+-#error "OrderAccess currently only implemented for PPC64"
+-#endif
+-
+-// Compiler version last used for testing: gcc 4.1.2
+-// Please update this information when this file changes
+-
+-// Implementation of class OrderAccess.
+-
+-//
+-// Machine barrier instructions:
+-//
+-// - sync Two-way memory barrier, aka fence.
+-// - lwsync orders Store|Store,
+-// Load|Store,
+-// Load|Load,
+-// but not Store|Load
+-// - eieio orders Store|Store
+-// - isync Invalidates speculatively executed instructions,
+-// but isync may complete before storage accesses
+-// associated with instructions preceding isync have
+-// been performed.
+-//
+-// Semantic barrier instructions:
+-// (as defined in orderAccess.hpp)
+-//
+-// - release orders Store|Store, (maps to lwsync)
+-// Load|Store
+-// - acquire orders Load|Store, (maps to lwsync)
+-// Load|Load
+-// - fence orders Store|Store, (maps to sync)
+-// Load|Store,
+-// Load|Load,
+-// Store|Load
+-//
+-
+-#define inlasm_sync() __asm__ __volatile__ ("sync" : : : "memory");
+-#define inlasm_lwsync() __asm__ __volatile__ ("lwsync" : : : "memory");
+-#define inlasm_eieio() __asm__ __volatile__ ("eieio" : : : "memory");
+-#define inlasm_isync() __asm__ __volatile__ ("isync" : : : "memory");
+-
+-inline void OrderAccess::loadload() { inlasm_lwsync(); }
+-inline void OrderAccess::storestore() { inlasm_lwsync(); }
+-inline void OrderAccess::loadstore() { inlasm_lwsync(); }
+-inline void OrderAccess::storeload() { inlasm_sync(); }
+-
+-inline void OrderAccess::acquire() { inlasm_lwsync(); }
+-inline void OrderAccess::release() { inlasm_lwsync(); }
+-inline void OrderAccess::fence() { inlasm_sync(); }
+-inline void OrderAccess::cross_modify_fence_impl()
+- { inlasm_isync(); }
+-
+-#undef inlasm_sync
+-#undef inlasm_lwsync
+-#undef inlasm_eieio
+-#undef inlasm_isync
+-
+-#endif // OS_CPU_BSD_PPC_VM_ORDERACCESS_BSD_PPC_HPP
++// Including inline assembler functions that are shared between multiple PPC64 platforms.
++#include "orderAccess_ppc.hpp"
diff --git a/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_os__bsd__ppc.cpp b/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_os__bsd__ppc.cpp
new file mode 100644
index 000000000000..d6c4a26c8093
--- /dev/null
+++ b/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_os__bsd__ppc.cpp
@@ -0,0 +1,89 @@
+--- src/hotspot/os_cpu/bsd_ppc/os_bsd_ppc.cpp.orig 2026-04-13 11:53:22 UTC
++++ src/hotspot/os_cpu/bsd_ppc/os_bsd_ppc.cpp
+@@ -179,7 +179,7 @@ intptr_t* os::fetch_bcp_from_context(const void* ucVoi
+ assert(ucVoid != nullptr, "invariant");
+ const ucontext_t* uc = (const ucontext_t*)ucVoid;
+ assert(os::Posix::ucontext_is_interpreter(uc), "invariant");
+- return reinterpret_cast<intptr_t*>(uc->uc_mcontext.regs->gpr[14]); // R14_bcp
++ return reinterpret_cast<intptr_t*>(uc->uc_mcontext.mc_gpr[14]); // R14_bcp
+ }
+
+ frame os::get_sender_for_C_frame(frame* fr) {
+@@ -204,7 +204,6 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig,
+ address stub = nullptr;
+ address pc = nullptr;
+
+- //%note os_trap_1
+ if (info != nullptr && uc != nullptr && thread != nullptr) {
+ pc = (address) os::Posix::ucontext_get_pc(uc);
+
+@@ -279,15 +278,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig,
+
+ CodeBlob *cb = nullptr;
+ int stop_type = -1;
+- // Handle signal from NativeJump::patch_verified_entry().
+- if (sig == SIGILL && nativeInstruction_at(pc)->is_sigill_not_entrant()) {
+- if (TraceTraps) {
+- tty->print_cr("trap: not_entrant");
+- }
+- stub = SharedRuntime::get_handle_wrong_method_stub();
+- }
+-
+- else if ((sig == (USE_POLL_BIT_ONLY ? SIGTRAP : SIGSEGV)) &&
++ if ((sig == (USE_POLL_BIT_ONLY ? SIGTRAP : SIGSEGV)) &&
+ // A bsd-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults
+ // in 64bit mode (cf. http://www.kernel.org/pub/bsd/kernel/v2.6/ChangeLog-2.6.6),
+ // especially when we try to read from the safepoint polling page. So the check
+@@ -315,6 +306,17 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig,
+ stub = SharedRuntime::polling_page_return_handler_blob()->entry_point();
+ }
+
++ // SIGTRAP-based nmethod entry barriers.
++ else if (sig == SIGTRAP && TrapBasedNMethodEntryBarriers &&
++ nativeInstruction_at(pc)->is_sigtrap_nmethod_entry_barrier() &&
++ CodeCache::contains((void*) pc)) {
++ if (TraceTraps) {
++ tty->print_cr("trap: nmethod entry barrier at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
++ }
++ stub = StubRoutines::method_entry_barrier();
++ uc->uc_mcontext.mc_lr = (uintptr_t)(pc + BytesPerInstWord); // emulate call by setting LR
++ }
++
+ // SIGTRAP-based ic miss check in compiled code.
+ else if (sig == SIGTRAP && TrapBasedICMissChecks &&
+ nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
+@@ -408,7 +410,8 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig,
+ // flushing of icache is not necessary.
+ stub = pc + 4; // continue with next instruction.
+ }
+- else if (thread->thread_state() == _thread_in_vm &&
++ else if ((thread->thread_state() == _thread_in_vm ||
++ thread->thread_state() == _thread_in_native) &&
+ sig == SIGBUS && thread->doing_unsafe_access()) {
+ address next_pc = pc + 4;
+ if (UnsafeMemoryAccess::contains_pc(pc)) {
+@@ -419,6 +422,15 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig,
+ return true;
+ }
+ }
++
++ // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
++ // and the heap gets shrunk before the field access.
++ if ((sig == SIGSEGV) || (sig == SIGBUS)) {
++ address addr = JNI_FastGetField::find_slowcase_pc(pc);
++ if (addr != (address)-1) {
++ stub = addr;
++ }
++ }
+ }
+
+ if (stub != nullptr) {
+@@ -497,7 +509,7 @@ void os::print_register_info(outputStream *st, const v
+ break;
+ default:
+ st->print("r%-2d=", n-3);
+- print_location(st, uc->uc_mcontext.mc_gpr[n-3]);
++ print_location(st, (intptr_t)uc->uc_mcontext.mc_gpr[n-3]);
+ break;
+ }
+ ++n;
diff --git a/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_vm__version__bsd__ppc.cpp b/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_vm__version__bsd__ppc.cpp
new file mode 100644
index 000000000000..8246af15358d
--- /dev/null
+++ b/java/openjdk27/files/patch-src_hotspot_os__cpu_bsd__ppc_vm__version__bsd__ppc.cpp
@@ -0,0 +1,49 @@
+--- src/hotspot/os_cpu/bsd_ppc/vm_version_bsd_ppc.cpp.orig 2026-09-03 11:42:54 UTC
++++ src/hotspot/os_cpu/bsd_ppc/vm_version_bsd_ppc.cpp
+@@ -0,0 +1,46 @@
++/*
++ * Copyright (c) 2026, Piotr Kubaj. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ *
++ */
++
++#include "runtime/vm_version.hpp"
++
++#include <sys/types.h>
++#include <sys/sysctl.h>
++
++// FreeBSD exposes a single PPC coherency block size covering both caches.
++static int cacheline_size() {
++ int size = 0;
++ size_t len = sizeof(size);
++ if (sysctlbyname("machdep.cacheline_size", &size, &len, nullptr, 0) != 0 || size <= 0) {
++ return DEFAULT_CACHE_LINE_SIZE;
++ }
++ return size;
++}
++
++int VM_Version::get_dcache_line_size() {
++ return cacheline_size();
++}
++
++int VM_Version::get_icache_line_size() {
++ return cacheline_size();
++}
diff --git a/java/openjdk27/files/patch-src_hotspot_os_bsd_os__bsd.cpp b/java/openjdk27/files/patch-src_hotspot_os_bsd_os__bsd.cpp
new file mode 100644
index 000000000000..d00189abbf2c
--- /dev/null
+++ b/java/openjdk27/files/patch-src_hotspot_os_bsd_os__bsd.cpp
@@ -0,0 +1,22 @@
+--- src/hotspot/os/bsd/os_bsd.cpp.orig 2026-04-22 18:05:58 UTC
++++ src/hotspot/os/bsd/os_bsd.cpp
+@@ -132,6 +132,10 @@
+ #define KINFO_PROC_T kinfo_proc
+ #define KI_RSS p_vm_rssize
+ #elif defined(__FreeBSD__)
++ #if ( defined(__aarch64__) && __FreeBSD_version >= 160000 )
++ // do not redefine "breakpoint"
++ #define _MACHINE_CPUFUNC_H_
++ #endif
+ #include <sys/user.h>
+ #define KERN_PROC_MIB KERN_PROC
+ #define KINFO_PROC_T kinfo_proc
+@@ -480,7 +484,7 @@ void os::init_system_properties_values() {
+ #elif defined(__NetBSD__)
+ #define DEFAULT_LIBPATH "/usr/lib:/usr/pkg/lib"
+ #else
+- #define DEFAULT_LIBPATH "/usr/lib:/usr/local/lib"
++ #define DEFAULT_LIBPATH "/usr/lib:%%LOCALBASE%%/lib"
+ #endif
+ #else
+ #define DEFAULT_LIBPATH OVERRIDE_LIBPATH
diff --git a/java/openjdk27/files/patch-src_hotspot_os_bsd_os__perf__bsd.cpp b/java/openjdk27/files/patch-src_hotspot_os_bsd_os__perf__bsd.cpp
new file mode 100644
index 000000000000..ca9cd087b470
--- /dev/null
+++ b/java/openjdk27/files/patch-src_hotspot_os_bsd_os__perf__bsd.cpp
@@ -0,0 +1,13 @@
+--- src/hotspot/os/bsd/os_perf_bsd.cpp.orig 2026-04-22 18:05:58 UTC
++++ src/hotspot/os/bsd/os_perf_bsd.cpp
+@@ -34,6 +34,10 @@
+ #include <mach/task_info.h>
+ #else
+ # if !defined(__NetBSD__)
++ #if ( defined(__aarch64__) && __FreeBSD_version >= 160000 )
++ // do not redefine "breakpoint"
++ #define _MACHINE_CPUFUNC_H_
++ #endif
+ #include <sys/user.h>
+ # endif
+ #include <sys/sched.h>
diff --git a/java/openjdk27/pkg-descr b/java/openjdk27/pkg-descr
new file mode 100644
index 000000000000..a6701ff6ef33
--- /dev/null
+++ b/java/openjdk27/pkg-descr
@@ -0,0 +1 @@
+An open-source implementation of the Java Platform, Standard Edition.
diff --git a/java/openjdk27/pkg-message b/java/openjdk27/pkg-message
new file mode 100644
index 000000000000..c072654ad070
--- /dev/null
+++ b/java/openjdk27/pkg-message
@@ -0,0 +1,15 @@
+[
+{ type: install
+ message: <<EOM
+This OpenJDK implementation may require procfs(5) mounted on /proc.
+
+If you have not done it yet, please do the following:
+
+ mount -t procfs proc /proc
+
+To make it permanent, you need the following lines in /etc/fstab:
+
+ proc /proc procfs rw 0 0
+EOM
+}
+]