diff --git a/cc/lto.go b/cc/lto.go index 35da62da20..b0cf2c0654 100644 --- a/cc/lto.go +++ b/cc/lto.go @@ -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 @@ -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) { @@ -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 }