Skip to content

[3/10] tools/fdpic: Add the module build helpers the demo apps use. - #19940

Draft
casaroli wants to merge 1 commit into
apache:masterfrom
casaroli:tools-fdpic
Draft

[3/10] tools/fdpic: Add the module build helpers the demo apps use.#19940
casaroli wants to merge 1 commit into
apache:masterfrom
casaroli:tools-fdpic

Conversation

@casaroli

@casaroli casaroli commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

apps/examples/fdpicxip is in apps master and its modules/Makefile reads $(NUTTX_DIR)/tools/fdpic/nuttx-fdpic.mk and $(NUTTX_DIR)/tools/fdpic/fdpic-embed.py, which are not in this tree, so its committed module blobs cannot be regenerated. This adds what that Makefile names.

nuttx-fdpic.mk builds a module: compile with the stock arm-none-eabi GCC, which emits correct FDPIC objects for C and C++, then assemble and link with an arm-uclinuxfdpiceabi binutils, which is the only piece a distribution does not carry. build-binutils.sh builds that, and takes about a minute. nuttx-exports.sh turns a built firmware's exec_symtab.c into a symbol list, fdpic-verify.sh checks a module's imports against it, and fdpic-embed.py turns a module into a C header.

Documentation/components/tools/fdpic.rst describes them under Host Tools, where the tools index picks it up by glob. This answers @cederom's request on #19673 to move the tool README into the documentation.

This is the third of ten PRs that #19673 is being split into, so each can be reviewed on its own. The first four have no FDPIC content at all and do not depend on each other, so they can merge in any order. The remaining six are the FDPIC work itself, one subsystem each, and each is a no-op with CONFIG_FDPIC off: loader core, ARM relocations, the callback entry points, the exec() path, DT_NEEDED through dlopen(), then documentation and a board configuration. The others are [1/10] #19938, [2/10] #19939 and [4/10] #19941.

Impact

Host side only. Nothing in the NuttX build calls these tools, no Kconfig option selects them, and no target code changes.

The loader that runs what they build is proposed separately, so a module built here has nothing in NuttX to load it yet. The page says so.

Testing

make html in Documentation/ produces no warning for the new page. The local build fails on pre-existing duplicate C declarations and a missing plantuml, neither related to this change.

tools/checkpatch.sh passes.

These are the tools that built the module blobs committed in apps/examples/fdpicxip, on macOS with the arm-uclinuxfdpiceabi binutils 2.43 that build-binutils.sh builds.

apps/examples/fdpicxip is in apps master and its modules/Makefile reads

  FDPICDIR  = $(NUTTX_DIR)/tools/fdpic
  MODULE_MK = $(FDPICDIR)/nuttx-fdpic.mk
  EMBED     = $(FDPICDIR)/fdpic-embed.py

which is not in this tree, so the committed module blobs cannot be
regenerated.  This adds what that Makefile names.

nuttx-fdpic.mk builds a module: compile with the stock arm-none-eabi GCC,
which emits correct FDPIC objects for C and C++, then assemble and link
with an arm-uclinuxfdpiceabi binutils, which is the only piece a
distribution does not carry.  build-binutils.sh builds that, and takes
about a minute.

nuttx-exports.sh turns a built firmware's exec_symtab.c into a symbol
list, fdpic-verify.sh checks a module's imports against it, and
fdpic-embed.py turns a module into a C header for an image that carries
one inside it.

The tools are host side and nothing in the NuttX build calls them.  The
loader that runs what they build is proposed separately, so a module built
here has nothing to load it yet, and the page says so.

Documentation/components/tools/fdpic.rst describes them, under Host Tools,
where the tools index picks it up by glob.

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

MemBrowse Memory Report

No memory changes detected for:

@casaroli casaroli changed the title [3/4] tools/fdpic: Add the module build helpers the demo apps use. [3/10] tools/fdpic: Add the module build helpers the demo apps use. Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant