Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 1 | // Copyright 2019 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package java |
| 16 | |
| 17 | import ( |
| 18 | "path/filepath" |
Colin Cross | c9a4c36 | 2019-02-26 21:13:48 -0800 | [diff] [blame] | 19 | "sort" |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 20 | "strings" |
| 21 | |
| 22 | "android/soong/android" |
| 23 | "android/soong/dexpreopt" |
| 24 | |
| 25 | "github.com/google/blueprint/pathtools" |
| 26 | "github.com/google/blueprint/proptools" |
| 27 | ) |
| 28 | |
| 29 | func init() { |
| 30 | android.RegisterSingletonType("dex_bootjars", dexpreoptBootJarsFactory) |
| 31 | } |
| 32 | |
| 33 | // The image "location" is a symbolic path that with multiarchitecture |
| 34 | // support doesn't really exist on the device. Typically it is |
| 35 | // /system/framework/boot.art and should be the same for all supported |
| 36 | // architectures on the device. The concrete architecture specific |
| 37 | // content actually ends up in a "filename" that contains an |
| 38 | // architecture specific directory name such as arm, arm64, mips, |
| 39 | // mips64, x86, x86_64. |
| 40 | // |
| 41 | // Here are some example values for an x86_64 / x86 configuration: |
| 42 | // |
| 43 | // bootImages["x86_64"] = "out/soong/generic_x86_64/dex_bootjars/system/framework/x86_64/boot.art" |
| 44 | // dexpreopt.PathToLocation(bootImages["x86_64"], "x86_64") = "out/soong/generic_x86_64/dex_bootjars/system/framework/boot.art" |
| 45 | // |
| 46 | // bootImages["x86"] = "out/soong/generic_x86_64/dex_bootjars/system/framework/x86/boot.art" |
| 47 | // dexpreopt.PathToLocation(bootImages["x86"])= "out/soong/generic_x86_64/dex_bootjars/system/framework/boot.art" |
| 48 | // |
| 49 | // The location is passed as an argument to the ART tools like dex2oat instead of the real path. The ART tools |
| 50 | // will then reconstruct the real path, so the rules must have a dependency on the real path. |
| 51 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 52 | type bootImageConfig struct { |
| 53 | name string |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 54 | stem string |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 55 | modules []string |
| 56 | dexLocations []string |
| 57 | dexPaths android.WritablePaths |
| 58 | dir android.OutputPath |
| 59 | symbolsDir android.OutputPath |
Colin Cross | c11e0c5 | 2019-05-08 15:18:22 -0700 | [diff] [blame] | 60 | targets []android.Target |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 61 | images map[android.ArchType]android.OutputPath |
Dan Willemsen | 0f41678 | 2019-06-13 21:44:53 +0000 | [diff] [blame] | 62 | imagesDeps map[android.ArchType]android.Paths |
Colin Cross | df8eebe | 2019-04-09 15:29:41 -0700 | [diff] [blame] | 63 | zip android.WritablePath |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 64 | } |
| 65 | |
Dan Willemsen | 0f41678 | 2019-06-13 21:44:53 +0000 | [diff] [blame] | 66 | func (image bootImageConfig) moduleFiles(ctx android.PathContext, dir android.OutputPath, exts ...string) []android.OutputPath { |
| 67 | ret := make([]android.OutputPath, 0, len(image.modules)*len(exts)) |
| 68 | |
| 69 | // dex preopt on the bootclasspath produces multiple files. The first dex file |
| 70 | // is converted into to 'name'.art (to match the legacy assumption that 'name'.art |
| 71 | // exists), and the rest are converted to 'name'-<jar>.art. |
| 72 | // In addition, each .art file has an associated .oat and .vdex file, and an |
| 73 | // unstripped .oat file |
| 74 | for i, m := range image.modules { |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 75 | name := image.stem |
Dan Willemsen | 0f41678 | 2019-06-13 21:44:53 +0000 | [diff] [blame] | 76 | if i != 0 { |
Jiyong Park | 0b23875 | 2019-10-29 11:23:10 +0900 | [diff] [blame] | 77 | name += "-" + stemOf(m) |
Dan Willemsen | 0f41678 | 2019-06-13 21:44:53 +0000 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | for _, ext := range exts { |
| 81 | ret = append(ret, dir.Join(ctx, name+ext)) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | return ret |
| 86 | } |
| 87 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 88 | type bootImage struct { |
| 89 | bootImageConfig |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 90 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 91 | installs map[android.ArchType]android.RuleBuilderInstalls |
| 92 | vdexInstalls map[android.ArchType]android.RuleBuilderInstalls |
| 93 | unstrippedInstalls map[android.ArchType]android.RuleBuilderInstalls |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 94 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 95 | profileInstalls android.RuleBuilderInstalls |
| 96 | } |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 97 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 98 | func newBootImage(ctx android.PathContext, config bootImageConfig) *bootImage { |
| 99 | image := &bootImage{ |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 100 | bootImageConfig: config, |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 101 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 102 | installs: make(map[android.ArchType]android.RuleBuilderInstalls), |
| 103 | vdexInstalls: make(map[android.ArchType]android.RuleBuilderInstalls), |
| 104 | unstrippedInstalls: make(map[android.ArchType]android.RuleBuilderInstalls), |
| 105 | } |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 106 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 107 | return image |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | func concat(lists ...[]string) []string { |
| 111 | var size int |
| 112 | for _, l := range lists { |
| 113 | size += len(l) |
| 114 | } |
| 115 | ret := make([]string, 0, size) |
| 116 | for _, l := range lists { |
| 117 | ret = append(ret, l...) |
| 118 | } |
| 119 | return ret |
| 120 | } |
| 121 | |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 122 | func dexpreoptBootJarsFactory() android.Singleton { |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 123 | return &dexpreoptBootJars{} |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | func skipDexpreoptBootJars(ctx android.PathContext) bool { |
Ulya Trafimovich | acb33e0 | 2019-11-01 17:57:29 +0000 | [diff] [blame] | 127 | if dexpreoptGlobalConfig(ctx).DisablePreopt { |
| 128 | return true |
| 129 | } |
| 130 | |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 131 | if ctx.Config().UnbundledBuild() { |
| 132 | return true |
| 133 | } |
| 134 | |
| 135 | if len(ctx.Config().Targets[android.Android]) == 0 { |
| 136 | // Host-only build |
| 137 | return true |
| 138 | } |
| 139 | |
| 140 | return false |
| 141 | } |
| 142 | |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 143 | func skipDexpreoptArtBootJars(ctx android.BuilderContext) bool { |
| 144 | // with EMMA_INSTRUMENT_FRAMEWORK=true ART boot class path libraries have dependencies on framework, |
| 145 | // therefore dexpreopt ART libraries cannot be dexpreopted in isolation => no ART boot image |
| 146 | return ctx.Config().IsEnvTrue("EMMA_INSTRUMENT_FRAMEWORK") |
| 147 | } |
| 148 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 149 | type dexpreoptBootJars struct { |
| 150 | defaultBootImage *bootImage |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 151 | otherImages []*bootImage |
Colin Cross | 2d00f0d | 2019-05-09 21:50:00 -0700 | [diff] [blame] | 152 | |
| 153 | dexpreoptConfigForMake android.WritablePath |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 154 | } |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 155 | |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 156 | // Accessor function for the apex package. Returns nil if dexpreopt is disabled. |
| 157 | func DexpreoptedArtApexJars(ctx android.BuilderContext) map[android.ArchType]android.Paths { |
| 158 | if skipDexpreoptBootJars(ctx) || skipDexpreoptArtBootJars(ctx) { |
| 159 | return nil |
| 160 | } |
| 161 | return artBootImageConfig(ctx).imagesDeps |
| 162 | } |
| 163 | |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 164 | // dexpreoptBoot singleton rules |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 165 | func (d *dexpreoptBootJars) GenerateBuildActions(ctx android.SingletonContext) { |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 166 | if skipDexpreoptBootJars(ctx) { |
| 167 | return |
| 168 | } |
| 169 | |
Colin Cross | 2d00f0d | 2019-05-09 21:50:00 -0700 | [diff] [blame] | 170 | d.dexpreoptConfigForMake = android.PathForOutput(ctx, ctx.Config().DeviceName(), "dexpreopt.config") |
| 171 | writeGlobalConfigForMake(ctx, d.dexpreoptConfigForMake) |
| 172 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 173 | global := dexpreoptGlobalConfig(ctx) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 174 | |
| 175 | // Skip recompiling the boot image for the second sanitization phase. We'll get separate paths |
| 176 | // and invalidate first-stage artifacts which are crucial to SANITIZE_LITE builds. |
| 177 | // Note: this is technically incorrect. Compiled code contains stack checks which may depend |
| 178 | // on ASAN settings. |
| 179 | if len(ctx.Config().SanitizeDevice()) == 1 && |
| 180 | ctx.Config().SanitizeDevice()[0] == "address" && |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 181 | global.SanitizeLite { |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 182 | return |
| 183 | } |
| 184 | |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 185 | // Always create the default boot image first, to get a unique profile rule for all images. |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 186 | d.defaultBootImage = buildBootImage(ctx, defaultBootImageConfig(ctx)) |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 187 | if !skipDexpreoptArtBootJars(ctx) { |
| 188 | // Create boot image for the ART apex (build artifacts are accessed via the global boot image config). |
| 189 | buildBootImage(ctx, artBootImageConfig(ctx)) |
| 190 | } |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 191 | if global.GenerateApexImage { |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 192 | // Create boot images for the JIT-zygote experiment. |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 193 | d.otherImages = append(d.otherImages, buildBootImage(ctx, apexBootImageConfig(ctx))) |
| 194 | } |
Colin Cross | c9a4c36 | 2019-02-26 21:13:48 -0800 | [diff] [blame] | 195 | |
| 196 | dumpOatRules(ctx, d.defaultBootImage) |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 197 | } |
| 198 | |
| 199 | // buildBootImage takes a bootImageConfig, creates rules to build it, and returns a *bootImage. |
| 200 | func buildBootImage(ctx android.SingletonContext, config bootImageConfig) *bootImage { |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 201 | image := newBootImage(ctx, config) |
| 202 | |
| 203 | bootDexJars := make(android.Paths, len(image.modules)) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 204 | |
| 205 | ctx.VisitAllModules(func(module android.Module) { |
| 206 | // Collect dex jar paths for the modules listed above. |
Colin Cross | 42be761 | 2019-02-21 18:12:14 -0800 | [diff] [blame] | 207 | if j, ok := module.(interface{ DexJar() android.Path }); ok { |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 208 | name := ctx.ModuleName(module) |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 209 | if i := android.IndexList(name, image.modules); i != -1 { |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 210 | bootDexJars[i] = j.DexJar() |
| 211 | } |
| 212 | } |
| 213 | }) |
| 214 | |
| 215 | var missingDeps []string |
| 216 | // Ensure all modules were converted to paths |
| 217 | for i := range bootDexJars { |
| 218 | if bootDexJars[i] == nil { |
| 219 | if ctx.Config().AllowMissingDependencies() { |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 220 | missingDeps = append(missingDeps, image.modules[i]) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 221 | bootDexJars[i] = android.PathForOutput(ctx, "missing") |
| 222 | } else { |
| 223 | ctx.Errorf("failed to find dex jar path for module %q", |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 224 | image.modules[i]) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 225 | } |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | // The path to bootclasspath dex files needs to be known at module GenerateAndroidBuildAction time, before |
| 230 | // the bootclasspath modules have been compiled. Copy the dex jars there so the module rules that have |
| 231 | // already been set up can find them. |
| 232 | for i := range bootDexJars { |
| 233 | ctx.Build(pctx, android.BuildParams{ |
| 234 | Rule: android.Cp, |
| 235 | Input: bootDexJars[i], |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 236 | Output: image.dexPaths[i], |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 237 | }) |
| 238 | } |
| 239 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 240 | profile := bootImageProfileRule(ctx, image, missingDeps) |
Nicolas Geoffray | e710242 | 2019-07-24 13:19:29 +0100 | [diff] [blame] | 241 | bootFrameworkProfileRule(ctx, image, missingDeps) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 242 | |
Colin Cross | df8eebe | 2019-04-09 15:29:41 -0700 | [diff] [blame] | 243 | var allFiles android.Paths |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 244 | for _, target := range image.targets { |
| 245 | files := buildBootImageRuleForArch(ctx, image, target.Arch.ArchType, profile, missingDeps) |
| 246 | allFiles = append(allFiles, files.Paths()...) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 247 | } |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 248 | |
Colin Cross | df8eebe | 2019-04-09 15:29:41 -0700 | [diff] [blame] | 249 | if image.zip != nil { |
| 250 | rule := android.NewRuleBuilder() |
| 251 | rule.Command(). |
Colin Cross | ee94d6a | 2019-07-08 17:08:34 -0700 | [diff] [blame] | 252 | BuiltTool(ctx, "soong_zip"). |
Colin Cross | df8eebe | 2019-04-09 15:29:41 -0700 | [diff] [blame] | 253 | FlagWithOutput("-o ", image.zip). |
| 254 | FlagWithArg("-C ", image.dir.String()). |
| 255 | FlagWithInputList("-f ", allFiles, " -f ") |
| 256 | |
| 257 | rule.Build(pctx, ctx, "zip_"+image.name, "zip "+image.name+" image") |
| 258 | } |
| 259 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 260 | return image |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 261 | } |
| 262 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 263 | func buildBootImageRuleForArch(ctx android.SingletonContext, image *bootImage, |
Colin Cross | df8eebe | 2019-04-09 15:29:41 -0700 | [diff] [blame] | 264 | arch android.ArchType, profile android.Path, missingDeps []string) android.WritablePaths { |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 265 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 266 | global := dexpreoptGlobalConfig(ctx) |
| 267 | |
| 268 | symbolsDir := image.symbolsDir.Join(ctx, "system/framework", arch.String()) |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 269 | symbolsFile := symbolsDir.Join(ctx, image.stem+".oat") |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 270 | outputDir := image.dir.Join(ctx, "system/framework", arch.String()) |
| 271 | outputPath := image.images[arch] |
Colin Cross | 69f59a3 | 2019-02-15 10:39:37 -0800 | [diff] [blame] | 272 | oatLocation := pathtools.ReplaceExtension(dexpreopt.PathToLocation(outputPath, arch), "oat") |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 273 | |
| 274 | rule := android.NewRuleBuilder() |
| 275 | rule.MissingDeps(missingDeps) |
| 276 | |
| 277 | rule.Command().Text("mkdir").Flag("-p").Flag(symbolsDir.String()) |
| 278 | rule.Command().Text("rm").Flag("-f"). |
| 279 | Flag(symbolsDir.Join(ctx, "*.art").String()). |
| 280 | Flag(symbolsDir.Join(ctx, "*.oat").String()). |
| 281 | Flag(symbolsDir.Join(ctx, "*.invocation").String()) |
| 282 | rule.Command().Text("rm").Flag("-f"). |
| 283 | Flag(outputDir.Join(ctx, "*.art").String()). |
| 284 | Flag(outputDir.Join(ctx, "*.oat").String()). |
| 285 | Flag(outputDir.Join(ctx, "*.invocation").String()) |
| 286 | |
| 287 | cmd := rule.Command() |
| 288 | |
| 289 | extraFlags := ctx.Config().Getenv("ART_BOOT_IMAGE_EXTRA_ARGS") |
| 290 | if extraFlags == "" { |
| 291 | // Use ANDROID_LOG_TAGS to suppress most logging by default... |
| 292 | cmd.Text(`ANDROID_LOG_TAGS="*:e"`) |
| 293 | } else { |
| 294 | // ...unless the boot image is generated specifically for testing, then allow all logging. |
| 295 | cmd.Text(`ANDROID_LOG_TAGS="*:v"`) |
| 296 | } |
| 297 | |
| 298 | invocationPath := outputPath.ReplaceExtension(ctx, "invocation") |
| 299 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 300 | cmd.Tool(global.Tools.Dex2oat). |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 301 | Flag("--avoid-storing-invocation"). |
Colin Cross | 69f59a3 | 2019-02-15 10:39:37 -0800 | [diff] [blame] | 302 | FlagWithOutput("--write-invocation-to=", invocationPath).ImplicitOutput(invocationPath). |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 303 | Flag("--runtime-arg").FlagWithArg("-Xms", global.Dex2oatImageXms). |
| 304 | Flag("--runtime-arg").FlagWithArg("-Xmx", global.Dex2oatImageXmx) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 305 | |
Colin Cross | 69f59a3 | 2019-02-15 10:39:37 -0800 | [diff] [blame] | 306 | if profile != nil { |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 307 | cmd.FlagWithArg("--compiler-filter=", "speed-profile") |
Colin Cross | 69f59a3 | 2019-02-15 10:39:37 -0800 | [diff] [blame] | 308 | cmd.FlagWithInput("--profile-file=", profile) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 309 | } |
| 310 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 311 | if global.DirtyImageObjects.Valid() { |
| 312 | cmd.FlagWithInput("--dirty-image-objects=", global.DirtyImageObjects.Path()) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | cmd. |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 316 | FlagForEachInput("--dex-file=", image.dexPaths.Paths()). |
| 317 | FlagForEachArg("--dex-location=", image.dexLocations). |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 318 | Flag("--generate-debug-info"). |
| 319 | Flag("--generate-build-id"). |
Mathieu Chartier | 54fd807 | 2019-07-26 13:50:04 -0700 | [diff] [blame] | 320 | Flag("--image-format=lz4hc"). |
Colin Cross | 69f59a3 | 2019-02-15 10:39:37 -0800 | [diff] [blame] | 321 | FlagWithOutput("--oat-symbols=", symbolsFile). |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 322 | Flag("--strip"). |
Colin Cross | 69f59a3 | 2019-02-15 10:39:37 -0800 | [diff] [blame] | 323 | FlagWithOutput("--oat-file=", outputPath.ReplaceExtension(ctx, "oat")). |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 324 | FlagWithArg("--oat-location=", oatLocation). |
Colin Cross | 69f59a3 | 2019-02-15 10:39:37 -0800 | [diff] [blame] | 325 | FlagWithOutput("--image=", outputPath). |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 326 | FlagWithArg("--base=", ctx.Config().LibartImgDeviceBaseAddress()). |
| 327 | FlagWithArg("--instruction-set=", arch.String()). |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 328 | FlagWithArg("--instruction-set-variant=", global.CpuVariant[arch]). |
| 329 | FlagWithArg("--instruction-set-features=", global.InstructionSetFeatures[arch]). |
| 330 | FlagWithArg("--android-root=", global.EmptyDirectory). |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 331 | FlagWithArg("--no-inline-from=", "core-oj.jar"). |
| 332 | Flag("--abort-on-hard-verifier-error") |
| 333 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 334 | if global.BootFlags != "" { |
| 335 | cmd.Flag(global.BootFlags) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | if extraFlags != "" { |
| 339 | cmd.Flag(extraFlags) |
| 340 | } |
| 341 | |
Colin Cross | 0b9f31f | 2019-02-28 11:00:01 -0800 | [diff] [blame] | 342 | cmd.Textf(`|| ( echo %s ; false )`, proptools.ShellEscape(failureMessage)) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 343 | |
| 344 | installDir := filepath.Join("/system/framework", arch.String()) |
| 345 | vdexInstallDir := filepath.Join("/system/framework") |
| 346 | |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 347 | var vdexInstalls android.RuleBuilderInstalls |
| 348 | var unstrippedInstalls android.RuleBuilderInstalls |
| 349 | |
Colin Cross | df8eebe | 2019-04-09 15:29:41 -0700 | [diff] [blame] | 350 | var zipFiles android.WritablePaths |
| 351 | |
Dan Willemsen | 0f41678 | 2019-06-13 21:44:53 +0000 | [diff] [blame] | 352 | for _, artOrOat := range image.moduleFiles(ctx, outputDir, ".art", ".oat") { |
| 353 | cmd.ImplicitOutput(artOrOat) |
| 354 | zipFiles = append(zipFiles, artOrOat) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 355 | |
Dan Willemsen | 0f41678 | 2019-06-13 21:44:53 +0000 | [diff] [blame] | 356 | // Install the .oat and .art files |
| 357 | rule.Install(artOrOat, filepath.Join(installDir, artOrOat.Base())) |
| 358 | } |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 359 | |
Dan Willemsen | 0f41678 | 2019-06-13 21:44:53 +0000 | [diff] [blame] | 360 | for _, vdex := range image.moduleFiles(ctx, outputDir, ".vdex") { |
| 361 | cmd.ImplicitOutput(vdex) |
| 362 | zipFiles = append(zipFiles, vdex) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 363 | |
| 364 | // The vdex files are identical between architectures, install them to a shared location. The Make rules will |
| 365 | // only use the install rules for one architecture, and will create symlinks into the architecture-specific |
| 366 | // directories. |
| 367 | vdexInstalls = append(vdexInstalls, |
Colin Cross | 69f59a3 | 2019-02-15 10:39:37 -0800 | [diff] [blame] | 368 | android.RuleBuilderInstall{vdex, filepath.Join(vdexInstallDir, vdex.Base())}) |
Dan Willemsen | 0f41678 | 2019-06-13 21:44:53 +0000 | [diff] [blame] | 369 | } |
| 370 | |
| 371 | for _, unstrippedOat := range image.moduleFiles(ctx, symbolsDir, ".oat") { |
| 372 | cmd.ImplicitOutput(unstrippedOat) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 373 | |
| 374 | // Install the unstripped oat files. The Make rules will put these in $(TARGET_OUT_UNSTRIPPED) |
| 375 | unstrippedInstalls = append(unstrippedInstalls, |
Colin Cross | 69f59a3 | 2019-02-15 10:39:37 -0800 | [diff] [blame] | 376 | android.RuleBuilderInstall{unstrippedOat, filepath.Join(installDir, unstrippedOat.Base())}) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 377 | } |
| 378 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 379 | rule.Build(pctx, ctx, image.name+"JarsDexpreopt_"+arch.String(), "dexpreopt "+image.name+" jars "+arch.String()) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 380 | |
| 381 | // save output and installed files for makevars |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 382 | image.installs[arch] = rule.Installs() |
| 383 | image.vdexInstalls[arch] = vdexInstalls |
| 384 | image.unstrippedInstalls[arch] = unstrippedInstalls |
Colin Cross | df8eebe | 2019-04-09 15:29:41 -0700 | [diff] [blame] | 385 | |
| 386 | return zipFiles |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | const failureMessage = `ERROR: Dex2oat failed to compile a boot image. |
| 390 | It is likely that the boot classpath is inconsistent. |
| 391 | Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS="--runtime-arg -verbose:verifier" to see verification errors.` |
| 392 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 393 | func bootImageProfileRule(ctx android.SingletonContext, image *bootImage, missingDeps []string) android.WritablePath { |
Nicolas Geoffray | 27c7cc6 | 2019-02-24 16:04:52 +0000 | [diff] [blame] | 394 | global := dexpreoptGlobalConfig(ctx) |
| 395 | |
Mathieu Chartier | 6adeee1 | 2019-06-26 10:01:36 -0700 | [diff] [blame] | 396 | if global.DisableGenerateProfile || ctx.Config().IsPdkBuild() || ctx.Config().UnbundledBuild() { |
Nicolas Geoffray | 27c7cc6 | 2019-02-24 16:04:52 +0000 | [diff] [blame] | 397 | return nil |
| 398 | } |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 399 | profile := ctx.Config().Once(bootImageProfileRuleKey, func() interface{} { |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 400 | tools := global.Tools |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 401 | defaultProfile := "frameworks/base/config/boot-image-profile.txt" |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 402 | |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 403 | rule := android.NewRuleBuilder() |
| 404 | rule.MissingDeps(missingDeps) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 405 | |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 406 | var bootImageProfile android.Path |
| 407 | if len(global.BootImageProfiles) > 1 { |
| 408 | combinedBootImageProfile := image.dir.Join(ctx, "boot-image-profile.txt") |
| 409 | rule.Command().Text("cat").Inputs(global.BootImageProfiles).Text(">").Output(combinedBootImageProfile) |
| 410 | bootImageProfile = combinedBootImageProfile |
| 411 | } else if len(global.BootImageProfiles) == 1 { |
| 412 | bootImageProfile = global.BootImageProfiles[0] |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 413 | } else if path := android.ExistentPathForSource(ctx, defaultProfile); path.Valid() { |
| 414 | bootImageProfile = path.Path() |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 415 | } else { |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 416 | // No profile (not even a default one, which is the case on some branches |
| 417 | // like master-art-host that don't have frameworks/base). |
| 418 | // Return nil and continue without profile. |
| 419 | return nil |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 420 | } |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 421 | |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 422 | profile := image.dir.Join(ctx, "boot.prof") |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 423 | |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 424 | rule.Command(). |
| 425 | Text(`ANDROID_LOG_TAGS="*:e"`). |
| 426 | Tool(tools.Profman). |
| 427 | FlagWithInput("--create-profile-from=", bootImageProfile). |
| 428 | FlagForEachInput("--apk=", image.dexPaths.Paths()). |
| 429 | FlagForEachArg("--dex-location=", image.dexLocations). |
| 430 | FlagWithOutput("--reference-profile-file=", profile) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 431 | |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 432 | rule.Install(profile, "/system/etc/boot-image.prof") |
| 433 | |
| 434 | rule.Build(pctx, ctx, "bootJarsProfile", "profile boot jars") |
| 435 | |
| 436 | image.profileInstalls = rule.Installs() |
| 437 | |
| 438 | return profile |
Ulyana Trafimovich | de53441 | 2019-11-08 10:51:01 +0000 | [diff] [blame^] | 439 | }) |
| 440 | if profile == nil { |
| 441 | return nil // wrap nil into a typed pointer with value nil |
| 442 | } |
| 443 | return profile.(android.WritablePath) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 444 | } |
| 445 | |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 446 | var bootImageProfileRuleKey = android.NewOnceKey("bootImageProfileRule") |
| 447 | |
Nicolas Geoffray | e710242 | 2019-07-24 13:19:29 +0100 | [diff] [blame] | 448 | func bootFrameworkProfileRule(ctx android.SingletonContext, image *bootImage, missingDeps []string) android.WritablePath { |
| 449 | global := dexpreoptGlobalConfig(ctx) |
| 450 | |
| 451 | if global.DisableGenerateProfile || ctx.Config().IsPdkBuild() || ctx.Config().UnbundledBuild() { |
| 452 | return nil |
| 453 | } |
| 454 | return ctx.Config().Once(bootFrameworkProfileRuleKey, func() interface{} { |
| 455 | tools := global.Tools |
| 456 | |
| 457 | rule := android.NewRuleBuilder() |
| 458 | rule.MissingDeps(missingDeps) |
| 459 | |
| 460 | // Some branches like master-art-host don't have frameworks/base, so manually |
| 461 | // handle the case that the default is missing. Those branches won't attempt to build the profile rule, |
| 462 | // and if they do they'll get a missing deps error. |
| 463 | defaultProfile := "frameworks/base/config/boot-profile.txt" |
| 464 | path := android.ExistentPathForSource(ctx, defaultProfile) |
| 465 | var bootFrameworkProfile android.Path |
| 466 | if path.Valid() { |
| 467 | bootFrameworkProfile = path.Path() |
| 468 | } else { |
| 469 | missingDeps = append(missingDeps, defaultProfile) |
| 470 | bootFrameworkProfile = android.PathForOutput(ctx, "missing") |
| 471 | } |
| 472 | |
| 473 | profile := image.dir.Join(ctx, "boot.bprof") |
| 474 | |
| 475 | rule.Command(). |
| 476 | Text(`ANDROID_LOG_TAGS="*:e"`). |
| 477 | Tool(tools.Profman). |
| 478 | Flag("--generate-boot-profile"). |
| 479 | FlagWithInput("--create-profile-from=", bootFrameworkProfile). |
| 480 | FlagForEachInput("--apk=", image.dexPaths.Paths()). |
| 481 | FlagForEachArg("--dex-location=", image.dexLocations). |
| 482 | FlagWithOutput("--reference-profile-file=", profile) |
| 483 | |
| 484 | rule.Install(profile, "/system/etc/boot-image.bprof") |
| 485 | rule.Build(pctx, ctx, "bootFrameworkProfile", "profile boot framework jars") |
| 486 | image.profileInstalls = append(image.profileInstalls, rule.Installs()...) |
| 487 | |
| 488 | return profile |
| 489 | }).(android.WritablePath) |
| 490 | } |
| 491 | |
| 492 | var bootFrameworkProfileRuleKey = android.NewOnceKey("bootFrameworkProfileRule") |
| 493 | |
Colin Cross | c9a4c36 | 2019-02-26 21:13:48 -0800 | [diff] [blame] | 494 | func dumpOatRules(ctx android.SingletonContext, image *bootImage) { |
| 495 | var archs []android.ArchType |
| 496 | for arch := range image.images { |
| 497 | archs = append(archs, arch) |
| 498 | } |
| 499 | sort.Slice(archs, func(i, j int) bool { return archs[i].String() < archs[j].String() }) |
| 500 | |
| 501 | var allPhonies android.Paths |
| 502 | for _, arch := range archs { |
| 503 | // Create a rule to call oatdump. |
| 504 | output := android.PathForOutput(ctx, "boot."+arch.String()+".oatdump.txt") |
| 505 | rule := android.NewRuleBuilder() |
| 506 | rule.Command(). |
| 507 | // TODO: for now, use the debug version for better error reporting |
Colin Cross | ee94d6a | 2019-07-08 17:08:34 -0700 | [diff] [blame] | 508 | BuiltTool(ctx, "oatdumpd"). |
Colin Cross | c9a4c36 | 2019-02-26 21:13:48 -0800 | [diff] [blame] | 509 | FlagWithInputList("--runtime-arg -Xbootclasspath:", image.dexPaths.Paths(), ":"). |
| 510 | FlagWithList("--runtime-arg -Xbootclasspath-locations:", image.dexLocations, ":"). |
| 511 | FlagWithArg("--image=", dexpreopt.PathToLocation(image.images[arch], arch)).Implicit(image.images[arch]). |
| 512 | FlagWithOutput("--output=", output). |
| 513 | FlagWithArg("--instruction-set=", arch.String()) |
| 514 | rule.Build(pctx, ctx, "dump-oat-boot-"+arch.String(), "dump oat boot "+arch.String()) |
| 515 | |
| 516 | // Create a phony rule that depends on the output file and prints the path. |
| 517 | phony := android.PathForPhony(ctx, "dump-oat-boot-"+arch.String()) |
| 518 | rule = android.NewRuleBuilder() |
| 519 | rule.Command(). |
| 520 | Implicit(output). |
| 521 | ImplicitOutput(phony). |
| 522 | Text("echo").FlagWithArg("Output in ", output.String()) |
| 523 | rule.Build(pctx, ctx, "phony-dump-oat-boot-"+arch.String(), "dump oat boot "+arch.String()) |
| 524 | |
| 525 | allPhonies = append(allPhonies, phony) |
| 526 | } |
| 527 | |
| 528 | phony := android.PathForPhony(ctx, "dump-oat-boot") |
| 529 | ctx.Build(pctx, android.BuildParams{ |
| 530 | Rule: android.Phony, |
| 531 | Output: phony, |
| 532 | Inputs: allPhonies, |
| 533 | Description: "dump-oat-boot", |
| 534 | }) |
| 535 | |
| 536 | } |
| 537 | |
Colin Cross | 2d00f0d | 2019-05-09 21:50:00 -0700 | [diff] [blame] | 538 | func writeGlobalConfigForMake(ctx android.SingletonContext, path android.WritablePath) { |
| 539 | data := dexpreoptGlobalConfigRaw(ctx).data |
| 540 | |
| 541 | ctx.Build(pctx, android.BuildParams{ |
| 542 | Rule: android.WriteFile, |
| 543 | Output: path, |
| 544 | Args: map[string]string{ |
| 545 | "content": string(data), |
| 546 | }, |
| 547 | }) |
| 548 | } |
| 549 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 550 | // Export paths for default boot image to Make |
| 551 | func (d *dexpreoptBootJars) MakeVars(ctx android.MakeVarsContext) { |
Colin Cross | 2d00f0d | 2019-05-09 21:50:00 -0700 | [diff] [blame] | 552 | if d.dexpreoptConfigForMake != nil { |
| 553 | ctx.Strict("DEX_PREOPT_CONFIG_FOR_MAKE", d.dexpreoptConfigForMake.String()) |
| 554 | } |
| 555 | |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 556 | image := d.defaultBootImage |
| 557 | if image != nil { |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 558 | ctx.Strict("DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED", image.profileInstalls.String()) |
Colin Cross | 44df581 | 2019-02-15 23:06:46 -0800 | [diff] [blame] | 559 | ctx.Strict("DEXPREOPT_BOOTCLASSPATH_DEX_FILES", strings.Join(image.dexPaths.Strings(), " ")) |
| 560 | ctx.Strict("DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS", strings.Join(image.dexLocations, " ")) |
Colin Cross | df8eebe | 2019-04-09 15:29:41 -0700 | [diff] [blame] | 561 | ctx.Strict("DEXPREOPT_IMAGE_ZIP_"+image.name, image.zip.String()) |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 562 | |
| 563 | var imageNames []string |
| 564 | for _, current := range append(d.otherImages, image) { |
| 565 | imageNames = append(imageNames, current.name) |
Colin Cross | 91268c6 | 2019-04-11 14:07:04 -0700 | [diff] [blame] | 566 | var arches []android.ArchType |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 567 | for arch, _ := range current.images { |
Colin Cross | 91268c6 | 2019-04-11 14:07:04 -0700 | [diff] [blame] | 568 | arches = append(arches, arch) |
| 569 | } |
| 570 | |
| 571 | sort.Slice(arches, func(i, j int) bool { return arches[i].String() < arches[j].String() }) |
| 572 | |
| 573 | for _, arch := range arches { |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 574 | ctx.Strict("DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_"+current.name+"_"+arch.String(), current.vdexInstalls[arch].String()) |
| 575 | ctx.Strict("DEXPREOPT_IMAGE_"+current.name+"_"+arch.String(), current.images[arch].String()) |
Dan Willemsen | 0f41678 | 2019-06-13 21:44:53 +0000 | [diff] [blame] | 576 | ctx.Strict("DEXPREOPT_IMAGE_DEPS_"+current.name+"_"+arch.String(), strings.Join(current.imagesDeps[arch].Strings(), " ")) |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 577 | ctx.Strict("DEXPREOPT_IMAGE_BUILT_INSTALLED_"+current.name+"_"+arch.String(), current.installs[arch].String()) |
| 578 | ctx.Strict("DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_"+current.name+"_"+arch.String(), current.unstrippedInstalls[arch].String()) |
Colin Cross | df8eebe | 2019-04-09 15:29:41 -0700 | [diff] [blame] | 579 | if current.zip != nil { |
| 580 | } |
Nicolas Geoffray | 72892f1 | 2019-02-22 15:34:40 +0000 | [diff] [blame] | 581 | } |
| 582 | } |
| 583 | ctx.Strict("DEXPREOPT_IMAGE_NAMES", strings.Join(imageNames, " ")) |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 584 | } |
Colin Cross | 800fe13 | 2019-02-11 14:21:24 -0800 | [diff] [blame] | 585 | } |