Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 955567 - Towards (eventually) enabling LTO by default
Summary: Towards (eventually) enabling LTO by default
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Profiles (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: Tracker
Depends on: 926120
Blocks:
  Show dependency tree
 
Reported: 2025-05-07 14:16 UTC by Sam James
Modified: 2025-05-07 18:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-07 14:16:18 UTC
Our ultimate aspiration is to get to a point where we build with LTO by "default" (as much as anything is default in Gentoo).

People ask occasionally what the plan is on this, so writing it down here.

It's roughly going to look like:
* Solving any (remaining) blockers
* Enabling it for (some of) the binhost
* Enabling it for all of the binhost
* Enabling it for building stages themselves
* Recommending it in the handbook
* Perhaps adding it to the default make.conf

In terms of big-picture infrastructure blockers, bug 926120 was the main one which is solved as of a few days ago (but need more packages to adopt it).

See also https://wiki.gentoo.org/wiki/Project:Toolchain/LTO.
Comment 1 Eli Schwartz gentoo-dev 2025-05-07 14:38:38 UTC
Specifically with regard to "perhaps adding it to the default make.conf" I don't think we can or even should do this.

It's best used in build-once-run-many scenarios. And documenting it in the handbook is advocacy so users get to choose how interesting it is to them.

But enabling it by default in the pre-shipped make.conf will result in it being used in many throwaway environments where it non-trivially raises build times without being used enough to justify the cost.

Think e.g. CI environments building their dependencies.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-07 14:41:25 UTC
(In reply to Eli Schwartz from comment #1)

I'd even thought of this point the other night and apparently forgot about it. Yeah, I agree.
Comment 3 zyxhere 2025-05-07 18:39:04 UTC
(In reply to Eli Schwartz from comment #1)
> Specifically with regard to "perhaps adding it to the default make.conf" I
> don't think we can or even should do this.
> 
> It's best used in build-once-run-many scenarios. And documenting it in the
> handbook is advocacy so users get to choose how interesting it is to them.
> 
> But enabling it by default in the pre-shipped make.conf will result in it
> being used in many throwaway environments where it non-trivially raises
> build times without being used enough to justify the cost.
> 
> Think e.g. CI environments building their dependencies.

Isn't that a good thing? People would quickly find out if theres any issue with LTO on their software.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-07 18:40:53 UTC
(In reply to zyxhere from comment #3)
> Isn't that a good thing? People would quickly find out if theres any issue
> with LTO on their software.

They're using Gentoo in their CI to build dependencies, not using Portage to build the software itself, so it's just wasted time.
Comment 5 Eli Schwartz gentoo-dev 2025-05-07 18:42:56 UTC
(In reply to zyxhere from comment #3)
> Isn't that a good thing? People would quickly find out if theres any issue
> with LTO on their software.


No, because their software wouldn't be built with LTO, only the system dependencies. You can't even do LTO across shared library dependencies.