Rollback to the legacy way of computing boot image locations.

This fixes JIT-zygote builds (b/146462581). The fix is a workaround:
boot image location is computed from boot image filename instead of
using the pre-computed location from the module dexpreopt config.

Currently parts of the dexpreopt module config use boot image name
that is hard-coded in Makefiles, and other parts use boot image name
that is generated by Soong. This is exacerbated by the fact that
"default" boot image config in JIT-zygote builds consists partly of
the "apex" boot image, and partly of "boot" boot image.

Test: walleye_jitzygote-userdebug builds.

Bug: 146462581
Change-Id: I9a91fc48e54d7d43abec2cb2b5a11e3581db380b
This commit is contained in:
Ulya Trafimovich 2019-12-19 22:17:08 +00:00
parent 18577fe8fb
commit 3380531d80
1 changed files with 9 additions and 1 deletions

View File

@ -222,6 +222,14 @@ 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
@ -349,7 +357,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=", strings.Join(module.DexPreoptImageLocations, ":")).Implicits(module.DexPreoptImagesDeps[archIdx].Paths()).
FlagWithArg("--boot-image=", bootImageLocation).Implicits(module.DexPreoptImagesDeps[archIdx].Paths()).
FlagWithInput("--dex-file=", module.DexPath).
FlagWithArg("--dex-location=", dexLocationArg).
FlagWithOutput("--oat-file=", odexPath).ImplicitOutput(vdexPath).