From 134161f7e5ea08d323becb0b16734aa9d0cb610e Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Fri, 9 Oct 2020 22:05:59 +0800 Subject: [PATCH] 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 --- cc/lto.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cc/lto.go b/cc/lto.go index abd8dfb9f..a3b28d9a2 100644 --- a/cc/lto.go +++ b/cc/lto.go @@ -71,7 +71,8 @@ func (lto *lto) begin(ctx BaseModuleContext) { } 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) }