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 <justin@dynam.ac>
This commit is contained in:
Justin Hammond 2026-08-07 19:52:13 +08:00 committed by Xiang Xiao
parent a65a5372f9
commit 82c1e7d9be

View file

@ -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