Change lto_test to use GlobalThinLTO configuration

This is now the default, and we will be removing non-GlobalThinLTO configuration.

Also changed handling for lto: never, it doesn't need to create an
lto-none variant.

Change-Id: I971baa920df867fb762923d925eed22215a89c27
Test: presubmit
This commit is contained in:
Yi Kong
2023-10-05 05:03:42 +00:00
parent c68afc4e9f
commit 577a73a22d
2 changed files with 43 additions and 56 deletions

View File

@@ -35,11 +35,11 @@ import (
// optimized at link time and may not be compatible with features that require
// LTO, such as CFI.
//
// This file adds support to soong to automatically propogate LTO options to a
// This file adds support to soong to automatically propagate LTO options to a
// new variant of all static dependencies for each module with LTO enabled.
type LTOProperties struct {
// Lto must violate capitialization style for acronyms so that it can be
// Lto must violate capitalization style for acronyms so that it can be
// referred to in blueprint files as "lto"
Lto struct {
Never *bool `android:"arch_variant"`
@@ -67,10 +67,12 @@ func (lto *lto) props() []interface{} {
}
func (lto *lto) begin(ctx BaseModuleContext) {
// First, determine the module indepedent default LTO mode.
// First, determine the module independent default LTO mode.
ltoDefault := GlobalThinLTO(ctx)
if ctx.Config().IsEnvTrue("DISABLE_LTO") {
ltoDefault = false
} else if lto.Never() {
ltoDefault = false
} else if ctx.Host() {
// Performance and binary size are less important for host binaries.
ltoDefault = false