Repository navigation
examples/hello: Build a loadable module for "m" in CMake. - #3883
Merged
Merged
Conversation
With CONFIG_EXAMPLES_HELLO=m, the Make build makes hello a loadable
module (MODULE = $(CONFIG_EXAMPLES_HELLO) in the Makefile). The
CMakeLists.txt does not give MODULE to nuttx_add_application(), so the
CMake build makes no program at all: hello is not built in, and there
is no bin/hello.
Give MODULE ${CONFIG_EXAMPLES_HELLO} to both nuttx_add_application()
calls, as the other examples do.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
This was referenced Oct 19, 2026
cederom
approved these changes
Oct 19, 2026
xiaoxiang781216
approved these changes
Oct 19, 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
With
CONFIG_EXAMPLES_HELLO=m, the Make build makeshelloa loadable module (MODULE = $(CONFIG_EXAMPLES_HELLO)in the Makefile).examples/hello/CMakeLists.txtdoes not giveMODULEtonuttx_add_application(), so the CMake build makes no program at all:hellois not built in, and there is nobin/hello(nsh: hello: command not found).This PR gives
MODULE ${CONFIG_EXAMPLES_HELLO}to bothnuttx_add_application()calls, as the other examples do.Impact
CMake builds with
CONFIG_EXAMPLES_HELLO=m:bin/hellois now a loadable module. No change fory.Testing
qemu-armv8a:nsh(flat, CMake, QEMU HVF) withCONFIG_ELF,CONFIG_EXECFUNCS_SYSTEM_SYMTABandCONFIG_EXAMPLES_HELLO=m,bin/loaded from a 9p share:bin/hellonsh: hello: command not foundHello, World!!The test needs apache/nuttx#20807 (
get_environ_ptrin libc.csv) to load any ELF program with the system symbol table.tools/checkpatch.sh -c -u -m -gpasses.