diff options
Diffstat (limited to 'cc/lto.go')
| -rw-r--r-- | cc/lto.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |