Remove GLOBAL_THINLTO build option

GLOBAL_THINLTO is now default, since it improves build speed, produces
more performant code and smaller binary. Remove the option to turn it
off since we no longer maintain that variation, and that simplifies the
logic (esp. for moving CFI builds to ThinLTO).

Also fixed a bug where ThinLTO is not propagated to its static deps on
non-default targets (32-bit or host).

Test: presubmit
Bug: 169004486
Change-Id: I31f41ba27c2b94a384d2ba5027049c307d6f4334
diff --git a/cc/lto.go b/cc/lto.go
index 281b527..d48be14 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -68,7 +68,7 @@
 
 func (lto *lto) begin(ctx BaseModuleContext) {
 	// First, determine the module independent default LTO mode.
-	ltoDefault := GlobalThinLTO(ctx)
+	ltoDefault := true
 	if ctx.Config().IsEnvTrue("DISABLE_LTO") {
 		ltoDefault = false
 	} else if lto.Never() {
@@ -163,10 +163,6 @@
 	return lto != nil && proptools.Bool(lto.Properties.Lto.Never)
 }
 
-func GlobalThinLTO(ctx android.BaseModuleContext) bool {
-	return !ctx.Config().IsEnvFalse("GLOBAL_THINLTO")
-}
-
 // Propagate lto requirements down from binaries
 func ltoDepsMutator(mctx android.TopDownMutatorContext) {
 	if m, ok := mctx.Module().(*Module); ok {
@@ -205,8 +201,6 @@
 
 // Create lto variants for modules that need them
 func ltoMutator(mctx android.BottomUpMutatorContext) {
-	globalThinLTO := GlobalThinLTO(mctx)
-
 	if m, ok := mctx.Module().(*Module); ok && m.lto != nil {
 		// Create variations for LTO types required as static
 		// dependencies
@@ -218,10 +212,10 @@
 			variationNames = append(variationNames, "lto-none")
 		}
 
-		if globalThinLTO && !m.lto.Properties.LtoEnabled {
+		if !m.lto.Properties.LtoEnabled {
 			mctx.SetDependencyVariation("lto-none")
 		}
-		if !globalThinLTO && m.lto.Properties.LtoEnabled {
+		if m.lto.Properties.LtoEnabled {
 			mctx.SetDependencyVariation("lto-thin")
 		}