Now that $ORIGIN support is fully functional, remove static linking
of libjli which removes an OpenBSD specific work-around.
Tested in my usual way: build, install then FLAVOR=native_bootstrap
make build. Requires ld.so commit from today so perhaps commit after
the next snapshots are available.
okay?
Index: 11/Makefile
===================================================================
RCS file: /cvs/ports/devel/jdk/11/Makefile,v
diff -u -p -u -r1.74 Makefile
--- 11/Makefile 3 Aug 2026 14:08:52 -0000 1.74
+++ 11/Makefile 20 Sep 2026 22:28:17 -0000
@@ -13,7 +13,7 @@ PKGNAME= jdk-${PACKAGE_VER}
PKGSTEM= jdk-11
EPOCH= 0
-REVISION= 1
+REVISION= 2
DIST_SUBDIR= jdk
DISTNAME= jdk-${VERSION_STR}
Index: 11/patches/patch-make_launcher_LauncherCommon_gmk
===================================================================
RCS file: 11/patches/patch-make_launcher_LauncherCommon_gmk
diff -N 11/patches/patch-make_launcher_LauncherCommon_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 11/patches/patch-make_launcher_LauncherCommon_gmk 20 Sep 2026 22:28:17
-0000
@@ -0,0 +1,46 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/launcher/LauncherCommon.gmk
+--- make/launcher/LauncherCommon.gmk.orig
++++ make/launcher/LauncherCommon.gmk
+@@ -31,7 +31,7 @@ ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,/../lib/jli
+ # Applications expect to be able to link against libjawt without invoking
+ # System.loadLibrary("jawt") first. This was the behaviour described in the
+ # devloper documentation of JAWT and what worked with OpenJDK6.
+-ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
++ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris bsd), )
+ ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,/../lib)
+ endif
+
+@@ -155,7 +155,7 @@ define SetupBuildLauncherBody
+ -framework ApplicationServices
+ endif
+
+- ifneq ($(findstring $(OPENJDK_TARGET_OS), aix bsd), )
++ ifeq ($(OPENJDK_TARGET_OS), aix)
+ $1_LDFLAGS += -L$(SUPPORT_OUTPUTDIR)/native/java.base
+ $1_LIBS += -ljli_static
+ endif
+@@ -187,10 +187,12 @@ define SetupBuildLauncherBody
+ -L$(call FindLibDirForModule, java.base)/jli, \
+ LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
+ -L$(call FindLibDirForModule, java.base)/jli, \
++ LDFLAGS_bsd := \
++ -L$(call FindLibDirForModule, java.base)/jli, \
+ LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
+ LIBS_unix := $$($1_LIBS_unix), \
+ LIBS_linux := -lpthread -ljli $(LIBDL), \
+- LIBS_bsd := -pthread, \
++ LIBS_bsd := -ljli -pthread $(LIBDL), \
+ LIBS_macosx := -ljli, \
+ LIBS_solaris := -ljli -lthread $(LIBDL), \
+ LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
+@@ -208,7 +210,7 @@ define SetupBuildLauncherBody
+
+ $$(BUILD_LAUNCHER_$1): $$(BUILD_PLIST_$1)
+
+- ifeq ($(call isTargetOs, aix bsd), true)
++ ifeq ($(call isTargetOs, aix), true)
+ $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
+ endif
+
Index: 11/patches/patch-make_lib_CoreLibraries_gmk
===================================================================
RCS file: 11/patches/patch-make_lib_CoreLibraries_gmk
diff -N 11/patches/patch-make_lib_CoreLibraries_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 11/patches/patch-make_lib_CoreLibraries_gmk 20 Sep 2026 22:28:17 -0000
@@ -0,0 +1,22 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/lib/CoreLibraries.gmk
+--- make/lib/CoreLibraries.gmk.orig
++++ make/lib/CoreLibraries.gmk
+@@ -256,6 +256,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
+ $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
+ LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
++ LDFLAGS_bsd := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
+ LIBS_unix := $(LIBZ_LIBS), \
+ LIBS_linux := $(LIBDL) -lpthread, \
+ LIBS_solaris := $(LIBDL), \
+@@ -269,7 +270,7 @@ TARGETS += $(BUILD_LIBJLI)
+
+ LIBJLI_SRC_DIRS := $(call FindSrcDirsForComponent, java.base, libjli)
+
+-ifeq ($(call isTargetOs, aix bsd), true)
++ifeq ($(call isTargetOs, aix), true)
+ # AIX also requires a static libjli because the compiler doesn't support
'-rpath'
+ $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
+ NAME := jli_static, \
Index: 11/patches/patch-make_lib_Lib-java_instrument_gmk
===================================================================
RCS file: 11/patches/patch-make_lib_Lib-java_instrument_gmk
diff -N 11/patches/patch-make_lib_Lib-java_instrument_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 11/patches/patch-make_lib_Lib-java_instrument_gmk 20 Sep 2026 22:28:17
-0000
@@ -0,0 +1,31 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/lib/Lib-java.instrument.gmk
+--- make/lib/Lib-java.instrument.gmk.orig
++++ make/lib/Lib-java.instrument.gmk
+@@ -57,13 +57,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
+ LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN,/jli) \
+ -L$(call FindLibDirForModule, java.base)/jli, \
+ LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
+- LDFLAGS_bsd := -L$(SUPPORT_OUTPUTDIR)/native/java.base \
++ LDFLAGS_bsd := $(call SET_SHARED_LIBRARY_ORIGIN,/jli) \
++ -L$(call FindLibDirForModule, java.base)/jli \
+ $(ICONV_LDFLAGS), \
+ LIBS := $(JDKLIB_LIBS), \
+ LIBS_unix := -ljava -ljvm $(LIBZ_LIBS), \
+ LIBS_linux := -ljli $(LIBDL), \
+ LIBS_solaris := -ljli $(LIBDL), \
+- LIBS_bsd := $(ICONV_LIBS) -ljli_static $(LIBDL), \
++ LIBS_bsd := $(ICONV_LIBS) -ljli $(LIBDL), \
+ LIBS_aix := -liconv -ljli_static $(LIBDL), \
+ LIBS_macosx := -ljli -liconv -framework Cocoa -framework Security \
+ -framework ApplicationServices, \
+@@ -71,7 +72,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
+ $(WINDOWS_JLI_LIB), \
+ ))
+
+-ifeq ($(call isTargetOs, aix bsd), true)
++ifeq ($(call isTargetOs, aix), true)
+ $(BUILD_LIBINSTRUMENT): $(call FindStaticLib, java.base, jli_static)
+ else ifeq ($(OPENJDK_TARGET_OS), windows)
+ $(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, jli)
Index: 17/Makefile
===================================================================
RCS file: /cvs/ports/devel/jdk/17/Makefile,v
diff -u -p -u -r1.43 Makefile
--- 17/Makefile 27 Jul 2026 16:57:19 -0000 1.43
+++ 17/Makefile 20 Sep 2026 22:28:17 -0000
@@ -13,6 +13,8 @@ PKGNAME= jdk-${PACKAGE_VER}
PKGSTEM= jdk-17
EPOCH= 0
+REVISION= 0
+
DIST_SUBDIR= jdk
DISTNAME= jdk-${VERSION_STR}
WRKDIST= ${WRKDIR}/jdk17u-jdk-${BASE_VER}-${BUILD_VER}-${BSD_PORT_REL}
Index: 17/patches/patch-make_common_modules_LauncherCommon_gmk
===================================================================
RCS file: 17/patches/patch-make_common_modules_LauncherCommon_gmk
diff -N 17/patches/patch-make_common_modules_LauncherCommon_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 17/patches/patch-make_common_modules_LauncherCommon_gmk 20 Sep 2026
22:28:17 -0000
@@ -0,0 +1,40 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/common/modules/LauncherCommon.gmk
+--- make/common/modules/LauncherCommon.gmk.orig
++++ make/common/modules/LauncherCommon.gmk
+@@ -51,14 +51,6 @@ LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/nat
+ MACOSX_PLIST_DIR := $(TOPDIR)/src/java.base/macosx/native/launcher
+ JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
+
+-ifeq ($(call isTargetOs, bsd), true)
+- ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+- BSD_JLI_LIB := -ljli_static
+- else
+- BSD_JLI_LIB := -ljli
+- endif
+-endif
+-
+
################################################################################
+ # Build standard launcher.
+
+@@ -175,7 +167,7 @@ define SetupBuildLauncherBody
+ LIBS_linux := -ljli -lpthread $(LIBDL), \
+ LIBS_macosx := -ljli -framework Cocoa -framework Security \
+ -framework ApplicationServices, \
+- LIBS_bsd := $(BSD_JLI_LIB) -pthread $(LIBDL), \
++ LIBS_bsd := -ljli -pthread $(LIBDL), \
+ LIBS_aix := -ljli_static, \
+ LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
+ $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
+@@ -192,10 +184,6 @@ define SetupBuildLauncherBody
+ $$(BUILD_LAUNCHER_$1): $$(BUILD_PLIST_$1)
+
+ ifeq ($(call isTargetOs, aix), true)
+- $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
+- endif
+-
+- ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+ $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
+ endif
+
Index: 17/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk
===================================================================
RCS file: 17/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk
diff -N 17/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 17/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk 20 Sep
2026 22:28:17 -0000
@@ -0,0 +1,30 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/modules/java.base/lib/CoreLibraries.gmk
+--- make/modules/java.base/lib/CoreLibraries.gmk.orig
++++ make/modules/java.base/lib/CoreLibraries.gmk
+@@ -242,24 +242,3 @@ ifeq ($(call isTargetOs, aix), true)
+ TARGETS += $(BUILD_LIBJLI_STATIC)
+
+ endif
+-
+-ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+- # OpenBSD also requires a static libjli because the compiler doesn't fully
+- # support $ORIGIN in '-rpath'
+- $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
+- NAME := jli_static, \
+- TYPE := STATIC_LIBRARY, \
+- OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
+- SRC := $(LIBJLI_SRC_DIRS), \
+- EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
+- EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
+- OPTIMIZATION := HIGH, \
+- CFLAGS := $(STATIC_LIBRARY_FLAGS) $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
+- $(addprefix -I, $(LIBJLI_SRC_DIRS)), \
+- DISABLED_WARNINGS_clang := format-nonliteral, \
+- ARFLAGS := $(ARFLAGS), \
+- OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
+-
+- TARGETS += $(BUILD_LIBJLI_STATIC)
+-
+-endif
Index: 17/patches/patch-make_modules_java_instrument_Lib_gmk
===================================================================
RCS file: 17/patches/patch-make_modules_java_instrument_Lib_gmk
diff -N 17/patches/patch-make_modules_java_instrument_Lib_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 17/patches/patch-make_modules_java_instrument_Lib_gmk 20 Sep 2026
22:28:17 -0000
@@ -0,0 +1,41 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/modules/java.instrument/Lib.gmk
+--- make/modules/java.instrument/Lib.gmk.orig
++++ make/modules/java.instrument/Lib.gmk
+@@ -35,11 +35,6 @@ endif
+
+ ifeq ($(call isTargetOs, bsd), true)
+ LIBINSTRUMENT_CFLAGS += $(ICONV_CFLAGS)
+- ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+- BSD_JLI_LIB := -ljli_static
+- else
+- BSD_JLI_LIB := -ljli
+- endif
+ endif
+
+ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
+@@ -56,12 +51,12 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
+ LDFLAGS_linux := -L$(call FindLibDirForModule, java.base), \
+ LDFLAGS_macosx := -L$(call FindLibDirForModule, java.base), \
+ LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
+- LDFLAGS_bsd := -L$(SUPPORT_OUTPUTDIR)/native/java.base \
++ LDFLAGS_bsd := -L$(call FindLibDirForModule, java.base) \
+ $(ICONV_LDFLAGS), \
+ LIBS := $(JDKLIB_LIBS), \
+ LIBS_unix := -ljava -ljvm $(LIBZ_LIBS), \
+ LIBS_linux := -ljli $(LIBDL), \
+- LIBS_bsd := $(ICONV_LIBS) $(BSD_JLI_LIB) $(LIBDL), \
++ LIBS_bsd := $(ICONV_LIBS) -ljli $(LIBDL), \
+ LIBS_aix := -liconv -ljli_static $(LIBDL), \
+ LIBS_macosx := -ljli -liconv -framework Cocoa -framework Security \
+ -framework ApplicationServices, \
+@@ -70,8 +65,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
+ ))
+
+ ifeq ($(call isTargetOs, aix), true)
+- $(BUILD_LIBINSTRUMENT): $(call FindStaticLib, java.base, jli_static)
+-else ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+ $(BUILD_LIBINSTRUMENT): $(call FindStaticLib, java.base, jli_static)
+ else
+ $(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, jli)
Index: 21/Makefile
===================================================================
RCS file: /cvs/ports/devel/jdk/21/Makefile,v
diff -u -p -u -r1.18 Makefile
--- 21/Makefile 27 Jul 2026 16:59:50 -0000 1.18
+++ 21/Makefile 20 Sep 2026 22:28:17 -0000
@@ -13,6 +13,8 @@ PKGNAME= jdk-${PACKAGE_VER}
PKGSTEM= jdk-21
EPOCH= 0
+REVISION= 0
+
DIST_SUBDIR= jdk
DISTNAME= jdk-${VERSION_STR}
WRKDIST= ${WRKDIR}/jdk21u-jdk-${BASE_VER}-${BUILD_VER}-${BSD_PORT_REL}
Index: 21/patches/patch-make_common_modules_LauncherCommon_gmk
===================================================================
RCS file: 21/patches/patch-make_common_modules_LauncherCommon_gmk
diff -N 21/patches/patch-make_common_modules_LauncherCommon_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 21/patches/patch-make_common_modules_LauncherCommon_gmk 20 Sep 2026
22:28:17 -0000
@@ -0,0 +1,40 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/common/modules/LauncherCommon.gmk
+--- make/common/modules/LauncherCommon.gmk.orig
++++ make/common/modules/LauncherCommon.gmk
+@@ -52,14 +52,6 @@ LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/nat
+ MACOSX_PLIST_DIR := $(TOPDIR)/src/java.base/macosx/native/launcher
+ JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
+
+-ifeq ($(call isTargetOs, bsd), true)
+- ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+- BSD_JLI_LIB := -ljli_static
+- else
+- BSD_JLI_LIB := -ljli
+- endif
+-endif
+-
+
################################################################################
+ # Build standard launcher.
+
+@@ -188,7 +180,7 @@ define SetupBuildLauncherBody
+ LIBS_linux := -ljli -lpthread $(LIBDL), \
+ LIBS_macosx := -ljli -framework Cocoa -framework Security \
+ -framework ApplicationServices, \
+- LIBS_bsd := $(BSD_JLI_LIB) -pthread $(LIBDL), \
++ LIBS_bsd := -ljli -pthread $(LIBDL), \
+ LIBS_aix := -ljli_static, \
+ LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
+ $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
+@@ -205,10 +197,6 @@ define SetupBuildLauncherBody
+ $$(BUILD_LAUNCHER_$1): $$(BUILD_PLIST_$1)
+
+ ifeq ($(call isTargetOs, aix), true)
+- $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
+- endif
+-
+- ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+ $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
+ endif
+
Index: 21/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk
===================================================================
RCS file: 21/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk
diff -N 21/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 21/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk 20 Sep
2026 22:28:17 -0000
@@ -0,0 +1,30 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/modules/java.base/lib/CoreLibraries.gmk
+--- make/modules/java.base/lib/CoreLibraries.gmk.orig
++++ make/modules/java.base/lib/CoreLibraries.gmk
+@@ -210,24 +210,3 @@ ifeq ($(call isTargetOs, aix), true)
+ TARGETS += $(BUILD_LIBJLI_STATIC)
+
+ endif
+-
+-ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+- # OpenBSD also requires a static libjli because the compiler doesn't fully
+- # support $ORIGIN in '-rpath'
+- $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
+- NAME := jli_static, \
+- TYPE := STATIC_LIBRARY, \
+- OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
+- SRC := $(LIBJLI_SRC_DIRS), \
+- EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
+- EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
+- OPTIMIZATION := HIGH, \
+- CFLAGS := $(STATIC_LIBRARY_FLAGS) $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
+- $(addprefix -I, $(LIBJLI_SRC_DIRS)), \
+- DISABLED_WARNINGS_clang_bsd := format-nonliteral
deprecated-non-prototype, \
+- ARFLAGS := $(ARFLAGS), \
+- OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
+-
+- TARGETS += $(BUILD_LIBJLI_STATIC)
+-
+-endif
Index: 21/patches/patch-make_modules_java_instrument_Lib_gmk
===================================================================
RCS file: 21/patches/patch-make_modules_java_instrument_Lib_gmk
diff -N 21/patches/patch-make_modules_java_instrument_Lib_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 21/patches/patch-make_modules_java_instrument_Lib_gmk 20 Sep 2026
22:28:17 -0000
@@ -0,0 +1,41 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/modules/java.instrument/Lib.gmk
+--- make/modules/java.instrument/Lib.gmk.orig
++++ make/modules/java.instrument/Lib.gmk
+@@ -35,11 +35,6 @@ endif
+
+ ifeq ($(call isTargetOs, bsd), true)
+ LIBINSTRUMENT_CFLAGS += $(ICONV_CFLAGS)
+- ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+- BSD_JLI_LIB := -ljli_static
+- else
+- BSD_JLI_LIB := -ljli
+- endif
+ endif
+
+ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
+@@ -55,12 +50,12 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
+ LDFLAGS_linux := -L$(call FindLibDirForModule, java.base), \
+ LDFLAGS_macosx := -L$(call FindLibDirForModule, java.base), \
+ LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
+- LDFLAGS_bsd := -L$(SUPPORT_OUTPUTDIR)/native/java.base \
++ LDFLAGS_bsd := -L$(call FindLibDirForModule, java.base) \
+ $(ICONV_LDFLAGS), \
+ LIBS := $(JDKLIB_LIBS), \
+ LIBS_unix := -ljava -ljvm $(LIBZ_LIBS), \
+ LIBS_linux := -ljli $(LIBDL), \
+- LIBS_bsd := $(ICONV_LIBS) $(BSD_JLI_LIB) $(LIBDL), \
++ LIBS_bsd := $(ICONV_LIBS) -ljli $(LIBDL), \
+ LIBS_aix := -liconv -ljli_static $(LIBDL), \
+ LIBS_macosx := -ljli -liconv -framework Cocoa -framework Security \
+ -framework ApplicationServices, \
+@@ -69,8 +64,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
+ ))
+
+ ifeq ($(call isTargetOs, aix), true)
+- $(BUILD_LIBINSTRUMENT): $(call FindStaticLib, java.base, jli_static)
+-else ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.openbsd)
+ $(BUILD_LIBINSTRUMENT): $(call FindStaticLib, java.base, jli_static)
+ else
+ $(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, jli)
Index: 25/Makefile
===================================================================
RCS file: /cvs/ports/devel/jdk/25/Makefile,v
diff -u -p -u -r1.11 Makefile
--- 25/Makefile 27 Jul 2026 17:02:22 -0000 1.11
+++ 25/Makefile 20 Sep 2026 22:28:17 -0000
@@ -13,6 +13,8 @@ PKGNAME= jdk-${PACKAGE_VER}
PKGSTEM= jdk-25
EPOCH= 0
+REVISION= 0
+
DIST_SUBDIR= jdk
DISTNAME= jdk-${VERSION_STR}
WRKDIST= ${WRKDIR}/jdk25u-jdk-${BASE_VER}-${BUILD_VER}-${BSD_PORT_REL}
Index: 25/patches/patch-make_common_JdkNativeCompilation_gmk
===================================================================
RCS file: 25/patches/patch-make_common_JdkNativeCompilation_gmk
diff -N 25/patches/patch-make_common_JdkNativeCompilation_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 25/patches/patch-make_common_JdkNativeCompilation_gmk 20 Sep 2026
22:28:17 -0000
@@ -0,0 +1,16 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/common/JdkNativeCompilation.gmk
+--- make/common/JdkNativeCompilation.gmk.orig
++++ make/common/JdkNativeCompilation.gmk
+@@ -193,10 +193,6 @@ define AddJdkLibrary
+ ifeq ($(call isTargetOs, aix)+$$($1_$2_MODULE):$$($1_$2_NAME),
true+java.base:jli)
+ $1_$2_STATIC_LIBRARY := true
+ endif
+- ifeq ($(call isTargetOsEnv, bsd.openbsd)+$$($1_$2_MODULE):$$($1_$2_NAME),
true+java.base:jli)
+- $1_$2_STATIC_LIBRARY := true
+- $1_LIBS += $(LIBZ_LIBS) $(LIBPTHREAD)
+- endif
+ ifeq ($$($1_$2_MODULE):$$($1_$2_NAME), gtest:gtest)
+ $1_$2_STATIC_LIBRARY := true
+ endif
Index: 25/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk
===================================================================
RCS file: 25/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk
diff -N 25/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 25/patches/patch-make_modules_java_base_lib_CoreLibraries_gmk 20 Sep
2026 22:28:17 -0000
@@ -0,0 +1,18 @@
+We support $ORIGIN fully now. Remove static linking work-around.
+
+Index: make/modules/java.base/lib/CoreLibraries.gmk
+--- make/modules/java.base/lib/CoreLibraries.gmk.orig
++++ make/modules/java.base/lib/CoreLibraries.gmk
+@@ -178,12 +178,6 @@ ifeq ($(call isTargetOs, aix), true)
+ LIBJLI_STATIC_EXCLUDE_OBJS += java_md_aix.o
+ endif
+
+-ifeq ($(call isTargetOsEnv, bsd.openbsd), true)
+- # OpenBSD requires a static libjli because the runtime linker doesn't fully
+- # support $ORIGIN in '-rpath'
+- BUILD_LIBJLI_TYPE := STATIC_LIBRARY
+-endif
+-
+ $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
+ NAME := jli, \
+ TYPE := $(BUILD_LIBJLI_TYPE), \
Index: 25/pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/jdk/25/pkg/PLIST,v
diff -u -p -u -r1.1.1.1 PLIST
--- 25/pkg/PLIST 3 Oct 2025 12:35:12 -0000 1.1.1.1
+++ 25/pkg/PLIST 20 Sep 2026 22:28:17 -0000
@@ -575,6 +575,7 @@ jdk-25/lib/jvm.cfg
@so jdk-25/lib/libjawt.so
@so jdk-25/lib/libjdwp.so
@so jdk-25/lib/libjimage.so
+@so jdk-25/lib/libjli.so
@so jdk-25/lib/libjsig.so
@so jdk-25/lib/liblcms.so
@so jdk-25/lib/libmanagement.so