This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 82c1e7d9b import: Link libnx for graphics applications in a kernel 
build.
82c1e7d9b is described below

commit 82c1e7d9be2a48c8b77e203af438f22ef996001a
Author: Justin Hammond <[email protected]>
AuthorDate: Fri Aug 7 19:52:13 2026 +0800

    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 <[email protected]>
---
 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

Reply via email to