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
diff --git a/cc/lto.go b/cc/lto.go
index 1da69bf..304790c 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -155,7 +155,7 @@
}
func GlobalThinLTO(ctx android.BaseModuleContext) bool {
- return ctx.Config().IsEnvTrue("GLOBAL_THINLTO")
+ return !ctx.Config().IsEnvFalse("GLOBAL_THINLTO")
}
// Propagate lto requirements down from binaries