casaroli commented on code in PR #19940:
URL: https://github.com/apache/nuttx/pull/19940#discussion_r3879793545


##########
Documentation/components/tools/fdpic.rst:
##########
@@ -0,0 +1,111 @@
+=====================================
+fdpic: FDPIC module build tooling
+=====================================
+
+``tools/fdpic`` is everything needed to build an FDPIC module out of tree.  A
+module is an ELF shared object whose read-only segment the target maps straight
+out of flash and executes in place, while its writable segment is copied to RAM
+once per running instance.  It links against nothing: libc and everything else
+are imported from the firmware's exported symbol table at load time.
+
+These are host tools only.  ``apps/examples/fdpicxip`` uses them to rebuild its
+committed module blobs, which is what they are in the tree for.  The loader 
that
+runs such a module is proposed separately; until it is in, a module built here
+has nothing in NuttX to load it.
+
+Contents
+========
+
+============================ ==================================================
+File                         Purpose
+============================ ==================================================
+``nuttx-fdpic.mk``           The module build itself; include it from a
+                             two-line makefile
+``fdpic-verify.sh``          Checks a built module's imports resolve against
+                             the firmware
+``nuttx-exports.sh``         Turns ``libs/libc/exec_symtab.c`` into a symbol
+                             list
+``fdpic-embed.py``           Turns a built module into a C header, for carrying
+                             one inside an image
+``build-binutils.sh``        Builds the ``arm-uclinuxfdpiceabi`` binutils, the
+                             one from-source dependency
+``crt0.c``                   The module start-up file, linked into every
+                             module that is entered
+``init-array.ld``            Names the bounds of ``.init_array`` for it
+============================ ==================================================
+
+Building a module
+=================
+
+A whole module is three lines of makefile beside the source.  Taking
+``apps/examples/fdpicxip/modules/qsorter.c``, which is a module in its own
+right, as the source:
+
+.. code:: makefile
+
+   MODULE = qsorter
+   SRCS   = qsorter.c
+
+   include /path/to/nuttx/tools/fdpic/nuttx-fdpic.mk

Review Comment:
   FDPIC needs `arm-uclinuxfdpiceabi` binutils, no distro ships it and the CI 
container does not have it. so an in-tree build has to do something sensible 
when the linker is missing. skip the module build with a warning? a Kconfig 
that only appears when the linker is found? something else?
   
   should we add it to the CI container image?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to