turning on link time optimizations (LTO) for 21.04

Matthias Klose doko at ubuntu.com
Fri Mar 19 15:19:29 UTC 2021

On 1/29/21 1:34 PM, Matthias Klose wrote:
> Link time optimization (LTO) is a way to run optimizations across multiple
> translation units, enabling more opportunities for optimizations at link time.
> The optimizations allow for faster code and smaller files.
> LTO will be turned on for the 64bit architectures (except riscv64) by default
> for 21.04, after glibc 2.33 made it to the release pocket (just for
> disentanglement).
> Some upstream projects already turn on LTO by default, or provide configuration
> options to turn it on (like GCC, Python).  Other Linux distributions are already
> released with LTO turned on by default.
> If you want to test a package build with LTO turned on, use
>     DEB_BUILD_OPTIONS=optimize=+lto dpkg-buildpackage ...
> using dpkg, currently in hirsute-proposed.
> Please make sure to add the 'lto' tag to bug reports when reporting issues about
> LTO.
> Details at https://wiki.ubuntu.com/ToolChain/LTO.
> Feedback and improvements for the wiki page are welcome.

This is now turned on by default, a bit later than expected (discussed and
approved by Lukasz). The package lto-disabled-list is now seeded with all
packages not in main, which regressed with LTO optimizations for some reason.

For the ~80 regressing packages in main, I'll do uploads after the next test
rebuild planned for next week, either fixing the regression, or turning off LTO
optimizations directly in the package. Feel free to ping me on irc if the fix is
needed earlier.


More information about the ubuntu-devel mailing list