Skip to content
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

Add a configure option to enable LTO #12441

Merged
merged 1 commit into from
Jan 24, 2023
Merged

Conversation

rgacogne
Copy link
Member

Short description

The supported options are:

  • thin: this is the recommended option for clang, as it is more scalable. It automatically determines the number of CPU cores to use. It requires support in the linker as well.
  • auto: this is the recommended option for GCC, and a valid fallback for clang when thin is not supported. It automatically determines the number of CPU cores to use as well.
  • yes: this translates to -flto, which will use a single CPU core in most cases, but is a valid fallback.
  • no: LTO is disabled.

For now the default is no.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

The supported options are:
- thin: this is the recommended option for clang, as it is more
  scalable. It automatically determines the number of CPU cores
  to use. It requires support in the linker as well.
- auto: this is the recommended option for GCC, and a valid
  fallback for clang when 'thin' is not supported. It automatically
  determines the number of CPU cores to use as well.
- yes: this translates to '-flto', which will use a single CPU core
  in most cases, but is a valid fallback.
- no: LTO is disabled.
Copy link
Contributor

@fredmorcos fredmorcos left a comment

Choose a reason for hiding this comment

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

So it falls back to auto if thin is specified but isn't supported. IIUC this is to accommodate gcc?

@rgacogne
Copy link
Member Author

So it falls back to auto if thin is specified but isn't supported. IIUC this is to accommodate gcc?

gcc but also perhaps other compilers, yes. My idea was to be able to use enable-lto=thin without having to worry about compiler support (auto would have been clearer but it was already taken in this context :)).

@rgacogne rgacogne merged commit 2512319 into PowerDNS:master Jan 24, 2023
@rgacogne rgacogne deleted the enable-lto branch January 24, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants