From 82c1e7d9be2a48c8b77e203af438f22ef996001a Mon Sep 17 00:00:00 2001 From: Justin Hammond Date: Fri, 7 Aug 2026 19:52:13 +0800 Subject: [PATCH] import: Link libnx for graphics applications in a kernel build. The link line for applications in a kernel build is libmm, libc and the proxies. libnx is never named, though the export has been shipping it all along. So every application built on NX or NXFONTS fails to link, the nx examples and fbcon alike, with undefined references to the font and geometry routines. Name it, ahead of libc since it calls into it, and only when CONFIG_NX is set so that configurations without graphics are unaffected. Tested on an EIC7700 EVB in a kernel build: with this, an application built on NXFONTS links and runs; without it the same application fails at link time. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond --- import/Make.defs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/import/Make.defs b/import/Make.defs index 2b8236d25..7e1bdff50 100644 --- a/import/Make.defs +++ b/import/Make.defs @@ -68,6 +68,14 @@ LDLIBPATH = $(addprefix -L,$(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs)) # Link with user libraries ifeq ($(CONFIG_BUILD_KERNEL),y) + # Before libc, since the graphics library calls into it. Without it + # every graphics application in a kernel build fails to find the font + # and geometry routines. + + ifeq ($(CONFIG_NX),y) + LDLIBS += -lnx + endif + LDLIBS += -lmm -lc -lproxies ifeq ($(CONFIG_HAVE_CXX),y) LDLIBS += -lxx