Support dexpreopt against the primary boot image.

Framework and other dex files are used without image.

Test: taimen-userdebug boots when built with
      DEXPREOPT_USE_ART_IMAGE=true
Test: Check logcat for checksum verification failures.
      (Build ART with extra logging in OatFileAssistant.)
Test: Check that bootclasspath-checksums from some prebuilt
      oat files (say input.odex) contain only one image
      checksum followed by dex file checksums with
          grep -az -A1 -E '^bootclasspath-checksums$' <oat-file> | \
          xargs -0 echo | gawk '{print $2}'
Bug: 119800099
Change-Id: I65c2f247656e41f2c37df1ecb9e06af7dabab76e
This commit is contained in:
Vladimir Marko
2020-02-06 15:14:29 +00:00
parent 9acd7c3d36
commit 40139d6422
2 changed files with 14 additions and 2 deletions

View File

@@ -106,8 +106,18 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
global := dexpreoptGlobalConfig(ctx)
bootImage := defaultBootImageConfig(ctx)
dexFiles := bootImage.dexPathsDeps.Paths()
dexLocations := bootImage.dexLocationsDeps
if global.UseArtImage {
bootImage = artBootImageConfig(ctx)
}
if global.UseApexImage {
bootImage = frameworkJZBootImageConfig(ctx)
dexFiles = bootImage.dexPathsDeps.Paths()
dexLocations = bootImage.dexLocationsDeps
if global.UseArtImage {
bootImage = artJZBootImageConfig(ctx)
}
}
var archs []android.ArchType
@@ -178,8 +188,8 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
DexPreoptImagesDeps: imagesDeps,
DexPreoptImageLocations: bootImage.imageLocations,
PreoptBootClassPathDexFiles: bootImage.dexPathsDeps.Paths(),
PreoptBootClassPathDexLocations: bootImage.dexLocationsDeps,
PreoptBootClassPathDexFiles: dexFiles,
PreoptBootClassPathDexLocations: dexLocations,
PreoptExtractedApk: false,