anchao commented on PR #11421: URL: https://github.com/apache/nuttx/pull/11421#issuecomment-1867285965
> > Using ld may cause LTO optimization break, Link-Time-Optimization will only be executed in the link stage, and requires the support of GCC lto-wrapper. You can try replace gcc to ld and enable `CONFIG_LTO_FULL` on the Makefile base. > > thank you all @anchao @pkarashchenko. I plan to try to swtiching the linker to `gcc/g++` when enable LTO and handle the link options specially to see if it can work correctly. do I understand what you guys means correctly? or is it better to maintain the status quo in CMake Yep, I think you need to make a compatibility like the `makefile` base. If `CONFIG_LTO_FULL` is enabled, then switch to `GCC` to complete the link, otherwise use `ld`: https://github.com/apache/nuttx/blob/master/arch/arm/src/common/Toolchain.defs#L259-L266 https://github.com/apache/nuttx/blob/master/arch/arm/src/Makefile#L106-L133 -- 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]
