From 406e7b725b9d51ff5e9eff6ed794a9e35a2eb3e3 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Fri, 15 Oct 2021 15:54:12 +0800 Subject: [PATCH] Turn on Global ThinLTO by default Apply ThinLTO without optimization (--lto-O0) globally. This saves us 2.24% in binary size for system/lib64, as well as more than 4.68% build time improvement. Test: presubmit Bug: 169004486 Change-Id: I1ed90c2058f9ff1fa8a2d3fd7ac1191c5d98dac1 --- cc/lto.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/lto.go b/cc/lto.go index 1da69bf16..304790c54 100644 --- a/cc/lto.go +++ b/cc/lto.go @@ -155,7 +155,7 @@ func (lto *lto) Never() bool { } func GlobalThinLTO(ctx android.BaseModuleContext) bool { - return ctx.Config().IsEnvTrue("GLOBAL_THINLTO") + return !ctx.Config().IsEnvFalse("GLOBAL_THINLTO") } // Propagate lto requirements down from binaries