Snap for 7529132 from d0687fd6a4 to sc-d2-release

Change-Id: I81520e3b8b9a32ac70eb0e83607fe81d33aa9feb
This commit is contained in:
Android Build Coastguard Worker 2021-07-08 01:01:53 +00:00
commit aeee7b5e2c
8 changed files with 56 additions and 51 deletions

View File

@ -1543,20 +1543,20 @@ type archConfig struct {
// getNdkAbisConfig returns a list of archConfigs for the ABIs supported by the NDK. // getNdkAbisConfig returns a list of archConfigs for the ABIs supported by the NDK.
func getNdkAbisConfig() []archConfig { func getNdkAbisConfig() []archConfig {
return []archConfig{ return []archConfig{
{"arm64", "armv8-a-branchprot", "", []string{"arm64-v8a"}},
{"arm", "armv7-a", "", []string{"armeabi-v7a"}}, {"arm", "armv7-a", "", []string{"armeabi-v7a"}},
{"x86_64", "", "", []string{"x86_64"}}, {"arm64", "armv8-a-branchprot", "", []string{"arm64-v8a"}},
{"x86", "", "", []string{"x86"}}, {"x86", "", "", []string{"x86"}},
{"x86_64", "", "", []string{"x86_64"}},
} }
} }
// getAmlAbisConfig returns a list of archConfigs for the ABIs supported by mainline modules. // getAmlAbisConfig returns a list of archConfigs for the ABIs supported by mainline modules.
func getAmlAbisConfig() []archConfig { func getAmlAbisConfig() []archConfig {
return []archConfig{ return []archConfig{
{"arm64", "armv8-a", "", []string{"arm64-v8a"}},
{"arm", "armv7-a-neon", "", []string{"armeabi-v7a"}}, {"arm", "armv7-a-neon", "", []string{"armeabi-v7a"}},
{"x86_64", "", "", []string{"x86_64"}}, {"arm64", "armv8-a", "", []string{"arm64-v8a"}},
{"x86", "", "", []string{"x86"}}, {"x86", "", "", []string{"x86"}},
{"x86_64", "", "", []string{"x86_64"}},
} }
} }

View File

@ -55,7 +55,6 @@ func init() {
AddNeverAllowRules(createCcSdkVariantRules()...) AddNeverAllowRules(createCcSdkVariantRules()...)
AddNeverAllowRules(createUncompressDexRules()...) AddNeverAllowRules(createUncompressDexRules()...)
AddNeverAllowRules(createMakefileGoalRules()...) AddNeverAllowRules(createMakefileGoalRules()...)
AddNeverAllowRules(createInitFirstStageRules()...)
} }
// Add a NeverAllow rule to the set of rules to apply. // Add a NeverAllow rule to the set of rules to apply.
@ -217,15 +216,6 @@ func createMakefileGoalRules() []Rule {
} }
} }
func createInitFirstStageRules() []Rule {
return []Rule{
NeverAllow().
Without("name", "init_first_stage").
With("install_in_root", "true").
Because("install_in_root is only for init_first_stage."),
}
}
func neverallowMutator(ctx BottomUpMutatorContext) { func neverallowMutator(ctx BottomUpMutatorContext) {
m, ok := ctx.Module().(Module) m, ok := ctx.Module().(Module)
if !ok { if !ok {

View File

@ -580,7 +580,6 @@ type installer interface {
hostToolPath() android.OptionalPath hostToolPath() android.OptionalPath
relativeInstallPath() string relativeInstallPath() string
makeUninstallable(mod *Module) makeUninstallable(mod *Module)
installInRoot() bool
} }
// bazelHandler is the interface for a helper object related to deferring to Bazel for // bazelHandler is the interface for a helper object related to deferring to Bazel for
@ -1307,10 +1306,6 @@ func (c *Module) isCfiAssemblySupportEnabled() bool {
Bool(c.sanitize.Properties.Sanitize.Config.Cfi_assembly_support) Bool(c.sanitize.Properties.Sanitize.Config.Cfi_assembly_support)
} }
func (c *Module) InstallInRoot() bool {
return c.installer != nil && c.installer.installInRoot()
}
type baseModuleContext struct { type baseModuleContext struct {
android.BaseModuleContext android.BaseModuleContext
moduleContextImpl moduleContextImpl

View File

@ -25,10 +25,6 @@ import (
type InstallerProperties struct { type InstallerProperties struct {
// install to a subdirectory of the default install path for the module // install to a subdirectory of the default install path for the module
Relative_install_path *string `android:"arch_variant"` Relative_install_path *string `android:"arch_variant"`
// Install output directly in {partition}/, not in any subdir. This is only intended for use by
// init_first_stage.
Install_in_root *bool `android:"arch_variant"`
} }
type installLocation int type installLocation int
@ -70,11 +66,6 @@ func (installer *baseInstaller) installDir(ctx ModuleContext) android.InstallPat
if ctx.toolchain().Is64Bit() && installer.dir64 != "" { if ctx.toolchain().Is64Bit() && installer.dir64 != "" {
dir = installer.dir64 dir = installer.dir64
} }
if installer.installInRoot() {
dir = ""
}
if ctx.Target().NativeBridge == android.NativeBridgeEnabled { if ctx.Target().NativeBridge == android.NativeBridgeEnabled {
dir = filepath.Join(dir, ctx.Target().NativeBridgeRelativePath) dir = filepath.Join(dir, ctx.Target().NativeBridgeRelativePath)
} else if !ctx.Host() && ctx.Config().HasMultilibConflict(ctx.Arch().ArchType) { } else if !ctx.Host() && ctx.Config().HasMultilibConflict(ctx.Arch().ArchType) {
@ -119,7 +110,3 @@ func (installer *baseInstaller) relativeInstallPath() string {
func (installer *baseInstaller) makeUninstallable(mod *Module) { func (installer *baseInstaller) makeUninstallable(mod *Module) {
mod.ModuleBase.MakeUninstallable() mod.ModuleBase.MakeUninstallable()
} }
func (installer *baseInstaller) installInRoot() bool {
return Bool(installer.Properties.Install_in_root)
}

View File

@ -651,10 +651,6 @@ func (b *BootclasspathFragmentModule) produceBootImageFiles(ctx android.ModuleCo
return nil return nil
} }
// Force the GlobalSoongConfig to be created and cached for use by the dex_bootjars
// GenerateSingletonBuildActions method as it cannot create it for itself.
dexpreopt.GetGlobalSoongConfig(ctx)
// Only generate the boot image if the configuration does not skip it. // Only generate the boot image if the configuration does not skip it.
return b.generateBootImageBuildActions(ctx, imageConfig) return b.generateBootImageBuildActions(ctx, imageConfig)
} }
@ -683,7 +679,16 @@ func (b *BootclasspathFragmentModule) generateBootImageBuildActions(ctx android.
// Build a profile for the image config and then use that to build the boot image. // Build a profile for the image config and then use that to build the boot image.
profile := bootImageProfileRule(ctx, imageConfig) profile := bootImageProfileRule(ctx, imageConfig)
return buildBootImage(ctx, imageConfig, profile)
// Build boot image files for the host variants.
buildBootImageVariantsForBuildOs(ctx, imageConfig, profile)
// Build boot image files for the android variants.
androidBootImageFilesByArch := buildBootImageVariantsForAndroidOs(ctx, imageConfig, profile)
// Return the boot image files for the android variants for inclusion in an APEX and to be zipped
// up for the dist.
return androidBootImageFilesByArch
} }
type bootclasspathFragmentMemberType struct { type bootclasspathFragmentMemberType struct {
@ -939,6 +944,12 @@ func (module *prebuiltBootclasspathFragmentModule) produceBootImageFiles(ctx and
} }
} }
// Build the boot image files for the host variants. These are built from the dex files provided
// by the contents of this module as prebuilt versions of the host boot image files are not
// available, i.e. there is no host specific prebuilt apex containing them. This has to be built
// without a profile as the prebuilt modules do not provide a profile.
buildBootImageVariantsForBuildOs(ctx, imageConfig, nil)
return files return files
} }

View File

@ -502,14 +502,36 @@ func copyBootJarsToPredefinedLocations(ctx android.ModuleContext, srcBootDexJars
} }
} }
// buildBootImage takes a bootImageConfig, and creates rules to build it. // buildBootImageVariantsForAndroidOs generates rules to build the boot image variants for the
// android.Android OsType and returns a map from the architectures to the paths of the generated
// boot image files.
//
// The paths are returned because they are needed elsewhere in Soong, e.g. for populating an APEX.
func buildBootImageVariantsForAndroidOs(ctx android.ModuleContext, image *bootImageConfig, profile android.WritablePath) bootImageFilesByArch {
return buildBootImageForOsType(ctx, image, profile, android.Android)
}
// buildBootImageVariantsForBuildOs generates rules to build the boot image variants for the
// android.BuildOs OsType, i.e. the type of OS on which the build is being running.
//
// The files need to be generated into their predefined location because they are used from there
// both within Soong and outside, e.g. for ART based host side testing and also for use by some
// cloud based tools. However, they are not needed by callers of this function and so the paths do
// not need to be returned from this func, unlike the buildBootImageVariantsForAndroidOs func.
func buildBootImageVariantsForBuildOs(ctx android.ModuleContext, image *bootImageConfig, profile android.WritablePath) {
buildBootImageForOsType(ctx, image, profile, android.BuildOs)
}
// buildBootImageForOsType takes a bootImageConfig, a profile file and an android.OsType
// boot image files are required for and it creates rules to build the boot image
// files for all the required architectures for them.
// //
// It returns a map from android.ArchType to the predefined paths of the boot image files. // It returns a map from android.ArchType to the predefined paths of the boot image files.
func buildBootImage(ctx android.ModuleContext, image *bootImageConfig, profile android.WritablePath) bootImageFilesByArch { func buildBootImageForOsType(ctx android.ModuleContext, image *bootImageConfig, profile android.WritablePath, requiredOsType android.OsType) bootImageFilesByArch {
filesByArch := bootImageFilesByArch{} filesByArch := bootImageFilesByArch{}
for _, variant := range image.variants { for _, variant := range image.variants {
buildBootImageVariant(ctx, variant, profile) if variant.target.Os == requiredOsType {
if variant.target.Os == android.Android { buildBootImageVariant(ctx, variant, profile)
filesByArch[variant.target.Arch.ArchType] = variant.imagesDeps.Paths() filesByArch[variant.target.Arch.ArchType] = variant.imagesDeps.Paths()
} }
} }
@ -545,7 +567,7 @@ func buildBootImageZipInPredefinedLocation(ctx android.ModuleContext, image *boo
// Generate boot image build rules for a specific target. // Generate boot image build rules for a specific target.
func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, profile android.Path) { func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, profile android.Path) {
globalSoong := dexpreopt.GetCachedGlobalSoongConfig(ctx) globalSoong := dexpreopt.GetGlobalSoongConfig(ctx)
global := dexpreopt.GetGlobalConfig(ctx) global := dexpreopt.GetGlobalConfig(ctx)
arch := image.target.Arch.ArchType arch := image.target.Arch.ArchType
@ -696,7 +718,7 @@ It is likely that the boot classpath is inconsistent.
Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS="--runtime-arg -verbose:verifier" to see verification errors.` Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS="--runtime-arg -verbose:verifier" to see verification errors.`
func bootImageProfileRule(ctx android.ModuleContext, image *bootImageConfig) android.WritablePath { func bootImageProfileRule(ctx android.ModuleContext, image *bootImageConfig) android.WritablePath {
globalSoong := dexpreopt.GetCachedGlobalSoongConfig(ctx) globalSoong := dexpreopt.GetGlobalSoongConfig(ctx)
global := dexpreopt.GetGlobalConfig(ctx) global := dexpreopt.GetGlobalConfig(ctx)
if global.DisableGenerateProfile { if global.DisableGenerateProfile {

View File

@ -421,10 +421,15 @@ func (b *platformBootclasspathModule) generateBootImageBuildActions(ctx android.
// Build a profile for the image config and then use that to build the boot image. // Build a profile for the image config and then use that to build the boot image.
profile := bootImageProfileRule(ctx, imageConfig) profile := bootImageProfileRule(ctx, imageConfig)
bootImageFilesByArch := buildBootImage(ctx, imageConfig, profile)
// Zip the boot image files up. // Build boot image files for the android variants.
buildBootImageZipInPredefinedLocation(ctx, imageConfig, bootImageFilesByArch) androidBootImageFilesByArch := buildBootImageVariantsForAndroidOs(ctx, imageConfig, profile)
// Zip the android variant boot image files up.
buildBootImageZipInPredefinedLocation(ctx, imageConfig, androidBootImageFilesByArch)
// Build boot image files for the host variants. There are use directly by ART host side tests.
buildBootImageVariantsForBuildOs(ctx, imageConfig, profile)
dumpOatRules(ctx, imageConfig) dumpOatRules(ctx, imageConfig)
} }

View File

@ -145,9 +145,6 @@ type syspropLibraryProperties struct {
// If set to true, allow this module to be dexed and installed on devices. // If set to true, allow this module to be dexed and installed on devices.
Installable *bool Installable *bool
// Make this module available when building for ramdisk
Ramdisk_available *bool
// Make this module available when building for recovery // Make this module available when building for recovery
Recovery_available *bool Recovery_available *bool
@ -399,7 +396,6 @@ type ccLibraryProperties struct {
Recovery_available *bool Recovery_available *bool
Vendor_available *bool Vendor_available *bool
Product_available *bool Product_available *bool
Ramdisk_available *bool
Host_supported *bool Host_supported *bool
Apex_available []string Apex_available []string
Min_sdk_version *string Min_sdk_version *string
@ -479,7 +475,6 @@ func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
ccProps.Recovery_available = m.properties.Recovery_available ccProps.Recovery_available = m.properties.Recovery_available
ccProps.Vendor_available = m.properties.Vendor_available ccProps.Vendor_available = m.properties.Vendor_available
ccProps.Product_available = m.properties.Product_available ccProps.Product_available = m.properties.Product_available
ccProps.Ramdisk_available = m.properties.Ramdisk_available
ccProps.Host_supported = m.properties.Host_supported ccProps.Host_supported = m.properties.Host_supported
ccProps.Apex_available = m.ApexProperties.Apex_available ccProps.Apex_available = m.ApexProperties.Apex_available
ccProps.Min_sdk_version = m.properties.Cpp.Min_sdk_version ccProps.Min_sdk_version = m.properties.Cpp.Min_sdk_version