Pass --preloaded-classes to boot image compilation.
Test: m Bug: 162110941 Change-Id: I0df016c5d170ca101cd18cacc331499ae76677a6
This commit is contained in:
@@ -281,6 +281,9 @@ type bootImageConfig struct {
|
|||||||
|
|
||||||
// Target-dependent fields.
|
// Target-dependent fields.
|
||||||
variants []*bootImageVariant
|
variants []*bootImageVariant
|
||||||
|
|
||||||
|
// Path of the preloaded classes file.
|
||||||
|
preloadedClassesFile string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Target-dependent description of a boot image.
|
// Target-dependent description of a boot image.
|
||||||
@@ -680,6 +683,13 @@ func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, p
|
|||||||
cmd.FlagWithArg("--base=", ctx.Config().LibartImgDeviceBaseAddress())
|
cmd.FlagWithArg("--base=", ctx.Config().LibartImgDeviceBaseAddress())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We always expect a preloaded classes file to be available. However, if we cannot find it, it's
|
||||||
|
// OK to not pass the flag to dex2oat.
|
||||||
|
preloadedClassesPath := android.ExistentPathForSource(ctx, image.preloadedClassesFile)
|
||||||
|
if preloadedClassesPath.Valid() {
|
||||||
|
cmd.FlagWithInput("--preloaded-classes=", preloadedClassesPath.Path())
|
||||||
|
}
|
||||||
|
|
||||||
cmd.
|
cmd.
|
||||||
FlagForEachInput("--dex-file=", image.dexPaths.Paths()).
|
FlagForEachInput("--dex-file=", image.dexPaths.Paths()).
|
||||||
FlagForEachArg("--dex-location=", image.dexLocations).
|
FlagForEachArg("--dex-location=", image.dexLocations).
|
||||||
|
@@ -62,6 +62,7 @@ func genBootImageConfigRaw(ctx android.PathContext) map[string]*bootImageConfig
|
|||||||
installDirOnDevice: "system/framework",
|
installDirOnDevice: "system/framework",
|
||||||
profileInstallPathInApex: "etc/boot-image.prof",
|
profileInstallPathInApex: "etc/boot-image.prof",
|
||||||
modules: artModules,
|
modules: artModules,
|
||||||
|
preloadedClassesFile: "art/build/boot/preloaded-classes",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Framework config for the boot image extension.
|
// Framework config for the boot image extension.
|
||||||
@@ -74,6 +75,7 @@ func genBootImageConfigRaw(ctx android.PathContext) map[string]*bootImageConfig
|
|||||||
installDirOnHost: frameworkSubdir,
|
installDirOnHost: frameworkSubdir,
|
||||||
installDirOnDevice: frameworkSubdir,
|
installDirOnDevice: frameworkSubdir,
|
||||||
modules: frameworkModules,
|
modules: frameworkModules,
|
||||||
|
preloadedClassesFile: "frameworks/base/config/preloaded-classes",
|
||||||
}
|
}
|
||||||
|
|
||||||
return map[string]*bootImageConfig{
|
return map[string]*bootImageConfig{
|
||||||
|
Reference in New Issue
Block a user