Skip to content

Commit c7037ff

Browse files
committed
Auto merge of #47548 - alexcrichton:beta-default-fat, r=michaelwoerister
[beta] Turn back on "fat" LTO by default This commit reverts a small portion of the switch to ThinLTO by default which changed the meaning of `-C lto` from "put the whole crate graph into one codegen unit" to "perform ThinLTO over the whole crate graph". This backport has no corresponding commit on master as #47521 is making the same change but in a slightly different manner. This commit is intended to be a surgical change with low impact on beta. Closes #47409
2 parents 1262787 + c4771ec commit c7037ff

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/librustc/session/mod.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -814,9 +814,15 @@ impl Session {
814814
return enabled
815815
}
816816

817-
// If there's only one codegen unit and LTO isn't enabled then there's
818-
// no need for ThinLTO so just return false.
819-
if self.codegen_units() == 1 && !self.lto() {
817+
// If LTO is enabled we right now unconditionally disable ThinLTO.
818+
// This'll come at a later date! (full crate graph ThinLTO)
819+
if self.lto() {
820+
return false
821+
}
822+
823+
// If there's only one codegen unit or then there's no need for ThinLTO
824+
// so just return false.
825+
if self.codegen_units() == 1 {
820826
return false
821827
}
822828

0 commit comments

Comments
 (0)