Skip to content

Commit

Permalink
Revert "lto: enable O3 optimizations on explicit lto modules"
Browse files Browse the repository at this point in the history
This reverts commit 034a0af.
  • Loading branch information
minaripenguin committed Sep 9, 2024
1 parent 44c735a commit 832b494
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cc/lto.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func (lto *lto) flags(ctx ModuleContext, flags Flags) Flags {
}
if lto.Properties.LtoEnabled {
ltoCFlags := []string{"-flto=thin", "-fsplit-lto-unit"}
var ltoCOnlyFlags []string
var ltoLdFlags []string

// The module did not explicitly turn on LTO. Only leverage LTO's
Expand All @@ -120,9 +119,6 @@ func (lto *lto) flags(ctx ModuleContext, flags Flags) Flags {
// Apply the same for Eng builds as well.
if !lto.ThinLTO() || ctx.Config().Eng() {
ltoLdFlags = append(ltoLdFlags, "-Wl,--lto-O0")
} else {
ltoLdFlags = append(ltoLdFlags,"-Wl,--lto-O3")
ltoCOnlyFlags = append(ltoCOnlyFlags, "-O3")
}

if Bool(lto.Properties.Whole_program_vtables) {
Expand Down Expand Up @@ -168,7 +164,6 @@ func (lto *lto) flags(ctx ModuleContext, flags Flags) Flags {
flags.Local.AsFlags = append(flags.Local.AsFlags, ltoCFlags...)
flags.Local.LdFlags = append(flags.Local.LdFlags, ltoCFlags...)
flags.Local.LdFlags = append(flags.Local.LdFlags, ltoLdFlags...)
flags.Local.CFlags = append(flags.Local.CFlags, ltoCOnlyFlags...)
}
return flags
}
Expand Down

0 comments on commit 832b494

Please sign in to comment.