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

   ## Summary
   
   Program names containing '-' (for example, renaming hello to hello-world via 
PROGNAME) previously generated an invalid identifier <NAME>_main when 
constructing the main= compiler definition and the APP_MAIN target property 
used during builtin list generation. This caused the CMake build to fail 
because '-' is not a valid character in a C identifier.
   
   This mirrors the Make-based fix (Application.mk's PROGSYM) for the 
traditional build.
   
   Introduce NAME_SYM, a sanitized copy of NAME with '-' replaced by '_', and 
use it only where an internal C identifier is required: the main= 
COMPILE_DEFINITIONS property and the APP_MAIN target property. Leave NAME 
unchanged everywhere else, including CMake target/output names and the APP_NAME 
property, where hyphens are valid.
   
   The standalone/loadable executable path (MODULE/DYNLIB/kernel build) does 
not rename main() and therefore requires no sanitization because each 
executable is linked independently rather than merged into a shared builtin 
image.
   
   Testing (WSL2 Ubuntu, x86_64):
   - BOARD_CONFIG=sim/nsh, CONFIG_EXAMPLES_HELLO_PROGNAME="hello-world": clean 
CMake configure/build; 'hello-world' runs and prints 'Hello, World!!'
   - Reverted to CONFIG_EXAMPLES_HELLO_PROGNAME="hello": reconfigured and 
rebuilt; 'hello' runs and prints 'Hello, World!!' (no regression)
   
   Fixes #19447
   
   ## Impact
   
   RELEASE
   
   ## Testing
   
   CI


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