diff options
author | 2024-08-26 15:35:14 +0900 | |
---|---|---|
committer | 2024-10-09 08:45:56 +0000 | |
commit | 6f01658ba8876f6e6e27f77f1c37eb0406f9a3e5 (patch) | |
tree | 3d2242c545ff0cf0574cb6a14d19ce6141ecd77d | |
parent | 43c36cade81f303c18083c986ec02998d43a18c3 (diff) |
Do not set --lto-O0 for optimize_for_size targets
--lto-O0 produces smaller binaries compared to --lto-O2 under -O2.
However under -Oz (the default for optimize_for_size), --lto-O2 actually
produces smaller binaries.
--lto-O0 --lto-O2
StatsD 2796856 2673728
libLLVM_android.so 15552712 14595544
Test: m
Change-Id: I33151cfd6abc273c4836418a6d8e0b935db02af4
-rw-r--r-- | cc/lto.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -110,7 +110,7 @@ func (lto *lto) flags(ctx ModuleContext, flags Flags) Flags { var ltoLdFlags []string // Do not perform costly LTO optimizations for Eng builds. - if Bool(lto.Properties.Lto_O0) || ctx.optimizeForSize() || ctx.Config().Eng() { + if Bool(lto.Properties.Lto_O0) || ctx.Config().Eng() { ltoLdFlags = append(ltoLdFlags, "-Wl,--lto-O0") } |