Don't package host cross modules in javaFuzzPackager

Normally the host cross OS is windows, which only builds a few opted-in
modules.  When the host cross OS is set to linux_musl it builds all
modules that haven't explicitly opted out, producing linux_musl_common
variants of java modules.  Filter these out of javaFuzzPackager to
avoid conflicts with the linux_glibc_common modules.

Host cross common variants targets were missing the HostCross flag,
so also set it in getCommonTargets.

Bug: 236052820
Test: builds with linux_musl arm64 host cross enabled
Change-Id: I58c846076091bee7df50016c240a176c039c42e9
This commit is contained in:
Colin Cross
2022-06-24 18:43:40 -07:00
parent 1faf82305a
commit 39a1814f24
2 changed files with 7 additions and 1 deletions

View File

@@ -1825,7 +1825,9 @@ func getCommonTargets(targets []Target) []Target {
for _, t := range targets {
if _, found := set[t.Os.String()]; !found {
set[t.Os.String()] = true
ret = append(ret, commonTargetMap[t.Os.String()])
common := commonTargetMap[t.Os.String()]
common.HostCross = t.HostCross
ret = append(ret, common)
}
}

View File

@@ -171,6 +171,10 @@ func (s *javaFuzzPackager) GenerateBuildActions(ctx android.SingletonContext) {
return
}
if javaFuzzModule.Target().HostCross {
return
}
fuzzModuleValidator := fuzz.FuzzModule{
javaFuzzModule.ModuleBase,
javaFuzzModule.DefaultableModuleBase,