From 4320449c979444e10128b5c0df741fbf5335fe69 Mon Sep 17 00:00:00 2001 From: dimitry Date: Thu, 23 May 2019 13:24:38 +0200 Subject: [PATCH] Apply native_bridge suffix to all cc_modules This fixes the problem with cc_object not having this suffix and as a result overriding non-bridged variants for modules using mk files. Bug: http://b/77159578 Test: build 4arch product Change-Id: Ie958f997c6f54f93d8b2987ca5ba605004e1eb70 --- android/androidmk.go | 8 -------- cc/androidmk.go | 9 +++++++-- cc/cc.go | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/android/androidmk.go b/android/androidmk.go index 2bbd452b1..7d0aa3bdf 100644 --- a/android/androidmk.go +++ b/android/androidmk.go @@ -28,10 +28,6 @@ import ( "github.com/google/blueprint/bootstrap" ) -var ( - NativeBridgeSuffix = ".native_bridge" -) - func init() { RegisterSingletonType("androidmk", AndroidMkSingleton) } @@ -165,10 +161,6 @@ func (a *AndroidMkEntries) fillInEntries(config Config, bpPath string, mod bluep } } - if amod.Target().NativeBridge { - a.SubName += NativeBridgeSuffix - } - fmt.Fprintln(&a.header, "\ninclude $(CLEAR_VARS)") // Collect make variable assignment entries. diff --git a/cc/androidmk.go b/cc/androidmk.go index c7883e2fa..a02549d77 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -24,8 +24,9 @@ import ( ) var ( - vendorSuffix = ".vendor" - recoverySuffix = ".recovery" + nativeBridgeSuffix = ".native_bridge" + vendorSuffix = ".vendor" + recoverySuffix = ".recovery" ) type AndroidMkContext interface { @@ -105,6 +106,10 @@ func (c *Module) AndroidMk() android.AndroidMkData { } c.subAndroidMk(&ret, c.installer) + if c.Target().NativeBridge == android.NativeBridgeEnabled { + ret.SubName += nativeBridgeSuffix + } + if c.useVndk() && c.hasVendorVariant() { // .vendor suffix is added only when we will have two variants: core and vendor. // The suffix is not added for vendor-only module. diff --git a/cc/cc.go b/cc/cc.go index 786e4fd26..6c26b52a7 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1826,7 +1826,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps { } else if ccDep.inRecovery() && !ccDep.onlyInRecovery() { return libName + recoverySuffix } else if ccDep.Target().NativeBridge == android.NativeBridgeEnabled { - return libName + android.NativeBridgeSuffix + return libName + nativeBridgeSuffix } else { return libName }