summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-09-26 23:53:58 +0000
committer Spandan Das <spandandas@google.com> 2024-09-28 04:36:43 +0000
commit77e27d44efe2b5fd390aaaad00b289996175f3a0 (patch)
treeab8eea27677c53d5c5486fc69caf211fc0032352 /android/module.go
parent22ad6c00c7b5ef51687bcde6fcfe4e7988a16d2c (diff)
Find matching variant of `required` for `common_first`
Both 32-bit and 64-bit variants of native deps were getting installed in Soong-built system image if they were listed in `required` of `java_binary`. java_binary(s) have two variants, a "common" and an arch variant (the first arch). Previously the common variant will create a dependency to both 32-bit and 64-bit variants of their dependencies. With this CL, common variant will not create a dependency on required unless the requested `target` is also the common target. Test: Ran the filelistdiff tool Test: go test ./java -run TestNativeRequiredDepOfJavaBinary Bug: 369678122 Change-Id: Ica97e12eefb45929ca653ec57c3339e4a3b72a76
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/android/module.go b/android/module.go
index d6c129ac8..95e65bbed 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1005,6 +1005,14 @@ func addRequiredDeps(ctx BottomUpMutatorContext) {
return
}
+ // Do not create a dependency from common variant to arch variant for `common_first` modules
+ if multilib, _ := decodeMultilib(ctx, ctx.Module().base()); multilib == string(MultilibCommonFirst) {
+ commonVariant := ctx.Arch().ArchType.Multilib == ""
+ if bothInAndroid && commonVariant && InList(target.Arch.ArchType.Multilib, []string{"lib32", "lib64"}) {
+ return
+ }
+ }
+
variation := target.Variations()
if ctx.OtherModuleFarDependencyVariantExists(variation, depName) {
ctx.AddFarVariationDependencies(variation, RequiredDepTag, depName)