Merge "Respect JIT-zygote config when generating boot image location."

am: 99d522b5df

Change-Id: I7810e1734b8e49047077720c6a5ab5c9e53a92c0
This commit is contained in:
Ulyana Trafimovich
2020-01-07 03:01:06 -08:00
committed by android-build-merger
2 changed files with 8 additions and 17 deletions

View File

@@ -222,14 +222,6 @@ func dexpreoptCommand(ctx android.PathContext, global GlobalConfig, module Modul
invocationPath := odexPath.ReplaceExtension(ctx, "invocation")
// TODO(skvadrik): fix this to use boot image location in the module config (currently it is broken
// in JIT-zygote builds, because "default" boot image is hard-coded in parts of the module config).
bootImage := module.DexPreoptImages[archIdx]
var bootImageLocation string
if bootImage != nil {
bootImageLocation = PathToLocation(bootImage, arch)
}
// The class loader context using paths in the build
var classLoaderContextHost android.Paths
@@ -357,7 +349,7 @@ func dexpreoptCommand(ctx android.PathContext, global GlobalConfig, module Modul
Flag("--runtime-arg").FlagWithList("-Xbootclasspath-locations:", module.PreoptBootClassPathDexLocations, ":").
Flag("${class_loader_context_arg}").
Flag("${stored_class_loader_context_arg}").
FlagWithArg("--boot-image=", bootImageLocation).Implicits(module.DexPreoptImagesDeps[archIdx].Paths()).
FlagWithArg("--boot-image=", strings.Join(module.DexPreoptImageLocations, ":")).Implicits(module.DexPreoptImagesDeps[archIdx].Paths()).
FlagWithInput("--dex-file=", module.DexPath).
FlagWithArg("--dex-location=", dexLocationArg).
FlagWithOutput("--oat-file=", odexPath).ImplicitOutput(vdexPath).

View File

@@ -605,7 +605,6 @@ func (d *dexpreoptBootJars) MakeVars(ctx android.MakeVarsContext) {
ctx.Strict("DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED", image.profileInstalls.String())
ctx.Strict("DEXPREOPT_BOOTCLASSPATH_DEX_FILES", strings.Join(image.dexPathsDeps.Strings(), " "))
ctx.Strict("DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS", strings.Join(image.dexLocationsDeps, " "))
ctx.Strict("DEXPREOPT_IMAGE_LOCATIONS", strings.Join(image.imageLocations, ":"))
var imageNames []string
for _, current := range append(d.otherImages, image) {
@@ -618,15 +617,15 @@ func (d *dexpreoptBootJars) MakeVars(ctx android.MakeVarsContext) {
sort.Slice(arches, func(i, j int) bool { return arches[i].String() < arches[j].String() })
for _, arch := range arches {
ctx.Strict("DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_"+current.name+"_"+arch.String(), current.vdexInstalls[arch].String())
ctx.Strict("DEXPREOPT_IMAGE_"+current.name+"_"+arch.String(), current.images[arch].String())
ctx.Strict("DEXPREOPT_IMAGE_DEPS_"+current.name+"_"+arch.String(), strings.Join(current.imagesDeps[arch].Strings(), " "))
ctx.Strict("DEXPREOPT_IMAGE_BUILT_INSTALLED_"+current.name+"_"+arch.String(), current.installs[arch].String())
ctx.Strict("DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_"+current.name+"_"+arch.String(), current.unstrippedInstalls[arch].String())
if current.zip != nil {
}
sfx := current.name + "_" + arch.String()
ctx.Strict("DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_"+sfx, current.vdexInstalls[arch].String())
ctx.Strict("DEXPREOPT_IMAGE_"+sfx, current.images[arch].String())
ctx.Strict("DEXPREOPT_IMAGE_DEPS_"+sfx, strings.Join(current.imagesDeps[arch].Strings(), " "))
ctx.Strict("DEXPREOPT_IMAGE_BUILT_INSTALLED_"+sfx, current.installs[arch].String())
ctx.Strict("DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_"+sfx, current.unstrippedInstalls[arch].String())
}
ctx.Strict("DEXPREOPT_IMAGE_LOCATIONS_"+current.name, strings.Join(current.imageLocations, ":"))
ctx.Strict("DEXPREOPT_IMAGE_ZIP_"+current.name, current.zip.String())
}
ctx.Strict("DEXPREOPT_IMAGE_NAMES", strings.Join(imageNames, " "))