diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index 219ec5c51279e..cb3f7363957ef 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -539,5 +539,5 @@ pub(crate) struct UnexpectedBuiltinCfg { } #[derive(Diagnostic)] -#[diag("ThinLTO is not supported by the codegen backend")] +#[diag("ThinLTO is not supported by the codegen backend, using fat LTO instead")] pub(crate) struct ThinLtoNotSupportedByBackend; diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 30840a4872733..0548380331bef 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -620,9 +620,9 @@ impl Session { config::LtoCli::Thin => { // The user explicitly asked for ThinLTO if !self.thin_lto_supported { - // Backend doesn't support ThinLTO, disable LTO. + // Backend doesn't support ThinLTO, fallback to fat LTO. self.dcx().emit_warn(errors::ThinLtoNotSupportedByBackend); - return config::Lto::No; + return config::Lto::Fat; } return config::Lto::Thin; }