examples/fdpicxip: Build the module fixtures without nuttx/tools/fdpic. - #3762
Open
casaroli wants to merge 1 commit into
Open
examples/fdpicxip: Build the module fixtures without nuttx/tools/fdpic.#3762casaroli wants to merge 1 commit into
casaroli wants to merge 1 commit into
Conversation
The modules this example and testing/fs/xipfs carry are built by an explicit 'make regen', which reached into nuttx/tools/fdpic for a makefile that builds a module, a script that turns one into a header, and two more that checked its imports. Review of apache/nuttx#19940 asked that NuttX not carry a module build of its own, and it no longer does: with CONFIG_FDPIC an ordinary FDPIC module is built by apps/Application.mk like any other. These are not ordinary modules, which is why they keep a build of their own. They are fixtures for loader edge cases: a library with a SONAME, a module with more DT_NEEDED entries than the loader will follow, one whose imports stay in the lazy binding table, and one naming a symbol the firmware does not export, which exists to be refused. Application.mk cannot say any of that. So the build stays, and it is here beside them rather than in NuttX. It is also much smaller. The generic module makefile is gone: it existed to be included by anything, and only this one directory ever did, so its dozen useful lines are rules here. fdpic-embed.py is gone: xxd does that, as examples/elf already does it, and the license header it also wrote is a template beside it. fdpic-verify.sh and nuttx-exports.sh are gone with no replacement; they checked at build time what the xipfs suite already asserts at run time, for two hundred lines. What the fixtures no longer carry is a crt0 and a linker script. Both come from the tree named by NUTTX_DIR, which is where the in-tree module build takes them, so a fixture is built the way a module is. The crt0 source is compiled here rather than the built object taken, because these are deliberately built for cortex-m3 while the firmware is not: a v7-M module runs on both the v7-M and v8-M targets, so one set of headers serves the RP2350 and mps2-an500 alike. Regenerated qsorter, libshape and cxxuser against a tree configured with CONFIG_FDPIC. qsorter is ARM FDPIC, v7-M, two PT_LOAD segments, entering at _start; libshape carries its SONAME and its DT_INIT_ARRAY. The committed headers are left as they are. They will change when they are next regenerated, because a fixture now carries the tree's crt0 rather than one of its own, and that is a change the xipfs suite should be run against rather than made blind. Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
casaroli
force-pushed
the
fdpicxip-in-tree
branch
from
August 28, 2026 17:05
719eeed to
f8e2299
Compare
🔗 Cross-repo PR dependenciesThe 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/33193062300 |
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.
depends-on: [apache/nuttx/pull/19940]
Summary
The FDPIC modules this example and
testing/fs/xipfscarry are built by an explicitmake regen, which reached intonuttx/tools/fdpicfor a makefile, a script that turned a module into a header, and two more that checked its imports.Review of apache/nuttx#19940 asked that NuttX not carry a module build of its own, and it no longer does: with
CONFIG_FDPICan ordinary module is built byapps/Application.mklike any other. What these fixtures need comes here instead, and it is much less.They keep a build at all because they are loader edge cases, not ordinary modules: a library with a
SONAME, a module with moreDT_NEEDEDentries than the loader will follow, one whose imports stay in the lazy binding table, and one naming a symbol the firmware does not export, which exists to be refused.Application.mkcannot say-soname, or "no entry point", or "link against that other module".What arrives is 145 changed lines in the makefile that was already here, plus a 24-line license template. What does not arrive is four files and 536 lines:
fdpic-embed.py, becausexxd -idoes that andexamples/elfalready uses it that wayfdpic-verify.shandnuttx-exports.sh, with no replacement: they checked at build time what the xipfs suite already asserts at run timeThe fixtures also stop carrying a
crt0and a linker script. Both come from the tree named byNUTTX_DIR, which is where the in-tree build takes them. Thecrt0source is compiled here rather than the built object taken, because these are deliberately built forcortex-m3while the firmware is not: a v7-M module runs on both v7-M and v8-M targets, so one set of headers serves the RP2350 and mps2-an500 alike.Impact
None on any build.
make regenis not part of the application build and nothing else runs these files. The*_bin.hheaders stay committed, so both apps still build with a plain toolchain and no FDPIC linker.NUTTX_DIRnow has to be configured withCONFIG_FDPIC, because that is what puts the FDPIC segments in the generatedgnu-elf.ld.The committed headers are unchanged here. They will change when next regenerated, because a fixture now carries the tree's
crt0rather than one of its own, and that is a change the xipfs suite should be run against rather than made blind.Testing
Rebuilt three fixtures from clean against a tree configured with
CONFIG_FDPIC, covering both kinds and both languages:qsorter(C module),libshape(C++ library) andcxxuser(C++ module linked against it).Two
PT_LOADsegments, and v7-M as intended rather than the firmware's v8-M.callbackis the one fixture not rebuilt here: it usesSIGEV_THREAD, so it needs a tree withCONFIG_SIG_EVTHREAD.tools/checkpatch.sh -c -u -m -gpasses.