JunyuanShen943 opened a new pull request, #22201:
URL: https://github.com/apache/nuttx/pull/22201

   ## Summary
   
   * Why: the proxy, stub and wrapper generators in `tools/mksyscall` emit
     the syscall's header include outside the per-syscall condition guard.
     A conditional syscall whose header belongs to a module that may be
     absent (for example an out-of-tree module that adds entries to
     `syscall.csv`) then breaks the build when that module is disabled.
   * How: wrap the generated header include in the same `#if <condition>`
     as the syscall body, so a disabled syscall compiles as an empty unit.
     Syscalls without a condition are unchanged.
   
   ## Impact
   
   * New feature or changed behavior: NO.  Only the generated
     PROXY_/STUB_/WRAP_ files change, and only for conditional syscalls.
   * User adaptation needed: NO.
   * Build: generated syscall sources only.
   * Hardware: NO.
   * Documentation: NO.
   * Security: NO.
   * Compatibility: NO.  Every in-tree syscall header exists in every
     configuration, so in-tree builds behave the same.
   
   ## Testing
   
   I confirm that changes are verified on local setup and works as intended:
   
   * Build Host: Ubuntu 22.04 x86_64, gcc 13.1.0
   * Target: sim:nsh (make and CMake), plus mksyscall run directly on
     `syscall/syscall.csv`.
   
   Generated proxy before change (`mksyscall -p syscall/syscall.csv`):
   
   ```
   #include <nuttx/config.h>
   #include <sys/eventfd.h>
   #include <syscall.h>
   
   #if defined(CONFIG_EVENT_FD)
   ```
   
   After change:
   
   ```
   #include <nuttx/config.h>
   #if defined(CONFIG_EVENT_FD)
   #include <sys/eventfd.h>
   #endif
   #include <syscall.h>
   
   #if defined(CONFIG_EVENT_FD)
   ```
   
   sim:nsh make and CMake builds pass, ostest exits with status 0,
   `tools/checkpatch.sh -m` is clean.
   
   ## PR verification Self-Check
   
   * [x] This PR introduces only one functional change.
   * [x] I have updated all required description fields above.
   * [x] My PR adheres to Contributing Guidelines and Documentation (git commit 
title and message, coding standard, etc).
   * [ ] My PR is still work in progress (not ready for review).
   * [x] My PR is ready for review and can be safely merged into a codebase.
   


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

  • [PR] tools/mksyscall: guard c... JunyuanShen943 (via GitHub) via commits

Reply via email to