Merge changes from topic "init_first_stage_soong" into sc-dev
* changes: Fix ndk and aml arch order Add ramdisk_available to sysprop_library Add install_in_root to cc_binary
This commit is contained in:
@@ -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{
|
||||||
{"arm", "armv7-a", "", []string{"armeabi-v7a"}},
|
|
||||||
{"arm64", "armv8-a-branchprot", "", []string{"arm64-v8a"}},
|
{"arm64", "armv8-a-branchprot", "", []string{"arm64-v8a"}},
|
||||||
{"x86", "", "", []string{"x86"}},
|
{"arm", "armv7-a", "", []string{"armeabi-v7a"}},
|
||||||
{"x86_64", "", "", []string{"x86_64"}},
|
{"x86_64", "", "", []string{"x86_64"}},
|
||||||
|
{"x86", "", "", []string{"x86"}},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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{
|
||||||
{"arm", "armv7-a-neon", "", []string{"armeabi-v7a"}},
|
|
||||||
{"arm64", "armv8-a", "", []string{"arm64-v8a"}},
|
{"arm64", "armv8-a", "", []string{"arm64-v8a"}},
|
||||||
{"x86", "", "", []string{"x86"}},
|
{"arm", "armv7-a-neon", "", []string{"armeabi-v7a"}},
|
||||||
{"x86_64", "", "", []string{"x86_64"}},
|
{"x86_64", "", "", []string{"x86_64"}},
|
||||||
|
{"x86", "", "", []string{"x86"}},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -55,6 +55,7 @@ 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.
|
||||||
@@ -216,6 +217,15 @@ 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 {
|
||||||
|
5
cc/cc.go
5
cc/cc.go
@@ -580,6 +580,7 @@ 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
|
||||||
@@ -1306,6 +1307,10 @@ 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
|
||||||
|
@@ -25,6 +25,10 @@ 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
|
||||||
@@ -66,6 +70,11 @@ 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) {
|
||||||
@@ -110,3 +119,7 @@ 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)
|
||||||
|
}
|
||||||
|
@@ -145,6 +145,9 @@ 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
|
||||||
|
|
||||||
@@ -396,6 +399,7 @@ 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
|
||||||
@@ -475,6 +479,7 @@ 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
|
||||||
|
Reference in New Issue
Block a user