Hi Noah,
The common NuttX setup is a little different from Linux with a full runtime
dynamic linker and an installed libc.so. For an executable produced
on-device, a practical starting point is a loadable/partially linked ELF.
At load time, NuttX's ELF/binfmt loader resolves the executable's undefined
symbols (for example, printf) against the symbol table exported by the
running firmware. Relevant options include CONFIG_ELF,
CONFIG_LIBC_EXECFUNCS, and CONFIG_EXECFUNCS_HAVE_SYMTAB.
CONFIG_NSH_FILE_APPS lets NSH execute applications stored in the filesystem.
Headers are compile-time inputs; the runtime loader does not provide them.
For the exact NuttX configuration you are targeting, run:
make export
The generated nuttx-export-*.zip includes include/, libraries, build and
linker scripts, .config, and System.map. For an on-device compiler, you
would put the required subset of these files on the target filesystem and
ensure its output matches the target CPU, ABI, and firmware configuration.
Useful starting points:
- https://nuttx.apache.org/docs/latest/components/binfmt.html
- https://nuttx.apache.org/docs/latest/guides/partially_linked_elf.html
- https://nuttx.apache.org/docs/latest/guides/fully_linked_elf.html
- https://nuttx.apache.org/docs/latest/applications/examples/elf/index.html
If you specifically mean loading shared objects with dlopen()/dlsym(),
CONFIG_LIBC_DLFCN and the sotest example are also relevant:
https://nuttx.apache.org/docs/latest/applications/examples/sotest/index.html
Which architecture, board, and NuttX build mode are you targeting? That
would help narrow down the required compiler and linker flags.
Best,
Aviral