diff options
author | 2024-03-28 06:10:30 +0000 | |
---|---|---|
committer | 2024-06-07 09:55:37 +0000 | |
commit | df0289bfbdb770d45adcb388c8ebb455eafa81d8 (patch) | |
tree | f528ea346e10dd4220b3fb4c415d534fbfa29062 | |
parent | 620b0c46d9b4997bc86ac88b15d2f7086359e002 (diff) |
Revert^4 "Enable full LTO optimization by default"
97f68587fff22676d3f71b7e0ea7f2d2c4649558
Change-Id: I722e046ed23874a75f407d3d211124251b652aae
-rw-r--r-- | cc/lto.go | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -54,6 +54,9 @@ type LTOProperties struct { // Use -fwhole-program-vtables cflag. Whole_program_vtables *bool + + // Use --lto-O0 flag. + Lto_O0 *bool } type lto struct { @@ -106,12 +109,8 @@ func (lto *lto) flags(ctx ModuleContext, flags Flags) Flags { ltoCFlags := []string{"-flto=thin", "-fsplit-lto-unit"} var ltoLdFlags []string - // The module did not explicitly turn on LTO. Only leverage LTO's - // better dead code elimination and CFG simplification, but do - // not perform costly optimizations for a balance between compile - // time, binary size and performance. - // Apply the same for Eng builds as well. - if !lto.ThinLTO() || ctx.Config().Eng() { + // Do not perform costly LTO optimizations for Eng builds. + if Bool(lto.Properties.Lto_O0) || ctx.Config().Eng() { ltoLdFlags = append(ltoLdFlags, "-Wl,--lto-O0") } |