diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index 219ec5c51279..cb3f7363957e 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 30840a487273..0548380331be 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -620,9 +620,9 @@ pub fn lto(&self) -> config::Lto { 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; }