Zepp-Hanzj opened a new pull request, #19550:
URL: https://github.com/apache/nuttx/pull/19550

   ## Summary
   
   Track `sim_head.c` as a separate link source and include it in the simulator
   Make dependency generation and cleanup lists.
   
   `sim_head.o` is linked separately from `libarch`, so `sim_head.c` was not in
   `CSRCS`. It was also absent from `SRCS` and `makedepfile`, leaving the object
   without entries in `Make.dep`. Configuration or header changes therefore did
   not rebuild it during an incremental build.
   
   The source remains outside `CSRCS`, preserving the existing link behavior.
   
   Fixes #2211. The `up_head.c` name in that issue has since been renamed to
   `sim_head.c`.
   
   ## Impact
   
   Make-based simulator builds now rebuild `sim_head.o` when its configuration
   or included headers change. This prevents stale simulator startup logic after
   incremental configuration changes.
   
   There are no API, hardware, documentation, security, or compatibility
   changes.
   
   ## Testing
   
   Build host:
   
   - Ubuntu 20.04.6 LTS, x86_64
   - GCC 10.5.0
   
   Target:
   
   - `sim:nsh`
   
   On current `master`, changing from `CONFIG_ALLSYMS=n` to
   `CONFIG_ALLSYMS=y` and rebuilding left `sim_head.o` unchanged:
   
   ```text
   CONFIG_ALLSYMS=y
   make_exit=0
   before=1785117234
   after=1785117234
   ```
   
   The stale object did not contain `allsyms_relocate()`, even though the final
   image contained the generated `g_allsyms` table.
   
   With this change:
   
   ```text
   sim_head.o: sim/sim_head.c /usr/include/stdc-predef.h ...
   CONFIG_ALLSYMS=y
   make_exit=0
   before=1785117701
   after=1785117720
   CC: sim/sim_head.c
   ```
   
   Both the rebuilt object and final image contain the expected relocation
   function:
   
   ```text
   0000000000000000 t allsyms_relocate
   0000000040002672 t allsyms_relocate
   ```
   
   The simulator also started successfully:
   
   ```text
   NuttShell (NSH) NuttX-13.0.0
   nsh> uname -a
   NuttX 13.0.0 44299ddfcf-dirty Jul 27 2026 10:01:57 sim sim
   ```
   
   Additional checks:
   
   - `./tools/checkpatch.sh -f arch/sim/src/Makefile`
   - `git diff --check`
   - `make distclean`, including removal of a generated `sim_head.ddc`
   


-- 
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