-
Notifications
You must be signed in to change notification settings - Fork 8.4k
toolchain: gcc: Add a new LTO_SINGLE_THREADED option for LTO #100034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toolchain: gcc: Add a new LTO_SINGLE_THREADED option for LTO #100034
Conversation
16baf65 to
5d2075d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this, but we need corresponding property names in the templates:
https://github.com/zephyrproject-rtos/zephyr/blob/main/cmake/compiler/compiler_flags_template.cmake
https://github.com/zephyrproject-rtos/zephyr/blob/main/cmake/linker/linker_flags_template.cmake
and it seems the existing optimization_lto and lto_arguments are also missing 🙁
|
@RobinKastberg will you take a look at corresponding IAR flags to use ? so that this property is not empty for those toolchains 🙂 |
As described in this issue: zephyrproject-rtos/sdk-ng#1038 `-flto=auto` fails on some (slower) Windows machines due to an issue with the Zephyr SDK's GCC toolchain for Windows. In order to allow users to work around this issue, introduce a new CONFIG_LTO_SINGLE_THREADED option that switches to `-flto=1`, which enforces a single thread when processing LTO. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add variants of existing tests to cover this new Kconfig option. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
5d2075d to
7e25065
Compare
Thanks, done @tejlmand. |
@tejlmand I don't think LTO was supported on these toolchains to start with, so this new single-threaded option is not applicable to those until they actually support LTO itself? |
|
Yeah... This is 100% the way for us. But I appreciate being asked anyways! You can leave it empty |
Seems like it. |



As described in this issue:
zephyrproject-rtos/sdk-ng#1038
-flto=autofails on some (slower) Windows machines due to an issue with the Zephyr SDK's GCC toolchain for Windows.In order to allow users to work around this issue, introduce a new CONFIG_LTO_SINGLE_THREADED option that switches to
-flto=1, which enforces a single thread when processing LTO.