Skip to content

Conversation

@rhaschke
Copy link
Contributor

@rhaschke rhaschke commented Aug 10, 2025

Description

gcc >= 11.4 issues the following warning with -flto:
lto-wrapper: warning: using serial compilation of n LTRANS jobs

According to this stackoverflow issue, we need to use -flto=auto.

Suggested changelog entry:

  • Fix gcc 11.4+ warning about serial compilation.

@rhaschke rhaschke requested a review from henryiii as a code owner August 10, 2025 17:42
Copy link
Collaborator

@rwgk rwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@henryiii WDYT?

@henryiii henryiii merged commit 580494c into pybind:master Aug 12, 2025
86 checks passed
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Aug 12, 2025
@rhaschke rhaschke deleted the flto=auto branch August 13, 2025 08:02
@henryiii henryiii changed the title Fix LTO warning of gcc >= 11.4 fix(cmake): LTO warning of gcc >= 11.4 Aug 21, 2025
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Aug 22, 2025
@chillenb
Copy link

@henryiii
Copy link
Collaborator

henryiii commented Aug 23, 2025

If you set that (via CMAKE_INTERPROCEDURAL_OPTIMIZATION), it is used. We support thin vs. regular LTO, so that's why both methods are still supported (ours and CMake's).

@chillenb
Copy link

Thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants