Merge "LOCAL_REQUIRED_MODULES from apex has ":32" or ":64" suffix" am: d684e04247 am: 8cad077197

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1554988

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0ae1fe2d82965048cd1540770220630debcee87d
This commit is contained in:
Treehugger Robot
2021-01-21 16:00:11 +00:00
committed by Automerger Merge Worker
3 changed files with 16 additions and 3 deletions

View File

@@ -126,8 +126,18 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, mo
moduleName := a.fullModuleName(apexBundleName, &fi)
if !android.InList(moduleName, moduleNames) {
moduleNames = append(moduleNames, moduleName)
// This name will be added to LOCAL_REQUIRED_MODULES of the APEX. We need to be
// arch-specific otherwise we will end up installing both ABIs even when only
// either of the ABI is requested.
aName := moduleName
switch fi.multilib {
case "lib32":
aName = aName + ":32"
case "lib64":
aName = aName + ":64"
}
if !android.InList(aName, moduleNames) {
moduleNames = append(moduleNames, aName)
}
if linkToSystemLib {

View File

@@ -441,6 +441,8 @@ type apexFile struct {
transitiveDep bool
isJniLib bool
multilib string
// TODO(jiyong): remove this
module android.Module
}
@@ -460,6 +462,7 @@ func newApexFile(ctx android.BaseModuleContext, builtFile android.Path, androidM
ret.requiredModuleNames = module.RequiredModuleNames()
ret.targetRequiredModuleNames = module.TargetRequiredModuleNames()
ret.hostRequiredModuleNames = module.HostRequiredModuleNames()
ret.multilib = module.Target().Arch.ArchType.Multilib
}
return ret
}

View File

@@ -5680,7 +5680,7 @@ func TestSymlinksFromApexToSystemRequiredModuleNames(t *testing.T) {
ensureNotContains(t, androidMk, "LOCAL_MODULE := prebuilt_myotherlib.myapex\n")
ensureNotContains(t, androidMk, "LOCAL_MODULE := myotherlib.myapex\n")
// `myapex` should have `myotherlib` in its required line, not `prebuilt_myotherlib`
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES += mylib.myapex myotherlib apex_manifest.pb.myapex apex_pubkey.myapex\n")
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES += mylib.myapex:64 myotherlib:64 apex_manifest.pb.myapex apex_pubkey.myapex\n")
}
func TestApexWithJniLibs(t *testing.T) {