What is link time optimization LTO

Link Time Optimization (LTO) optimizes Rust code across all compilation units during linking, configured via the rust.lto setting in bootstrap.toml.

Link Time Optimization (LTO) is a compiler technique that optimizes code across multiple compilation units during the linking phase to improve performance. In the Rust compiler build system, LTO is configured via the rust.lto setting in bootstrap.toml or the --set rust.lto=thin flag in the ./configure script. To enable thin LTO for the Rust compiler build, run: ./configure --set rust.lto=thin