Running swing application with openjdk23 (openjdk23-23.0.1+11.1 on 14.2-RELEASE-p1) fails with: ld-elf.so.1: /usr/local/openjdk23/lib/libfontmanager.so: Undefined symbol "FcPatternCreate" There are no such errors with all earlier openjdk versions I have used (openjdk22 works) ldd /usr/local/openjdk23/lib/libfontmanager.so does not include libfontconfig.so.1 ldd /usr/local/openjdk22/lib/libfontmanager.so does include libfontconfig.so.1
(In reply to Patrick Mackinlay from comment #0) Thanks for the report, I'll have a look at it.
I found the issue. The openjdk22 port contains a patch for libfontmanager that caused it to depend on fontconfig. The port also contains a patch for the makefile to link with libfontconfig. As the structure of the makefiles has been changed for OpenJDK 23, that latter patch fell out, while the first patch remained in the build. I suggest just removing that patch, as the JDK font handling should load fontconfig itself when it is needed, and I could not find any immediate rationale for why that patch was there in the first place. The alternative is to add back the link to libfontconfig from fontmanager, but if I'd like to know why we need it if we do that. https://reviews.freebsd.org/D48806
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3f02459fe6b2806af3a53070c7dc54b455314cc2 commit 3f02459fe6b2806af3a53070c7dc54b455314cc2 Author: Harald Eilertsen <haraldei@anduin.net> AuthorDate: 2025-03-01 17:32:52 +0000 Commit: Joseph Mingrone <jrm@FreeBSD.org> CommitDate: 2025-03-01 19:58:38 +0000 java/openjdk23: Delete patch for fontmanager/freetypeScaler.c The patch causes a load failure when trying to load graphical java programs, because it created a hard dependency on libfontconfig.so from libfontmanager.so. This should be handled by the JDK itself by dynamically loading fontconfig if it's needed. PR: 284503 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48806 java/openjdk23/Makefile | 1 + ...e_native_libfontmanager_freetypeScaler.c (gone) | 209 --------------------- 2 files changed, 1 insertion(+), 209 deletions(-)
Thanks Harald and Patrick. Committed in 3f02459fe6b2806af3a53070c7dc54b455314cc2.