Merge "Do not enable global ThinLTO for tests" am: a4631f41cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2206380 Change-Id: I498061b1a48db2119cff9d228dfb23bad6447d46 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
7bdadca326
2 changed files with 8 additions and 2 deletions
5
cc/cc.go
5
cc/cc.go
|
@ -485,6 +485,7 @@ type ModuleContextIntf interface {
|
||||||
static() bool
|
static() bool
|
||||||
staticBinary() bool
|
staticBinary() bool
|
||||||
testBinary() bool
|
testBinary() bool
|
||||||
|
testLibrary() bool
|
||||||
header() bool
|
header() bool
|
||||||
binary() bool
|
binary() bool
|
||||||
object() bool
|
object() bool
|
||||||
|
@ -1486,6 +1487,10 @@ func (ctx *moduleContextImpl) testBinary() bool {
|
||||||
return ctx.mod.testBinary()
|
return ctx.mod.testBinary()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ctx *moduleContextImpl) testLibrary() bool {
|
||||||
|
return ctx.mod.testLibrary()
|
||||||
|
}
|
||||||
|
|
||||||
func (ctx *moduleContextImpl) header() bool {
|
func (ctx *moduleContextImpl) header() bool {
|
||||||
return ctx.mod.Header()
|
return ctx.mod.Header()
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,12 +140,13 @@ func (lto *lto) DefaultThinLTO(ctx BaseModuleContext) bool {
|
||||||
lib32 := ctx.Arch().ArchType.Multilib == "lib32"
|
lib32 := ctx.Arch().ArchType.Multilib == "lib32"
|
||||||
// CFI enables full LTO.
|
// CFI enables full LTO.
|
||||||
cfi := ctx.isCfi()
|
cfi := ctx.isCfi()
|
||||||
// Performance and binary size are less important for host binaries.
|
// Performance and binary size are less important for host binaries and tests.
|
||||||
host := ctx.Host()
|
host := ctx.Host()
|
||||||
|
test := ctx.testBinary() || ctx.testLibrary()
|
||||||
// FIXME: ThinLTO for VNDK produces different output.
|
// FIXME: ThinLTO for VNDK produces different output.
|
||||||
// b/169217596
|
// b/169217596
|
||||||
vndk := ctx.isVndk()
|
vndk := ctx.isVndk()
|
||||||
return GlobalThinLTO(ctx) && !lto.Never() && !lib32 && !cfi && !host && !vndk
|
return GlobalThinLTO(ctx) && !lto.Never() && !lib32 && !cfi && !host && !test && !vndk
|
||||||
}
|
}
|
||||||
|
|
||||||
func (lto *lto) FullLTO() bool {
|
func (lto *lto) FullLTO() bool {
|
||||||
|
|
Loading…
Reference in a new issue