Community

Ubuntu proposal would enable LTO by default for Rust packages

Ubuntu may soon flip Rust LTO on by default, promising smaller binaries and possible runtime gains, but with build-time tradeoffs packagers already know.

Nina Kowalski2 min read
Published
Listen to this article0:00 min
Share this article:
Ubuntu proposal would enable LTO by default for Rust packages
AI-generated illustration
This article contains affiliate links, marked with a blue dot. We may earn a small commission at no extra cost to you.

Rust packages in Ubuntu may soon get the same default optimization treatment that C and C++ have enjoyed since the 21.04 cycle, a shift that could make binaries smaller and, in some cases, faster. The proposal came from zamazan4ik and framed LTO as a practical packaging win, not a theory project: if Ubuntu already treats link-time optimization as the normal path for native code, Rust should not be the exception.

The appeal is easy to see for everyday users and maintainers alike. Rust’s cross-crate optimization can give the compiler more room to inline and specialize code across package boundaries, which can trim binary size and sometimes improve runtime performance. The tradeoff is just as familiar to distro builders: more work at link time, more memory pressure during builds, and the possibility that CI runs take longer even when the shipped artifacts improve.

Ubuntu already has a playbook for that balance. Since the 21.04 cycle, the distro has enabled LTO by default for C and C++ packages on 64-bit architectures, with exceptions handled through an lto-disabled-list for packages that regress. Matthias Klose said in March 2021 that about 80 packages in Ubuntu main regressed under LTO and needed follow-up uploads or package-level fixes. That history is one reason the Rust proposal reads less like a leap and more like the next step in a policy Ubuntu has already tested at scale.

The comparison with other distributions strengthens the case. Debian’s tooling documentation says LTO is not enabled by default there, though maintainers can opt in with DEB_BUILD_MAINT_OPTIONS=optimize=+lto. Debian also says it has run archive test rebuilds to catch regressions introduced by LTO, and notes that LTO increases memory use during linking. The Ubuntu discussion points out that Debian, openSUSE, Fedora, and Arch Linux do not appear to enable Rust LTO by default either, which gives Ubuntu a chance to set a precedent for Debian-family packaging.

The proposal lands at a moment when Ubuntu is already pushing Rust deeper into the stack. In April 2026, Canonical said it had joined the Rust Foundation as a Gold member, Ubuntu 26.04 LTS will ship with Rust 1.93.1 as the default toolchain, and ntpd-rs, Rust coreutils 0.7.0, and sudo-rs 0.2.13 are all part of the broader transition. Ubuntu also patched its Rust toolchain for CVE-2026-33056, added opt-in cargo-auditable support in dh-cargo, and made miri available for packagers. Against that backdrop, default LTO for Rust would not just be a compiler flag change. It would be another signal that Rust is being handled as first-class infrastructure on Ubuntu, with the same expectations for polish, performance, and maintainability that long shaped C and C++ packaging.

Know something we missed? Have a correction or additional information?

Submit a Tip

Never miss a story.
Get Rust Programming updates weekly.

The top stories delivered to your inbox.

Free forever · Unsubscribe anytime

Discussion

More Rust Programming News