Global ThinLTO: opt out vndk binaries as a workaround
With global ThinLTO enabled, vndk version has different symbol ordering
from the platform version. Opt out any binaries that has vndk enabled as
a temporary workaround.
Test: GLOBAL_THINLTO=true m
Bug: 169217596
Change-Id: I75b060cbe6c74421d283c6dfbd669af20f466d1f
diff --git a/cc/lto.go b/cc/lto.go
index abd8dfb..a3b28d9 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -71,7 +71,8 @@
} else if ctx.Config().IsEnvTrue("GLOBAL_THINLTO") {
staticLib := ctx.static() && !ctx.staticBinary()
hostBin := ctx.Host()
- if !staticLib && !hostBin {
+ vndk := ctx.isVndk() // b/169217596
+ if !staticLib && !hostBin && !vndk {
if !lto.Never() && !lto.FullLTO() {
lto.Properties.Lto.Thin = boolPtr(true)
}