import: Link libnx for graphics applications in a kernel build. - #3707
Merged
Conversation
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>
cederom
approved these changes
Aug 7, 2026
5 tasks
Contributor
Author
|
The companion fbcon fix referred to above is now open as To restate the division, since the two were originally one commit: this PR is |
xiaoxiang781216
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
link. The nx examples and fbcon alike come out with undefined references
to the font and geometry routines.
-lmm -lc -lproxies.libnx is never named, even though the export has been shipping
libnx.aall along, so nothing ever resolves against it.import/Make.defsnow names it, ahead of-lcsince libnx calls intolibc, and only when
CONFIG_NXis set so that configurations withoutgraphics are unaffected.
in a kernel build. fbcon needs one further, unrelated fix, which is a
separate PR against this repo; I will link it here once it is open.
Impact
linkable in kernel builds. Nothing to adapt to.
application link line, and only when
CONFIG_NX=y. Configurationswithout graphics see a byte-identical link line.
differently.
CONFIG_BUILD_KERNELonly. The blockedited is already inside
ifeq ($(CONFIG_BUILD_KERNEL),y). Flat andprotected builds do not use this link line and are untouched.
Testing
I confirm that changes are verified on local setup and works as intended:
15.2.0
upstream), kernel build,
CONFIG_NX=y,CONFIG_NXFONTS=yTesting logs before change, linking
examples/fbcon:Every one of those symbols lives in
libnx.a, which the export had alreadyinstalled.
Testing logs after change: the
nxf_*andnxgl_*references resolve, theapplication links, and it runs on the target:
Worth being precise about what this change does and does not fix: with only
this patch applied, fbcon's link gets past libnx and then fails on
g_builtin_countandg_builtinsinstead. That is a separate defect infbcon itself, fixed by the companion PR mentioned above. The run shown here
has both applied. Any other NX application, which does not consult the
builtin registry, links and runs with this patch alone.
PR verification Self-Check
Claude (claude-opus-5) assisted with diagnosing this and with authoring the
code comment and this PR description. The commit carries an
Assisted-by:tagper CONTRIBUTING.md §1.5.