Skip to content

examples/nxflat: Build the test modules that do build - #3803

Draft
casaroli wants to merge 2 commits into
apache:masterfrom
casaroli:nxflat-tests-enable
Draft

casaroli wants to merge 2 commits into
apache:masterfrom
casaroli:nxflat-tests-enable

Conversation

@casaroli

@casaroli casaroli commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

depends-on: [apache/nuttx/pull/20377]

Summary

apps/examples/nxflat/tests carries nine test modules and the Makefile built three, under a comment saying "Most of these do no build yet". Eight build and convert, and between them they cover a function pointer in D-Space, a callback from the firmware, a non-local return, threads, task creation and thread-local errno.

What had kept most of them out was read-only data reached PC-relative, which apache/nuttx#20377 makes the tree compile GOT-relative. hello++ stays out: two of its four modules convert, the third needs R_ARM_TARGET1 from the converter in that PR, and the fourth needs an iostream.

The other two changes are a latent bug and a portability one. BUILD_SUBDIRS was assigned and never read, so mutex, pthread and task were excluded even where the configuration allowed them. And install -D is a GNU extension: the BSD install that macOS carries fails the build of every module with its usage message.

Impact

Only a board that sets CONFIG_EXAMPLES_NXFLAT is affected, and its ROMFS grows by roughly 9 KB for the five further modules.

Testing

lm3s6965-ek:qemu-nxflat, both ways round the longjmp guard. With CONFIG_ARCH_SETJMP_H off the ROMFS holds the other seven modules and the image links, where before it failed on setjmp and longjmp. With it on, all eight run under qemu-system-arm -M lm3s6965evb to End-of-Test.. Exit-ing, struct reporting pf = 0x13335 (vs 0x13335) PASS and then In dummyfunc() -- PASS.

Built with BSD install rather than GNU, which is what made the portability fix necessary.

tools/checkpatch.sh -c -u -m -g passes.

The Makefile said "Most of these do no build yet" and built three of the nine.
Eight build and convert: errno, hello, longjmp, mutex, pthread, signal, struct
and task.  What had kept most of them out was read-only data reached
PC-relative, which the tree now compiles GOT-relative.

BUILD_SUBDIRS was assigned but never read, so mutex, pthread and task stayed
out even where the configuration allowed them.  The conditionals now append to
SUBDIRS, which the recipes walk.

hello++ stays out: two of its four modules convert, the third needs
R_ARM_TARGET1 from the converter and the fourth needs an iostream.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
install -D is GNU's, and creates the leading directories.  The BSD install
that macOS carries has no such option and fails the build of every module.
mkdir -p does that part, and the mode stays explicit.

longjmp is built only where CONFIG_ARCH_SETJMP_H is set.  It imports setjmp()
and longjmp(), which the firmware exports only when it supplies its own
implementation; without the guard the kernel link fails on two undefined
references.

Verified on lm3s6965-ek:qemu-nxflat with the option off and on.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
@github-actions

Copy link
Copy Markdown

🔗 Cross-repo PR dependencies

The read-only Build run reported the following dependent PR(s) and fetched head SHA(s):

CI run: https://github.com/apache/nuttx-apps/actions/runs/36310578373

# longjmp imports setjmp() and longjmp(), which the symbol table exports only
# where NuttX supplies them itself.

ifeq ($(CONFIG_ARCH_SETJMP_H),y)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to the first patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants