extinguish opened a new pull request, #17854: URL: https://github.com/apache/nuttx/pull/17854
## Summary 1. Enable -ffunction-sections and -fdata-sections compiler options for Green Hills (GHS) toolchain builds when CONFIG_DEBUG_OPT_UNUSED_SECTIONS is configured. 2. Adjust Toolchain.defs to apply these optimization flags consistently across all ARM toolchains (outside the GHS exception), improving linker garbage collection behavior. ## Impact 1. Allows Green Hills toolchain users to benefit from section-level dead code elimination, reducing final binary size through linker garbage collection. 2. Ensures uniform optimization behavior across different ARM toolchains (GCC, Clang, GHS) when CONFIG_DEBUG_OPT_UNUSED_SECTIONS is enabled. ## Testing 1. Verified compilation with Green Hills toolchain using CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y to ensure the flags are correctly added. 2. Confirmed that the modified Toolchain.defs does not break existing GCC/Clang builds and still applies the optimization flags as expected. -- 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]
