Merge "Add libdmabufheap to the list of allowed dependencies"
diff --git a/android/androidmk.go b/android/androidmk.go
index ddd51ff..cfd7c91 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -72,6 +72,7 @@
type AndroidMkEntries struct {
Class string
SubName string
+ OverrideName string
DistFiles TaggedDistFiles
OutputFile OptionalPath
Disabled bool
@@ -273,6 +274,9 @@
a.EntryMap = make(map[string][]string)
amod := mod.(Module).base()
name := amod.BaseModuleName()
+ if a.OverrideName != "" {
+ name = a.OverrideName
+ }
if a.Include == "" {
a.Include = "$(BUILD_PREBUILT)"
diff --git a/android/arch.go b/android/arch.go
index 616cead..98ff07a 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -914,8 +914,8 @@
osTargets = targets
}
- // only the primary arch in the ramdisk / recovery partition
- if os == Android && (module.InstallInRecovery() || module.InstallInRamdisk()) {
+ // only the primary arch in the ramdisk / vendor_ramdisk / recovery partition
+ if os == Android && (module.InstallInRecovery() || module.InstallInRamdisk() || module.InstallInVendorRamdisk()) {
osTargets = []Target{osTargets[0]}
}
diff --git a/android/config.go b/android/config.go
index cf6d596..004b743 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1312,6 +1312,10 @@
return c.config.productVariables.BoardKernelModuleInterfaceVersions
}
+func (c *deviceConfig) BoardMoveRecoveryResourcesToVendorBoot() bool {
+ return Bool(c.config.productVariables.BoardMoveRecoveryResourcesToVendorBoot)
+}
+
// The ConfiguredJarList struct provides methods for handling a list of (apex, jar) pairs.
// Such lists are used in the build system for things like bootclasspath jars or system server jars.
// The apex part is either an apex name, or a special names "platform" or "system_ext". Jar is a
diff --git a/android/image.go b/android/image.go
index 061bfa5..1a1a423 100644
--- a/android/image.go
+++ b/android/image.go
@@ -26,6 +26,10 @@
// ramdisk partition).
RamdiskVariantNeeded(ctx BaseModuleContext) bool
+ // VendorRamdiskVariantNeeded should return true if the module needs a vendor ramdisk variant (installed on the
+ // vendor ramdisk partition).
+ VendorRamdiskVariantNeeded(ctx BaseModuleContext) bool
+
// RecoveryVariantNeeded should return true if the module needs a recovery variant (installed on the
// recovery partition).
RecoveryVariantNeeded(ctx BaseModuleContext) bool
@@ -53,6 +57,9 @@
// RamdiskVariation means a module to be installed to ramdisk image.
RamdiskVariation string = "ramdisk"
+
+ // VendorRamdiskVariation means a module to be installed to vendor ramdisk image.
+ VendorRamdiskVariation string = "vendor_ramdisk"
)
// imageMutator creates variants for modules that implement the ImageInterface that
@@ -73,6 +80,9 @@
if m.RamdiskVariantNeeded(ctx) {
variations = append(variations, RamdiskVariation)
}
+ if m.VendorRamdiskVariantNeeded(ctx) {
+ variations = append(variations, VendorRamdiskVariation)
+ }
if m.RecoveryVariantNeeded(ctx) {
variations = append(variations, RecoveryVariation)
}
diff --git a/android/makefile_goal.go b/android/makefile_goal.go
index eae3976..b5d9d69 100644
--- a/android/makefile_goal.go
+++ b/android/makefile_goal.go
@@ -93,7 +93,6 @@
func MakefileGoalFactory() Module {
module := &makefileGoal{}
module.AddProperties(&module.properties)
- // This module is device-only
- InitAndroidArchModule(module, DeviceSupported, MultilibFirst)
+ InitAndroidModule(module)
return module
}
diff --git a/android/module.go b/android/module.go
index 70a343e..d677406 100644
--- a/android/module.go
+++ b/android/module.go
@@ -348,6 +348,7 @@
InstallInTestcases() bool
InstallInSanitizerDir() bool
InstallInRamdisk() bool
+ InstallInVendorRamdisk() bool
InstallInRecovery() bool
InstallInRoot() bool
InstallBypassMake() bool
@@ -403,6 +404,7 @@
InstallInTestcases() bool
InstallInSanitizerDir() bool
InstallInRamdisk() bool
+ InstallInVendorRamdisk() bool
InstallInRecovery() bool
InstallInRoot() bool
InstallBypassMake() bool
@@ -623,6 +625,9 @@
// Whether this module is installed to ramdisk
Ramdisk *bool
+ // Whether this module is installed to vendor ramdisk
+ Vendor_ramdisk *bool
+
// Whether this module is built for non-native architecures (also known as native bridge binary)
Native_bridge_supported *bool `android:"arch_variant"`
@@ -1274,6 +1279,10 @@
return Bool(m.commonProperties.Ramdisk)
}
+func (m *ModuleBase) InstallInVendorRamdisk() bool {
+ return Bool(m.commonProperties.Vendor_ramdisk)
+}
+
func (m *ModuleBase) InstallInRecovery() bool {
return Bool(m.commonProperties.Recovery)
}
@@ -1323,6 +1332,10 @@
return m.base().commonProperties.ImageVariation == RamdiskVariation
}
+func (m *ModuleBase) InVendorRamdisk() bool {
+ return m.base().commonProperties.ImageVariation == VendorRamdiskVariation
+}
+
func (m *ModuleBase) InRecovery() bool {
return m.base().commonProperties.ImageVariation == RecoveryVariation
}
@@ -2224,6 +2237,10 @@
return m.module.InstallInRamdisk()
}
+func (m *moduleContext) InstallInVendorRamdisk() bool {
+ return m.module.InstallInVendorRamdisk()
+}
+
func (m *moduleContext) InstallInRecovery() bool {
return m.module.InstallInRecovery()
}
diff --git a/android/paths.go b/android/paths.go
index 3825d45..4eb9d20 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -58,6 +58,7 @@
InstallInTestcases() bool
InstallInSanitizerDir() bool
InstallInRamdisk() bool
+ InstallInVendorRamdisk() bool
InstallInRecovery() bool
InstallInRoot() bool
InstallBypassMake() bool
@@ -1376,6 +1377,15 @@
if !ctx.InstallInRoot() {
partition += "/system"
}
+ } else if ctx.InstallInVendorRamdisk() {
+ if ctx.DeviceConfig().BoardMoveRecoveryResourcesToVendorBoot() {
+ partition = "recovery/root/first_stage_ramdisk"
+ } else {
+ partition = "vendor-ramdisk"
+ }
+ if !ctx.InstallInRoot() {
+ partition += "/system"
+ }
} else if ctx.InstallInRecovery() {
if ctx.InstallInRoot() {
partition = "recovery/root"
diff --git a/android/paths_test.go b/android/paths_test.go
index 108bd6c..9ecf4a1 100644
--- a/android/paths_test.go
+++ b/android/paths_test.go
@@ -200,14 +200,15 @@
type moduleInstallPathContextImpl struct {
baseModuleContext
- inData bool
- inTestcases bool
- inSanitizerDir bool
- inRamdisk bool
- inRecovery bool
- inRoot bool
- forceOS *OsType
- forceArch *ArchType
+ inData bool
+ inTestcases bool
+ inSanitizerDir bool
+ inRamdisk bool
+ inVendorRamdisk bool
+ inRecovery bool
+ inRoot bool
+ forceOS *OsType
+ forceArch *ArchType
}
func (m moduleInstallPathContextImpl) Config() Config {
@@ -232,6 +233,10 @@
return m.inRamdisk
}
+func (m moduleInstallPathContextImpl) InstallInVendorRamdisk() bool {
+ return m.inVendorRamdisk
+}
+
func (m moduleInstallPathContextImpl) InstallInRecovery() bool {
return m.inRecovery
}
diff --git a/android/variable.go b/android/variable.go
index 73062ed..23fc6c2 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -352,6 +352,8 @@
BoardKernelBinaries []string `json:",omitempty"`
BoardKernelModuleInterfaceVersions []string `json:",omitempty"`
+
+ BoardMoveRecoveryResourcesToVendorBoot *bool `json:",omitempty"`
}
func boolPtr(v bool) *bool {
diff --git a/apex/apex.go b/apex/apex.go
index a9a58a6..b02711e 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2075,7 +2075,7 @@
if to.AvailableFor(apexName) || baselineApexAvailable(apexName, toName) {
return true
}
- ctx.ModuleErrorf("%q requires %q that is not available for the APEX. Dependency path:%s", fromName, toName, ctx.GetPathString(true))
+ ctx.ModuleErrorf("%q requires %q that doesn't list the APEX under 'apex_available'. Dependency path:%s", fromName, toName, ctx.GetPathString(true))
// Visit this module's dependencies to check and report any issues with their availability.
return true
})
@@ -2383,11 +2383,12 @@
// system libraries.
if !am.DirectlyInAnyApex() {
// we need a module name for Make
- name := cc.BaseModuleName() + cc.Properties.SubName
- if proptools.Bool(a.properties.Use_vendor) {
+ name := cc.ImplementationModuleName(ctx)
+
+ if !proptools.Bool(a.properties.Use_vendor) {
// we don't use subName(.vendor) for a "use_vendor: true" apex
// which is supposed to be installed in /system
- name = cc.BaseModuleName()
+ name += cc.Properties.SubName
}
if !android.InList(name, a.requiredDeps) {
a.requiredDeps = append(a.requiredDeps, name)
diff --git a/apex/apex_test.go b/apex/apex_test.go
index c52fd04..fcd734c 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -1270,10 +1270,11 @@
system_shared_libs: [],
stl: "none",
stubs: { versions: ["29","30"] },
+ llndk_stubs: "libbar.llndk",
}
llndk_library {
- name: "libbar",
+ name: "libbar.llndk",
symbol_file: "",
}
`, func(fs map[string][]byte, config android.Config) {
@@ -4558,7 +4559,7 @@
func TestApexPropertiesShouldBeDefaultable(t *testing.T) {
// libfoo's apex_available comes from cc_defaults
- testApexError(t, `requires "libfoo" that is not available for the APEX`, `
+ testApexError(t, `requires "libfoo" that doesn't list the APEX under 'apex_available'.`, `
apex {
name: "myapex",
key: "myapex.key",
@@ -4592,7 +4593,7 @@
func TestApexAvailable_DirectDep(t *testing.T) {
// libfoo is not available to myapex, but only to otherapex
- testApexError(t, "requires \"libfoo\" that is not available for the APEX", `
+ testApexError(t, "requires \"libfoo\" that doesn't list the APEX under 'apex_available'.", `
apex {
name: "myapex",
key: "myapex.key",
@@ -4627,7 +4628,7 @@
func TestApexAvailable_IndirectDep(t *testing.T) {
// libbbaz is an indirect dep
- testApexError(t, `requires "libbaz" that is not available for the APEX. Dependency path:
+ testApexError(t, `requires "libbaz" that doesn't list the APEX under 'apex_available'. Dependency path:
.*via tag apex\.dependencyTag.*name:sharedLib.*
.*-> libfoo.*link:shared.*
.*via tag cc\.libraryDependencyTag.*Kind:sharedLibraryDependency.*
diff --git a/apex/vndk.go b/apex/vndk.go
index 93265c4..f4b12b5 100644
--- a/apex/vndk.go
+++ b/apex/vndk.go
@@ -152,7 +152,7 @@
}
// TODO(b/124106384): Clean up compat symlinks for ART binaries.
- if strings.HasPrefix(name, "com.android.art.") {
+ if name == "com.android.art" || strings.HasPrefix(name, "com.android.art.") {
addSymlink("/apex/com.android.art/bin/dalvikvm", "$(TARGET_OUT)/bin", "dalvikvm")
dex2oat := "dex2oat32"
if ctx.Config().Android64() {
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 5c55053..91eb886 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -24,15 +24,17 @@
)
var (
- nativeBridgeSuffix = ".native_bridge"
- productSuffix = ".product"
- vendorSuffix = ".vendor"
- ramdiskSuffix = ".ramdisk"
- recoverySuffix = ".recovery"
- sdkSuffix = ".sdk"
+ nativeBridgeSuffix = ".native_bridge"
+ productSuffix = ".product"
+ vendorSuffix = ".vendor"
+ ramdiskSuffix = ".ramdisk"
+ vendorRamdiskSuffix = ".vendor_ramdisk"
+ recoverySuffix = ".recovery"
+ sdkSuffix = ".sdk"
)
type AndroidMkContext interface {
+ BaseModuleName() string
Target() android.Target
subAndroidMk(*android.AndroidMkEntries, interface{})
Arch() android.Arch
@@ -42,6 +44,7 @@
VndkVersion() string
static() bool
InRamdisk() bool
+ InVendorRamdisk() bool
InRecovery() bool
AnyVariantDirectlyInAnyApex() bool
}
@@ -71,10 +74,11 @@
entries := android.AndroidMkEntries{
OutputFile: c.outputFile,
- // TODO(jiyong): add the APEXes providing shared libs to the required modules
- // Currently, adding c.Properties.ApexesProvidingSharedLibs is causing multiple
- // ART APEXes (com.android.art.debug|release) to be installed. And this
- // is breaking some older devices (like marlin) where system.img is small.
+ // TODO(jiyong): add the APEXes providing shared libs to the required
+ // modules Currently, adding c.Properties.ApexesProvidingSharedLibs is
+ // causing multiple ART APEXes (com.android.art and com.android.art.debug)
+ // to be installed. And this is breaking some older devices (like marlin)
+ // where system.img is small.
Required: c.Properties.AndroidMkRuntimeLibs,
Include: "$(BUILD_SYSTEM)/soong_cc_prebuilt.mk",
@@ -278,7 +282,7 @@
})
}
if len(library.Properties.Stubs.Versions) > 0 && !ctx.Host() && ctx.AnyVariantDirectlyInAnyApex() &&
- !ctx.InRamdisk() && !ctx.InRecovery() && !ctx.UseVndk() && !ctx.static() {
+ !ctx.InRamdisk() && !ctx.InVendorRamdisk() && !ctx.InRecovery() && !ctx.UseVndk() && !ctx.static() {
if library.buildStubs() && library.isLatestStubVersion() {
// reference the latest version via its name without suffix when it is provided by apex
entries.SubName = ""
@@ -462,6 +466,7 @@
func (c *llndkStubDecorator) AndroidMkEntries(ctx AndroidMkContext, entries *android.AndroidMkEntries) {
entries.Class = "SHARED_LIBRARIES"
+ entries.OverrideName = c.implementationModuleName(ctx.BaseModuleName())
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
c.libraryDecorator.androidMkWriteExportedFlags(entries)
diff --git a/cc/binary.go b/cc/binary.go
index 7f7b619..70cf5ff 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -251,7 +251,7 @@
} else {
switch ctx.Os() {
case android.Android:
- if ctx.bootstrap() && !ctx.inRecovery() && !ctx.inRamdisk() {
+ if ctx.bootstrap() && !ctx.inRecovery() && !ctx.inRamdisk() && !ctx.inVendorRamdisk() {
flags.DynamicLinker = "/system/bin/bootstrap/linker"
} else {
flags.DynamicLinker = "/system/bin/linker"
@@ -446,7 +446,8 @@
// runtime APEX.
translatedArch := ctx.Target().NativeBridge == android.NativeBridgeEnabled
if InstallToBootstrap(ctx.baseModuleName(), ctx.Config()) && !ctx.Host() && ctx.directlyInAnyApex() &&
- !translatedArch && ctx.apexVariationName() == "" && !ctx.inRamdisk() && !ctx.inRecovery() {
+ !translatedArch && ctx.apexVariationName() == "" && !ctx.inRamdisk() && !ctx.inRecovery() &&
+ !ctx.inVendorRamdisk() {
if ctx.Device() && isBionic(ctx.baseModuleName()) {
binary.installSymlinkToRuntimeApex(ctx, file)
diff --git a/cc/cc.go b/cc/cc.go
index dbe6346..c1a4327 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -84,6 +84,7 @@
ctx.TopDown("lto_deps", ltoDepsMutator)
ctx.BottomUp("lto", ltoMutator).Parallel()
+ ctx.BottomUp("check_linktype", checkLinkTypeMutator).Parallel()
ctx.TopDown("double_loadable", checkDoubleLoadableLibraries).Parallel()
})
@@ -257,14 +258,18 @@
// Make this module available when building for ramdisk
Ramdisk_available *bool
+ // Make this module available when building for vendor ramdisk
+ Vendor_ramdisk_available *bool
+
// Make this module available when building for recovery
Recovery_available *bool
// Set by imageMutator
- CoreVariantNeeded bool `blueprint:"mutated"`
- RamdiskVariantNeeded bool `blueprint:"mutated"`
- RecoveryVariantNeeded bool `blueprint:"mutated"`
- ExtraVariants []string `blueprint:"mutated"`
+ CoreVariantNeeded bool `blueprint:"mutated"`
+ RamdiskVariantNeeded bool `blueprint:"mutated"`
+ VendorRamdiskVariantNeeded bool `blueprint:"mutated"`
+ RecoveryVariantNeeded bool `blueprint:"mutated"`
+ ExtraVariants []string `blueprint:"mutated"`
// Allows this module to use non-APEX version of libraries. Useful
// for building binaries that are started before APEXes are activated.
@@ -352,6 +357,7 @@
inProduct() bool
inVendor() bool
inRamdisk() bool
+ inVendorRamdisk() bool
inRecovery() bool
shouldCreateSourceAbiDump() bool
selectedStl() string
@@ -946,7 +952,7 @@
}
func (c *Module) canUseSdk() bool {
- return c.Os() == android.Android && !c.UseVndk() && !c.InRamdisk() && !c.InRecovery()
+ return c.Os() == android.Android && !c.UseVndk() && !c.InRamdisk() && !c.InRecovery() && !c.InVendorRamdisk()
}
func (c *Module) UseSdk() bool {
@@ -1040,6 +1046,16 @@
return false
}
+// If this is a stubs library, ImplementationModuleName returns the name of the module that contains
+// the implementation. If it is an implementation library it returns its own name.
+func (c *Module) ImplementationModuleName(ctx android.BaseModuleContext) string {
+ name := ctx.OtherModuleName(c)
+ if versioned, ok := c.linker.(versionedInterface); ok {
+ name = versioned.implementationModuleName(name)
+ }
+ return name
+}
+
func (c *Module) bootstrap() bool {
return Bool(c.Properties.Bootstrap)
}
@@ -1396,6 +1412,8 @@
c.Properties.SubName += vendorSuffix
} else if c.InRamdisk() && !c.OnlyInRamdisk() {
c.Properties.SubName += ramdiskSuffix
+ } else if c.InVendorRamdisk() && !c.OnlyInVendorRamdisk() {
+ c.Properties.SubName += vendorRamdiskSuffix
} else if c.InRecovery() && !c.OnlyInRecovery() {
c.Properties.SubName += recoverySuffix
} else if c.IsSdkVariant() && (c.Properties.SdkAndPlatformVariantVisibleToMake || c.SplitPerApiLevel()) {
@@ -1508,7 +1526,7 @@
// module is marked with 'bootstrap: true').
if c.HasStubsVariants() && c.AnyVariantDirectlyInAnyApex() && !c.InRamdisk() &&
!c.InRecovery() && !c.UseVndk() && !c.static() && !c.isCoverageVariant() &&
- c.IsStubs() {
+ c.IsStubs() && !c.InVendorRamdisk() {
c.Properties.HideFromMake = false // unhide
// Note: this is still non-installable
}
@@ -2004,7 +2022,7 @@
// Whether a module can link to another module, taking into
// account NDK linking.
-func checkLinkType(ctx android.ModuleContext, from LinkableInterface, to LinkableInterface,
+func checkLinkType(ctx android.BaseModuleContext, from LinkableInterface, to LinkableInterface,
tag blueprint.DependencyTag) {
switch t := tag.(type) {
@@ -2044,6 +2062,10 @@
// Ramdisk code is not NDK
return
}
+ if from.InVendorRamdisk() {
+ // Vendor ramdisk code is not NDK
+ return
+ }
if from.InRecovery() {
// Recovery code is not NDK
return
@@ -2124,6 +2146,18 @@
}
}
+func checkLinkTypeMutator(ctx android.BottomUpMutatorContext) {
+ if c, ok := ctx.Module().(*Module); ok {
+ ctx.VisitDirectDeps(func(dep android.Module) {
+ depTag := ctx.OtherModuleDependencyTag(dep)
+ ccDep, ok := dep.(LinkableInterface)
+ if ok {
+ checkLinkType(ctx, c, ccDep, depTag)
+ }
+ })
+ }
+}
+
// Tests whether the dependent library is okay to be double loaded inside a single process.
// If a library has a vendor variant and is a (transitive) dependency of an LLNDK library,
// it is subject to be double loaded. Such lib should be explicitly marked as double_loadable: true
@@ -2132,15 +2166,15 @@
check := func(child, parent android.Module) bool {
to, ok := child.(*Module)
if !ok {
- // follow thru cc.Defaults, etc.
- return true
+ return false
}
if lib, ok := to.linker.(*libraryDecorator); !ok || !lib.shared() {
return false
}
- // if target lib has no vendor variant, keep checking dependency graph
+ // Even if target lib has no vendor variant, keep checking dependency graph
+ // in case it depends on vendor_available but not double_loadable transtively.
if !to.HasVendorVariant() {
return true
}
@@ -2304,8 +2338,6 @@
return
}
- checkLinkType(ctx, c, ccDep, depTag)
-
linkFile := ccDep.OutputFile()
if libDepTag, ok := depTag.(libraryDependencyTag); ok {
@@ -2348,7 +2380,7 @@
} else if apexInfo.IsForPlatform() {
// If not building for APEX, use stubs only when it is from
// an APEX (and not from platform)
- // However, for host, ramdisk, recovery or bootstrap modules,
+ // However, for host, ramdisk, vendor_ramdisk, recovery or bootstrap modules,
// always link to non-stub variant
useStubs = dep.(android.ApexModule).AnyVariantDirectlyInAnyApex() && !c.bootstrap()
// Another exception: if this module is bundled with an APEX, then
@@ -2642,7 +2674,8 @@
}
}
- if ctx.DeviceConfig().VndkUseCoreVariant() && ccDep.IsVndk() && !ccDep.MustUseVendorVariant() && !c.InRamdisk() && !c.InRecovery() {
+ if ctx.DeviceConfig().VndkUseCoreVariant() && ccDep.IsVndk() && !ccDep.MustUseVendorVariant() &&
+ !c.InRamdisk() && !c.InVendorRamdisk() && !c.InRecovery() {
// The vendor module is a no-vendor-variant VNDK library. Depend on the
// core module instead.
return libName
@@ -2654,6 +2687,8 @@
return libName + vendorPublicLibrarySuffix
} else if ccDep.InRamdisk() && !ccDep.OnlyInRamdisk() {
return libName + ramdiskSuffix
+ } else if ccDep.InVendorRamdisk() && !ccDep.OnlyInVendorRamdisk() {
+ return libName + vendorRamdiskSuffix
} else if ccDep.InRecovery() && !ccDep.OnlyInRecovery() {
return libName + recoverySuffix
} else if ccDep.Module().Target().NativeBridge == android.NativeBridgeEnabled {
@@ -2684,6 +2719,10 @@
return c.InRamdisk()
}
+func (c *Module) InstallInVendorRamdisk() bool {
+ return c.InVendorRamdisk()
+}
+
func (c *Module) InstallInRecovery() bool {
return c.InRecovery()
}
@@ -2784,6 +2823,8 @@
return "native:vendor"
} else if c.InRamdisk() {
return "native:ramdisk"
+ } else if c.InVendorRamdisk() {
+ return "native:vendor_ramdisk"
} else if c.InRecovery() {
return "native:recovery"
} else if c.Target().Os == android.Android && String(c.Properties.Sdk_version) != "" {
diff --git a/cc/cc_test.go b/cc/cc_test.go
index 9a7753e..3982c0c 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -103,6 +103,7 @@
}
func testCcError(t *testing.T, pattern string, bp string) {
+ t.Helper()
config := TestConfig(buildDir, android.Android, nil, bp, nil)
config.TestProductVariables.DeviceVndkVersion = StringPtr("current")
config.TestProductVariables.Platform_vndk_version = StringPtr("VER")
@@ -849,10 +850,11 @@
cc_library {
name: "libllndk",
shared_libs: ["libdoubleloadable"],
+ llndk_stubs: "libllndk.llndk",
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
symbol_file: "",
}
@@ -870,10 +872,11 @@
cc_library {
name: "libllndk",
shared_libs: ["libvndksp"],
+ llndk_stubs: "libllndk.llndk",
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
symbol_file: "",
}
@@ -927,10 +930,11 @@
cc_library {
name: "libllndk",
shared_libs: ["libcoreonly"],
+ llndk_stubs: "libllndk.llndk",
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
symbol_file: "",
}
@@ -1551,10 +1555,11 @@
cc_library {
name: "libllndk",
shared_libs: ["libnondoubleloadable"],
+ llndk_stubs: "libllndk.llndk",
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
symbol_file: "",
}
@@ -1573,10 +1578,11 @@
name: "libllndk",
no_libcrt: true,
shared_libs: ["libnondoubleloadable"],
+ llndk_stubs: "libllndk.llndk",
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
symbol_file: "",
}
@@ -1645,10 +1651,11 @@
cc_library {
name: "libllndk",
shared_libs: ["libcoreonly"],
+ llndk_stubs: "libllndk.llndk",
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
symbol_file: "",
}
@@ -1665,6 +1672,35 @@
`)
}
+func TestCheckVndkMembershipBeforeDoubleLoadable(t *testing.T) {
+ testCcError(t, "module \"libvndksp\" variant .*: .*: VNDK-SP must only depend on VNDK-SP", `
+ cc_library {
+ name: "libvndksp",
+ shared_libs: ["libanothervndksp"],
+ vendor_available: true,
+ vndk: {
+ enabled: true,
+ support_system_process: true,
+ }
+ }
+
+ cc_library {
+ name: "libllndk",
+ shared_libs: ["libanothervndksp"],
+ }
+
+ llndk_library {
+ name: "libllndk",
+ symbol_file: "",
+ }
+
+ cc_library {
+ name: "libanothervndksp",
+ vendor_available: true,
+ }
+ `)
+}
+
func TestVndkExt(t *testing.T) {
// This test checks the VNDK-Ext properties.
bp := `
@@ -2389,9 +2425,10 @@
bp := `
cc_library {
name: "libllndk",
+ llndk_stubs: "libllndk.llndk",
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
symbol_file: "",
}
cc_library {
@@ -2592,16 +2629,18 @@
}
cc_library {
name: "libllndk",
+ llndk_stubs: "libllndk.llndk",
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
symbol_file: "",
}
cc_library {
name: "libllndkprivate",
+ llndk_stubs: "libllndkprivate.llndk",
}
llndk_library {
- name: "libllndkprivate",
+ name: "libllndkprivate.llndk",
vendor_available: false,
symbol_file: "",
}`
@@ -3015,9 +3054,10 @@
cc_library {
name: "libllndk",
stubs: { versions: ["1", "2"] },
+ llndk_stubs: "libllndk.llndk",
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
}
`)
actual := ctx.ModuleVariantsForTests("libllndk.llndk")
@@ -3045,10 +3085,15 @@
export_include_dirs: ["my_include"],
}
llndk_library {
- name: "libllndk",
+ name: "libllndk.llndk",
export_llndk_headers: ["libllndk_headers"],
}
cc_library {
+ name: "libllndk",
+ llndk_stubs: "libllndk.llndk",
+ }
+
+ cc_library {
name: "libvendor",
shared_libs: ["libllndk"],
vendor: true,
diff --git a/cc/fuzz.go b/cc/fuzz.go
index e81b40f..681e3bc 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -388,10 +388,10 @@
return
}
- // Discard ramdisk + recovery modules, they're duplicates of
+ // Discard ramdisk + vendor_ramdisk + recovery modules, they're duplicates of
// fuzz targets we're going to package anyway.
if !ccModule.Enabled() || ccModule.Properties.PreventInstall ||
- ccModule.InRamdisk() || ccModule.InRecovery() {
+ ccModule.InRamdisk() || ccModule.InVendorRamdisk() || ccModule.InRecovery() {
return
}
diff --git a/cc/genrule.go b/cc/genrule.go
index cce4a83..a5a58d2 100644
--- a/cc/genrule.go
+++ b/cc/genrule.go
@@ -24,10 +24,11 @@
}
type GenruleExtraProperties struct {
- Vendor_available *bool
- Ramdisk_available *bool
- Recovery_available *bool
- Sdk_version *string
+ Vendor_available *bool
+ Ramdisk_available *bool
+ Vendor_ramdisk_available *bool
+ Recovery_available *bool
+ Sdk_version *string
}
// cc_genrule is a genrule that can depend on other cc_* objects.
@@ -68,6 +69,10 @@
return Bool(g.Ramdisk_available)
}
+func (g *GenruleExtraProperties) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
+ return Bool(g.Vendor_ramdisk_available)
+}
+
func (g *GenruleExtraProperties) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
return Bool(g.Recovery_available)
}
diff --git a/cc/image.go b/cc/image.go
index 6710e94..ba091e1 100644
--- a/cc/image.go
+++ b/cc/image.go
@@ -27,12 +27,13 @@
type imageVariantType string
const (
- coreImageVariant imageVariantType = "core"
- vendorImageVariant imageVariantType = "vendor"
- productImageVariant imageVariantType = "product"
- ramdiskImageVariant imageVariantType = "ramdisk"
- recoveryImageVariant imageVariantType = "recovery"
- hostImageVariant imageVariantType = "host"
+ coreImageVariant imageVariantType = "core"
+ vendorImageVariant imageVariantType = "vendor"
+ productImageVariant imageVariantType = "product"
+ ramdiskImageVariant imageVariantType = "ramdisk"
+ vendorRamdiskImageVariant imageVariantType = "vendor_ramdisk"
+ recoveryImageVariant imageVariantType = "recovery"
+ hostImageVariant imageVariantType = "host"
)
func (c *Module) getImageVariantType() imageVariantType {
@@ -44,6 +45,8 @@
return productImageVariant
} else if c.InRamdisk() {
return ramdiskImageVariant
+ } else if c.InVendorRamdisk() {
+ return vendorRamdiskImageVariant
} else if c.InRecovery() {
return recoveryImageVariant
} else {
@@ -83,6 +86,10 @@
return ctx.mod.InRamdisk()
}
+func (ctx *moduleContextImpl) inVendorRamdisk() bool {
+ return ctx.mod.InVendorRamdisk()
+}
+
func (ctx *moduleContextImpl) inRecovery() bool {
return ctx.mod.InRecovery()
}
@@ -107,6 +114,10 @@
return c.ModuleBase.InRamdisk() || c.ModuleBase.InstallInRamdisk()
}
+func (c *Module) InVendorRamdisk() bool {
+ return c.ModuleBase.InVendorRamdisk() || c.ModuleBase.InstallInVendorRamdisk()
+}
+
func (c *Module) InRecovery() bool {
return c.ModuleBase.InRecovery() || c.ModuleBase.InstallInRecovery()
}
@@ -115,6 +126,10 @@
return c.ModuleBase.InstallInRamdisk()
}
+func (c *Module) OnlyInVendorRamdisk() bool {
+ return c.ModuleBase.InstallInVendorRamdisk()
+}
+
func (c *Module) OnlyInRecovery() bool {
return c.ModuleBase.InstallInRecovery()
}
@@ -165,6 +180,7 @@
var coreVariantNeeded bool = false
var ramdiskVariantNeeded bool = false
+ var vendorRamdiskVariantNeeded bool = false
var recoveryVariantNeeded bool = false
var vendorVariants []string
@@ -283,6 +299,15 @@
coreVariantNeeded = false
}
+ if Bool(m.Properties.Vendor_ramdisk_available) {
+ vendorRamdiskVariantNeeded = true
+ }
+
+ if m.ModuleBase.InstallInVendorRamdisk() {
+ vendorRamdiskVariantNeeded = true
+ coreVariantNeeded = false
+ }
+
if Bool(m.Properties.Recovery_available) {
recoveryVariantNeeded = true
}
@@ -301,6 +326,7 @@
}
m.Properties.RamdiskVariantNeeded = ramdiskVariantNeeded
+ m.Properties.VendorRamdiskVariantNeeded = vendorRamdiskVariantNeeded
m.Properties.RecoveryVariantNeeded = recoveryVariantNeeded
m.Properties.CoreVariantNeeded = coreVariantNeeded
}
@@ -313,6 +339,10 @@
return c.Properties.RamdiskVariantNeeded
}
+func (c *Module) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
+ return c.Properties.VendorRamdiskVariantNeeded
+}
+
func (c *Module) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
return c.Properties.RecoveryVariantNeeded
}
@@ -323,7 +353,7 @@
func (c *Module) SetImageVariation(ctx android.BaseModuleContext, variant string, module android.Module) {
m := module.(*Module)
- if variant == android.RamdiskVariation {
+ if variant == android.RamdiskVariation || variant == android.VendorRamdiskVariation {
m.MakeAsPlatform()
} else if variant == android.RecoveryVariation {
m.MakeAsPlatform()
diff --git a/cc/library.go b/cc/library.go
index 1b7e1ed..0e0f143 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -110,6 +110,9 @@
// Inject boringssl hash into the shared library. This is only intended for use by external/boringssl.
Inject_bssl_hash *bool `android:"arch_variant"`
+
+ // If this is an LLNDK library, the name of the equivalent llndk_library module.
+ Llndk_stubs *string
}
type StaticProperties struct {
@@ -695,6 +698,8 @@
stubsVersions(ctx android.BaseMutatorContext) []string
setAllStubsVersions([]string)
allStubsVersions() []string
+
+ implementationModuleName(name string) string
}
var _ libraryInterface = (*libraryDecorator)(nil)
@@ -1194,7 +1199,8 @@
isVendor := ctx.useVndk()
isOwnerPlatform := Bool(library.Properties.Sysprop.Platform)
- if !ctx.inRamdisk() && !ctx.inRecovery() && (isProduct || (isOwnerPlatform == isVendor)) {
+ if !ctx.inRamdisk() && !ctx.inVendorRamdisk() && !ctx.inRecovery() &&
+ (isProduct || (isOwnerPlatform == isVendor)) {
dir = android.PathForModuleGen(ctx, "sysprop/public", "include")
}
}
@@ -1205,7 +1211,7 @@
}
if library.buildStubs() && !library.skipAPIDefine {
- library.reexportFlags("-D" + versioningMacroName(ctx.baseModuleName()) + "=" + library.stubsVersion())
+ library.reexportFlags("-D" + versioningMacroName(ctx.Module().(*Module).ImplementationModuleName(ctx)) + "=" + library.stubsVersion())
}
library.flagExporter.setProvider(ctx)
@@ -1286,7 +1292,7 @@
// runtime APEX.
translatedArch := ctx.Target().NativeBridge == android.NativeBridgeEnabled
if InstallToBootstrap(ctx.baseModuleName(), ctx.Config()) && !library.buildStubs() &&
- !translatedArch && !ctx.inRamdisk() && !ctx.inRecovery() {
+ !translatedArch && !ctx.inRamdisk() && !ctx.inVendorRamdisk() && !ctx.inRecovery() {
if ctx.Device() {
library.installSymlinkToRuntimeApex(ctx, file)
}
@@ -1301,7 +1307,7 @@
}
if Bool(library.Properties.Static_ndk_lib) && library.static() &&
- !ctx.useVndk() && !ctx.inRamdisk() && !ctx.inRecovery() && ctx.Device() &&
+ !ctx.useVndk() && !ctx.inRamdisk() && !ctx.inVendorRamdisk() && !ctx.inRecovery() && ctx.Device() &&
library.baseLinker.sanitize.isUnsanitizedVariant() &&
!library.buildStubs() && ctx.sdkVersion() == "" {
installPath := getNdkSysrootBase(ctx).Join(
@@ -1359,6 +1365,10 @@
library.MutatedProperties.BuildStatic = false
}
+func (library *libraryDecorator) implementationModuleName(name string) string {
+ return name
+}
+
func (library *libraryDecorator) buildStubs() bool {
return library.MutatedProperties.BuildStubs
}
@@ -1635,14 +1645,16 @@
func CanBeOrLinkAgainstVersionVariants(module interface {
Host() bool
InRamdisk() bool
+ InVendorRamdisk() bool
InRecovery() bool
}) bool {
- return !module.Host() && !module.InRamdisk() && !module.InRecovery()
+ return !module.Host() && !module.InRamdisk() && !module.InVendorRamdisk() && !module.InRecovery()
}
func CanBeVersionVariant(module interface {
Host() bool
InRamdisk() bool
+ InVendorRamdisk() bool
InRecovery() bool
CcLibraryInterface() bool
Shared() bool
diff --git a/cc/linkable.go b/cc/linkable.go
index 4eb7220..177e0c4 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -40,6 +40,9 @@
InRamdisk() bool
OnlyInRamdisk() bool
+ InVendorRamdisk() bool
+ OnlyInVendorRamdisk() bool
+
InRecovery() bool
OnlyInRecovery() bool
diff --git a/cc/llndk_library.go b/cc/llndk_library.go
index 4425a10..9f4444d 100644
--- a/cc/llndk_library.go
+++ b/cc/llndk_library.go
@@ -72,6 +72,8 @@
movedToApex bool
}
+var _ versionedInterface = (*llndkStubDecorator)(nil)
+
func (stub *llndkStubDecorator) compilerFlags(ctx ModuleContext, flags Flags, deps PathDeps) Flags {
flags = stub.baseCompiler.compilerFlags(ctx, flags, deps)
return addStubLibraryCompilerFlags(flags)
@@ -101,12 +103,14 @@
}
func (stub *llndkStubDecorator) Name(name string) string {
+ if strings.HasSuffix(name, llndkLibrarySuffix) {
+ return name
+ }
return name + llndkLibrarySuffix
}
func (stub *llndkStubDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
- stub.libraryDecorator.libName = strings.TrimSuffix(ctx.ModuleName(),
- llndkLibrarySuffix)
+ stub.libraryDecorator.libName = stub.implementationModuleName(ctx.ModuleName())
return stub.libraryDecorator.linkerFlags(ctx, flags)
}
@@ -133,7 +137,7 @@
func (stub *llndkStubDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps,
objs Objects) android.Path {
- impl := ctx.GetDirectDepWithTag(ctx.baseModuleName(), llndkImplDep)
+ impl := ctx.GetDirectDepWithTag(stub.implementationModuleName(ctx.ModuleName()), llndkImplDep)
if implApexModule, ok := impl.(android.ApexModule); ok {
stub.movedToApex = implApexModule.DirectlyInAnyApex()
}
@@ -167,6 +171,10 @@
return false
}
+func (stub *llndkStubDecorator) implementationModuleName(name string) string {
+ return strings.TrimSuffix(name, llndkLibrarySuffix)
+}
+
func (stub *llndkStubDecorator) buildStubs() bool {
return true
}
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index f2ad652..02b38a6 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -100,10 +100,16 @@
unversionedUntil android.ApiLevel
}
+var _ versionedInterface = (*stubDecorator)(nil)
+
func shouldUseVersionScript(ctx BaseModuleContext, stub *stubDecorator) bool {
return stub.apiLevel.GreaterThanOrEqualTo(stub.unversionedUntil)
}
+func (stub *stubDecorator) implementationModuleName(name string) string {
+ return strings.TrimSuffix(name, ndkLibrarySuffix)
+}
+
func ndkLibraryVersions(ctx android.BaseMutatorContext, from android.ApiLevel) []string {
var versions []android.ApiLevel
versionStrs := []string{}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 43198c1..b1326d9 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -376,8 +376,8 @@
}
// HWASan ramdisk (which is built from recovery) goes over some bootloader limit.
- // Keep libc instrumented so that ramdisk / recovery can run hwasan-instrumented code if necessary.
- if (ctx.inRamdisk() || ctx.inRecovery()) && !strings.HasPrefix(ctx.ModuleDir(), "bionic/libc") {
+ // Keep libc instrumented so that ramdisk / vendor_ramdisk / recovery can run hwasan-instrumented code if necessary.
+ if (ctx.inRamdisk() || ctx.inVendorRamdisk() || ctx.inRecovery()) && !strings.HasPrefix(ctx.ModuleDir(), "bionic/libc") {
s.Hwaddress = nil
}
diff --git a/cc/testing.go b/cc/testing.go
index 52f0829..019a186 100644
--- a/cc/testing.go
+++ b/cc/testing.go
@@ -172,9 +172,10 @@
stubs: {
versions: ["27", "28", "29"],
},
- }
+ llndk_stubs: "libc.llndk",
+}
llndk_library {
- name: "libc",
+ name: "libc.llndk",
symbol_file: "",
sdk_version: "current",
}
@@ -193,9 +194,10 @@
"//apex_available:platform",
"myapex"
],
+ llndk_stubs: "libm.llndk",
}
llndk_library {
- name: "libm",
+ name: "libm.llndk",
symbol_file: "",
sdk_version: "current",
}
@@ -253,9 +255,10 @@
"//apex_available:platform",
"myapex"
],
+ llndk_stubs: "libdl.llndk",
}
llndk_library {
- name: "libdl",
+ name: "libdl.llndk",
symbol_file: "",
sdk_version: "current",
}
@@ -265,9 +268,10 @@
nocrt: true,
system_shared_libs: [],
recovery_available: true,
+ llndk_stubs: "libft2.llndk",
}
llndk_library {
- name: "libft2",
+ name: "libft2.llndk",
symbol_file: "",
vendor_available: false,
sdk_version: "current",
diff --git a/cc/vendor_snapshot.go b/cc/vendor_snapshot.go
index 64e3ea8..78bde38 100644
--- a/cc/vendor_snapshot.go
+++ b/cc/vendor_snapshot.go
@@ -1005,9 +1005,10 @@
// But we can't just check SocSpecific() since we already passed the image mutator.
// Check ramdisk and recovery to see if we are real "vendor: true" module.
ramdisk_available := module.InRamdisk() && !module.OnlyInRamdisk()
+ vendor_ramdisk_available := module.InVendorRamdisk() && !module.OnlyInVendorRamdisk()
recovery_available := module.InRecovery() && !module.OnlyInRecovery()
- if !ramdisk_available && !recovery_available {
+ if !ramdisk_available && !recovery_available && !vendor_ramdisk_available {
vendorSnapshotsLock.Lock()
defer vendorSnapshotsLock.Unlock()
diff --git a/cc/vndk.go b/cc/vndk.go
index b05b856..6d5b074 100644
--- a/cc/vndk.go
+++ b/cc/vndk.go
@@ -129,7 +129,7 @@
return "native:vendor:vndkspext"
}
-func (vndk *vndkdep) vndkCheckLinkType(ctx android.ModuleContext, to *Module, tag blueprint.DependencyTag) {
+func (vndk *vndkdep) vndkCheckLinkType(ctx android.BaseModuleContext, to *Module, tag blueprint.DependencyTag) {
if to.linker == nil {
return
}
@@ -247,7 +247,7 @@
}
func isLlndkLibrary(baseModuleName string, config android.Config) bool {
- _, ok := llndkLibraries(config)[baseModuleName]
+ _, ok := llndkLibraries(config)[strings.TrimSuffix(baseModuleName, llndkLibrarySuffix)]
return ok
}
@@ -290,8 +290,8 @@
func processLlndkLibrary(mctx android.BottomUpMutatorContext, m *Module) {
lib := m.linker.(*llndkStubDecorator)
- name := m.BaseModuleName()
- filename := m.BaseModuleName() + ".so"
+ name := m.ImplementationModuleName(mctx)
+ filename := name + ".so"
vndkLibrariesLock.Lock()
defer vndkLibrariesLock.Unlock()
@@ -837,8 +837,8 @@
if m, ok := module.(*Module); ok {
if llndk, ok := m.linker.(*llndkStubDecorator); ok {
// Skip bionic libs, they are handled in different manner
- name := m.BaseModuleName()
- if llndk.movedToApex && !isBionic(m.BaseModuleName()) {
+ name := llndk.implementationModuleName(m.BaseModuleName())
+ if llndk.movedToApex && !isBionic(name) {
movedToApexLlndkLibraries[name] = true
}
}
diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go
index 664cb51..337ad88 100644
--- a/etc/prebuilt_etc.go
+++ b/etc/prebuilt_etc.go
@@ -61,6 +61,9 @@
// Make this module available when building for ramdisk.
Ramdisk_available *bool
+ // Make this module available when building for vendor ramdisk.
+ Vendor_ramdisk_available *bool
+
// Make this module available when building for recovery.
Recovery_available *bool
@@ -105,6 +108,18 @@
return p.inRamdisk()
}
+func (p *PrebuiltEtc) inVendorRamdisk() bool {
+ return p.ModuleBase.InVendorRamdisk() || p.ModuleBase.InstallInVendorRamdisk()
+}
+
+func (p *PrebuiltEtc) onlyInVendorRamdisk() bool {
+ return p.ModuleBase.InstallInVendorRamdisk()
+}
+
+func (p *PrebuiltEtc) InstallInVendorRamdisk() bool {
+ return p.inVendorRamdisk()
+}
+
func (p *PrebuiltEtc) inRecovery() bool {
return p.ModuleBase.InRecovery() || p.ModuleBase.InstallInRecovery()
}
@@ -122,13 +137,18 @@
func (p *PrebuiltEtc) ImageMutatorBegin(ctx android.BaseModuleContext) {}
func (p *PrebuiltEtc) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
- return !p.ModuleBase.InstallInRecovery() && !p.ModuleBase.InstallInRamdisk()
+ return !p.ModuleBase.InstallInRecovery() && !p.ModuleBase.InstallInRamdisk() &&
+ !p.ModuleBase.InstallInVendorRamdisk()
}
func (p *PrebuiltEtc) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
return proptools.Bool(p.properties.Ramdisk_available) || p.ModuleBase.InstallInRamdisk()
}
+func (p *PrebuiltEtc) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
+ return proptools.Bool(p.properties.Vendor_ramdisk_available) || p.ModuleBase.InstallInVendorRamdisk()
+}
+
func (p *PrebuiltEtc) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
return proptools.Bool(p.properties.Recovery_available) || p.ModuleBase.InstallInRecovery()
}
@@ -228,6 +248,9 @@
if p.inRamdisk() && !p.onlyInRamdisk() {
nameSuffix = ".ramdisk"
}
+ if p.inVendorRamdisk() && !p.onlyInVendorRamdisk() {
+ nameSuffix = ".vendor_ramdisk"
+ }
if p.inRecovery() && !p.onlyInRecovery() {
nameSuffix = ".recovery"
}
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 99d6207..b09c195 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -605,6 +605,7 @@
func (x noopImageInterface) ImageMutatorBegin(android.BaseModuleContext) {}
func (x noopImageInterface) CoreVariantNeeded(android.BaseModuleContext) bool { return false }
func (x noopImageInterface) RamdiskVariantNeeded(android.BaseModuleContext) bool { return false }
+func (x noopImageInterface) VendorRamdiskVariantNeeded(android.BaseModuleContext) bool { return false }
func (x noopImageInterface) RecoveryVariantNeeded(android.BaseModuleContext) bool { return false }
func (x noopImageInterface) ExtraImageVariations(ctx android.BaseModuleContext) []string { return nil }
func (x noopImageInterface) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
diff --git a/java/aar.go b/java/aar.go
index f1f6848..157d677 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -536,6 +536,8 @@
ctx.CheckbuildFile(a.aarFile)
}
+ a.exportedProguardFlagFiles = append(a.exportedProguardFlagFiles,
+ android.PathsForModuleSrc(ctx, a.dexProperties.Optimize.Proguard_flags_files)...)
ctx.VisitDirectDeps(func(m android.Module) {
if lib, ok := m.(AndroidLibraryDependency); ok && ctx.OtherModuleDependencyTag(m) == staticLibTag {
a.exportedProguardFlagFiles = append(a.exportedProguardFlagFiles, lib.ExportedProguardFlagFiles()...)
diff --git a/java/app_test.go b/java/app_test.go
index 49ed3aa..cec8a62 100644
--- a/java/app_test.go
+++ b/java/app_test.go
@@ -3491,3 +3491,34 @@
})
}
}
+
+func TestExportedProguardFlagFiles(t *testing.T) {
+ ctx, _ := testJava(t, `
+ android_app {
+ name: "foo",
+ sdk_version: "current",
+ static_libs: ["lib1"],
+ }
+
+ android_library {
+ name: "lib1",
+ sdk_version: "current",
+ optimize: {
+ proguard_flags_files: ["lib1proguard.cfg"],
+ }
+ }
+ `)
+
+ m := ctx.ModuleForTests("foo", "android_common")
+ hasLib1Proguard := false
+ for _, s := range m.Rule("java.r8").Implicits.Strings() {
+ if s == "lib1proguard.cfg" {
+ hasLib1Proguard = true
+ break
+ }
+ }
+
+ if !hasLib1Proguard {
+ t.Errorf("App does not use library proguard config")
+ }
+}
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index 9f49786..629d34f 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -270,7 +270,7 @@
apexInfo := ctx.ModuleProvider(module, android.ApexInfoProvider).(android.ApexInfo)
fromUpdatableApex := isApexModule && apexInfo.Updatable
if image.name == artBootImageName {
- if isApexModule && len(apexInfo.InApexes) > 0 && allHavePrefix(apexInfo.InApexes, "com.android.art.") {
+ if isApexModule && len(apexInfo.InApexes) > 0 && allHavePrefix(apexInfo.InApexes, "com.android.art") {
// ok: found the jar in the ART apex
} else if isApexModule && apexInfo.IsForPlatform() && isHostdex(module) {
// exception (skip and continue): special "hostdex" platform variant
@@ -301,7 +301,7 @@
func allHavePrefix(list []string, prefix string) bool {
for _, s := range list {
- if !strings.HasPrefix(s, prefix) {
+ if s != prefix && !strings.HasPrefix(s, prefix+".") {
return false
}
}
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index 9d07e41..c3ae75e 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -258,17 +258,17 @@
Inputs(flagsCSV).
FlagWithInput("--unsupported ",
android.PathForSource(ctx, "frameworks/base/config/hiddenapi-unsupported.txt")).
- FlagWithInput("--unsupported-ignore-conflicts ", combinedRemovedApis).
+ FlagWithInput("--unsupported ", combinedRemovedApis).Flag("--ignore-conflicts ").FlagWithArg("--tag ", "removed").
FlagWithInput("--max-target-q ",
android.PathForSource(ctx, "frameworks/base/config/hiddenapi-max-target-q.txt")).
FlagWithInput("--max-target-p ",
android.PathForSource(ctx, "frameworks/base/config/hiddenapi-max-target-p.txt")).
- FlagWithInput("--max-target-o-ignore-conflicts ",
- android.PathForSource(ctx, "frameworks/base/config/hiddenapi-max-target-o.txt")).
+ FlagWithInput("--max-target-o ", android.PathForSource(
+ ctx, "frameworks/base/config/hiddenapi-max-target-o.txt")).Flag("--ignore-conflicts ").
FlagWithInput("--blocked ",
android.PathForSource(ctx, "frameworks/base/config/hiddenapi-force-blocked.txt")).
- FlagWithInput("--unsupported-packages ",
- android.PathForSource(ctx, "frameworks/base/config/hiddenapi-unsupported-packages.txt")).
+ FlagWithInput("--unsupported ", android.PathForSource(
+ ctx, "frameworks/base/config/hiddenapi-unsupported-packages.txt")).Flag("--packages ").
FlagWithOutput("--output ", tempPath)
commitChangeForRestat(rule, tempPath, outputPath)
diff --git a/rust/config/allowed_list.go b/rust/config/allowed_list.go
index cbdbe23..b5c70dc 100644
--- a/rust/config/allowed_list.go
+++ b/rust/config/allowed_list.go
@@ -10,6 +10,7 @@
"external/crosvm",
"external/minijail",
"external/rust",
+ "external/vm_tools/p9",
"frameworks/native/libs/binder/rust",
"packages/modules/Virtualization",
"prebuilts/rust",
diff --git a/rust/rust.go b/rust/rust.go
index 1b999d7..77d9a90 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -118,6 +118,10 @@
return mod.InRamdisk()
}
+func (mod *Module) VendorRamdiskVariantNeeded(android.BaseModuleContext) bool {
+ return mod.InVendorRamdisk()
+}
+
func (mod *Module) RecoveryVariantNeeded(android.BaseModuleContext) bool {
return mod.InRecovery()
}
@@ -185,6 +189,10 @@
return false
}
+func (mod *Module) OnlyInVendorRamdisk() bool {
+ return false
+}
+
func (mod *Module) OnlyInRecovery() bool {
return false
}
diff --git a/scripts/build-mainline-modules.sh b/scripts/build-mainline-modules.sh
index c5ec8d1..b8dd7aa 100755
--- a/scripts/build-mainline-modules.sh
+++ b/scripts/build-mainline-modules.sh
@@ -3,13 +3,13 @@
# Non exhaustive list of modules where we want prebuilts. More can be added as
# needed.
MAINLINE_MODULES=(
+ com.android.art
com.android.art.debug
- com.android.art.release
com.android.art.testing
com.android.conscrypt
+ com.android.i18n
com.android.runtime
com.android.tzdata
- com.android.i18n
)
# List of SDKs and module exports we know of.
diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go
index c214e75..c1813ec 100644
--- a/sdk/cc_sdk_test.go
+++ b/sdk/cc_sdk_test.go
@@ -120,10 +120,8 @@
android_arm64: {
srcs: ["android/arm64/lib/sdkmember.so"],
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/sdkmember.so"],
},
},
@@ -143,10 +141,8 @@
android_arm64: {
srcs: ["android/arm64/lib/sdkmember.so"],
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/sdkmember.so"],
},
},
@@ -162,7 +158,7 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
enabled: true,
},
},
@@ -670,20 +666,21 @@
enabled: false,
},
linux_glibc: {
- enabled: true,
compile_multilib: "both",
},
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/bin/mynativebinary"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/bin/mynativebinary"],
},
windows: {
- enabled: true,
compile_multilib: "64",
},
windows_x86_64: {
+ enabled: true,
srcs: ["windows/x86_64/bin/mynativebinary.exe"],
},
},
@@ -701,20 +698,21 @@
enabled: false,
},
linux_glibc: {
- enabled: true,
compile_multilib: "both",
},
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/bin/mynativebinary"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/bin/mynativebinary"],
},
windows: {
- enabled: true,
compile_multilib: "64",
},
windows_x86_64: {
+ enabled: true,
srcs: ["windows/x86_64/bin/mynativebinary.exe"],
},
},
@@ -727,15 +725,20 @@
host_supported: true,
native_binaries: ["myexports_mynativebinary@current"],
target: {
+ windows: {
+ compile_multilib: "64",
+ },
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
enabled: true,
},
- windows: {
+ linux_glibc_x86: {
enabled: true,
- compile_multilib: "64",
+ },
+ windows_x86_64: {
+ enabled: true,
},
},
}
@@ -811,10 +814,8 @@
host: {
enabled: false,
},
- linux_bionic: {
- enabled: true,
- },
linux_bionic_x86_64: {
+ enabled: true,
srcs: ["x86_64/bin/mynativebinary"],
},
},
@@ -832,10 +833,8 @@
host: {
enabled: false,
},
- linux_bionic: {
- enabled: true,
- },
linux_bionic_x86_64: {
+ enabled: true,
srcs: ["x86_64/bin/mynativebinary"],
},
},
@@ -854,10 +853,8 @@
host: {
enabled: false,
},
- linux_bionic: {
- enabled: true,
- },
linux_bionic_x86_64: {
+ enabled: true,
srcs: ["x86_64/lib/mynativelib.so"],
},
},
@@ -875,10 +872,8 @@
host: {
enabled: false,
},
- linux_bionic: {
- enabled: true,
- },
linux_bionic_x86_64: {
+ enabled: true,
srcs: ["x86_64/lib/mynativelib.so"],
},
},
@@ -896,7 +891,7 @@
host: {
enabled: false,
},
- linux_bionic: {
+ linux_bionic_x86_64: {
enabled: true,
},
},
@@ -952,13 +947,12 @@
host: {
enabled: false,
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["x86_64/bin/linker"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["x86/bin/linker"],
},
},
@@ -978,13 +972,12 @@
host: {
enabled: false,
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["x86_64/bin/linker"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["x86/bin/linker"],
},
},
@@ -1000,7 +993,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
@@ -1345,14 +1341,13 @@
host: {
enabled: false,
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["x86_64/lib/mynativelib.so"],
export_include_dirs: ["x86_64/include_gen/mynativelib"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["x86/lib/mynativelib.so"],
export_include_dirs: ["x86/include_gen/mynativelib"],
},
@@ -1373,14 +1368,13 @@
host: {
enabled: false,
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["x86_64/lib/mynativelib.so"],
export_include_dirs: ["x86_64/include_gen/mynativelib"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["x86/lib/mynativelib.so"],
export_include_dirs: ["x86/include_gen/mynativelib"],
},
@@ -1397,7 +1391,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
@@ -1464,20 +1461,21 @@
enabled: false,
},
linux_glibc: {
- enabled: true,
compile_multilib: "both",
},
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/mynativelib.so"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/lib/mynativelib.so"],
},
windows: {
- enabled: true,
compile_multilib: "64",
},
windows_x86_64: {
+ enabled: true,
srcs: ["windows/x86_64/lib/mynativelib.dll"],
},
},
@@ -1495,20 +1493,21 @@
enabled: false,
},
linux_glibc: {
- enabled: true,
compile_multilib: "both",
},
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/mynativelib.so"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/lib/mynativelib.so"],
},
windows: {
- enabled: true,
compile_multilib: "64",
},
windows_x86_64: {
+ enabled: true,
srcs: ["windows/x86_64/lib/mynativelib.dll"],
},
},
@@ -1521,15 +1520,20 @@
host_supported: true,
native_shared_libs: ["mysdk_mynativelib@current"],
target: {
+ windows: {
+ compile_multilib: "64",
+ },
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
enabled: true,
},
- windows: {
+ linux_glibc_x86: {
enabled: true,
- compile_multilib: "64",
+ },
+ windows_x86_64: {
+ enabled: true,
},
},
}
@@ -1669,14 +1673,13 @@
host: {
enabled: false,
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["x86_64/lib/mynativelib.a"],
export_include_dirs: ["x86_64/include_gen/mynativelib"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["x86/lib/mynativelib.a"],
export_include_dirs: ["x86/include_gen/mynativelib"],
},
@@ -1696,14 +1699,13 @@
host: {
enabled: false,
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["x86_64/lib/mynativelib.a"],
export_include_dirs: ["x86_64/include_gen/mynativelib"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["x86/lib/mynativelib.a"],
export_include_dirs: ["x86/include_gen/mynativelib"],
},
@@ -1720,7 +1722,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
@@ -1885,10 +1890,8 @@
host: {
enabled: false,
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["x86_64/lib/mynativelib.a"],
export_include_dirs: ["x86_64/include_gen/mynativelib"],
},
@@ -1908,10 +1911,8 @@
host: {
enabled: false,
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["x86_64/lib/mynativelib.a"],
export_include_dirs: ["x86_64/include_gen/mynativelib"],
},
@@ -1929,7 +1930,7 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
enabled: true,
},
},
@@ -2027,7 +2028,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
@@ -2046,7 +2050,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
@@ -2062,7 +2069,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
@@ -2118,9 +2128,14 @@
export_include_dirs: ["android/include/include-android"],
},
linux_glibc: {
- enabled: true,
export_include_dirs: ["linux_glibc/include/include-host"],
},
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
+ enabled: true,
+ },
},
}
@@ -2140,9 +2155,14 @@
export_include_dirs: ["android/include/include-android"],
},
linux_glibc: {
- enabled: true,
export_include_dirs: ["linux_glibc/include/include-host"],
},
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
+ enabled: true,
+ },
},
}
@@ -2155,7 +2175,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
@@ -2346,13 +2369,12 @@
android_arm: {
srcs: ["android/arm/lib/sslvariants.so"],
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/sslvariants.so"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/lib/sslvariants.so"],
},
},
@@ -2377,13 +2399,12 @@
android_arm: {
srcs: ["android/arm/lib/sslvariants.so"],
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/sslvariants.so"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/lib/sslvariants.so"],
},
},
@@ -2398,7 +2419,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
@@ -2536,13 +2560,12 @@
android_arm: {
srcs: ["android/arm/lib/stubslib.so"],
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/stubslib.so"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/lib/stubslib.so"],
},
},
@@ -2571,13 +2594,12 @@
android_arm: {
srcs: ["android/arm/lib/stubslib.so"],
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/stubslib.so"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/lib/stubslib.so"],
},
},
@@ -2592,7 +2614,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
@@ -2637,13 +2662,12 @@
android_arm: {
srcs: ["android/arm/lib/mylib.so"],
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/mylib-host.so"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/lib/mylib-host.so"],
},
},
@@ -2666,13 +2690,12 @@
android_arm: {
srcs: ["android/arm/lib/mylib.so"],
},
- linux_glibc: {
- enabled: true,
- },
linux_glibc_x86_64: {
+ enabled: true,
srcs: ["linux_glibc/x86_64/lib/mylib-host.so"],
},
linux_glibc_x86: {
+ enabled: true,
srcs: ["linux_glibc/x86/lib/mylib-host.so"],
},
},
@@ -2687,7 +2710,10 @@
host: {
enabled: false,
},
- linux_glibc: {
+ linux_glibc_x86_64: {
+ enabled: true,
+ },
+ linux_glibc_x86: {
enabled: true,
},
},
diff --git a/sdk/update.go b/sdk/update.go
index f29b5a0..7bf5dea 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -347,34 +347,11 @@
targetPropertySet := snapshotModule.AddPropertySet("target")
- // If host is supported and any member is host OS dependent then disable host
- // by default, so that we can enable each host OS variant explicitly. This
- // avoids problems with implicitly enabled OS variants when the snapshot is
- // used, which might be different from this run (e.g. different build OS).
- hasHostOsDependentMember := false
- if s.HostSupported() {
- for _, memberRef := range memberRefs {
- if memberRef.memberType.IsHostOsDependent() {
- hasHostOsDependentMember = true
- break
- }
- }
- if hasHostOsDependentMember {
- hostPropertySet := targetPropertySet.AddPropertySet("host")
- hostPropertySet.AddProperty("enabled", false)
- }
- }
-
// Iterate over the os types in a fixed order.
for _, osType := range s.getPossibleOsTypes() {
if sdkVariant, ok := osTypeToMemberProperties[osType]; ok {
osPropertySet := targetPropertySet.AddPropertySet(sdkVariant.Target().Os.Name)
- // Enable the variant explicitly when we've disabled it by default on host.
- if hasHostOsDependentMember && osType.Class == android.Host {
- osPropertySet.AddProperty("enabled", true)
- }
-
variantProps := variantToProperties[sdkVariant]
if variantProps.Compile_multilib != "" && variantProps.Compile_multilib != "both" {
osPropertySet.AddProperty("compile_multilib", variantProps.Compile_multilib)
@@ -384,6 +361,31 @@
}
}
+ // If host is supported and any member is host OS dependent then disable host
+ // by default, so that we can enable each host OS variant explicitly. This
+ // avoids problems with implicitly enabled OS variants when the snapshot is
+ // used, which might be different from this run (e.g. different build OS).
+ if s.HostSupported() {
+ var supportedHostTargets []string
+ for _, memberRef := range memberRefs {
+ if memberRef.memberType.IsHostOsDependent() && memberRef.variant.Target().Os.Class == android.Host {
+ targetString := memberRef.variant.Target().Os.String() + "_" + memberRef.variant.Target().Arch.ArchType.String()
+ if !android.InList(targetString, supportedHostTargets) {
+ supportedHostTargets = append(supportedHostTargets, targetString)
+ }
+ }
+ }
+ if len(supportedHostTargets) > 0 {
+ hostPropertySet := targetPropertySet.AddPropertySet("host")
+ hostPropertySet.AddProperty("enabled", false)
+ }
+ // Enable the <os>_<arch> variant explicitly when we've disabled it by default on host.
+ for _, hostTarget := range supportedHostTargets {
+ propertySet := targetPropertySet.AddPropertySet(hostTarget)
+ propertySet.AddProperty("enabled", true)
+ }
+ }
+
// Prune any empty property sets.
snapshotModule.transform(pruneEmptySetTransformer{})
@@ -984,7 +986,7 @@
archTypeName := archType.Name
archVariants := variantsByArchName[archTypeName]
- archInfo := newArchSpecificInfo(ctx, archType, osSpecificVariantPropertiesFactory, archVariants)
+ archInfo := newArchSpecificInfo(ctx, archType, osType, osSpecificVariantPropertiesFactory, archVariants)
osInfo.archInfos = append(osInfo.archInfos, archInfo)
}
@@ -1067,11 +1069,6 @@
osPropertySet = targetPropertySet.AddPropertySet(osType.Name)
archPropertySet = targetPropertySet
- // Enable the variant explicitly when we've disabled it by default on host.
- if ctx.memberType.IsHostOsDependent() && osType.Class == android.Host {
- osPropertySet.AddProperty("enabled", true)
- }
-
// Arch specific properties need to be added to an os and arch specific
// section prefixed with <os>_.
archOsPrefix = osType.Name + "_"
@@ -1105,6 +1102,7 @@
baseInfo
archType android.ArchType
+ osType android.OsType
linkInfos []*linkTypeSpecificInfo
}
@@ -1113,10 +1111,10 @@
// Create a new archTypeSpecificInfo for the specified arch type and its properties
// structures populated with information from the variants.
-func newArchSpecificInfo(ctx android.SdkMemberContext, archType android.ArchType, variantPropertiesFactory variantPropertiesFactoryFunc, archVariants []android.Module) *archTypeSpecificInfo {
+func newArchSpecificInfo(ctx android.SdkMemberContext, archType android.ArchType, osType android.OsType, variantPropertiesFactory variantPropertiesFactoryFunc, archVariants []android.Module) *archTypeSpecificInfo {
// Create an arch specific info into which the variant properties can be copied.
- archInfo := &archTypeSpecificInfo{archType: archType}
+ archInfo := &archTypeSpecificInfo{archType: archType, osType: osType}
// Create the properties into which the arch type specific properties will be
// added.
@@ -1180,6 +1178,10 @@
func (archInfo *archTypeSpecificInfo) addToPropertySet(ctx *memberContext, archPropertySet android.BpPropertySet, archOsPrefix string) {
archTypeName := archInfo.archType.Name
archTypePropertySet := archPropertySet.AddPropertySet(archOsPrefix + archTypeName)
+ // Enable the <os>_<arch> variant explicitly when we've disabled it by default on host.
+ if ctx.memberType.IsHostOsDependent() && archInfo.osType.Class == android.Host {
+ archTypePropertySet.AddProperty("enabled", true)
+ }
addSdkMemberPropertiesToSet(ctx, archInfo.Properties, archTypePropertySet)
for _, linkInfo := range archInfo.linkInfos {
diff --git a/sh/sh_binary.go b/sh/sh_binary.go
index e807877..6f40ae4 100644
--- a/sh/sh_binary.go
+++ b/sh/sh_binary.go
@@ -68,6 +68,9 @@
// Make this module available when building for ramdisk.
Ramdisk_available *bool
+ // Make this module available when building for vendor ramdisk.
+ Vendor_ramdisk_available *bool
+
// Make this module available when building for recovery.
Recovery_available *bool
}
@@ -176,6 +179,10 @@
return proptools.Bool(s.properties.Ramdisk_available) || s.ModuleBase.InstallInRamdisk()
}
+func (s *ShBinary) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
+ return proptools.Bool(s.properties.Vendor_ramdisk_available) || s.ModuleBase.InstallInVendorRamdisk()
+}
+
func (s *ShBinary) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
return proptools.Bool(s.properties.Recovery_available) || s.ModuleBase.InstallInRecovery()
}
diff --git a/sysprop/sysprop_test.go b/sysprop/sysprop_test.go
index 3be1945..7a79a1b 100644
--- a/sysprop/sysprop_test.go
+++ b/sysprop/sysprop_test.go
@@ -277,6 +277,7 @@
system_shared_libs: [],
recovery_available: true,
host_supported: true,
+ llndk_stubs: "liblog.llndk",
}
cc_binary_host {
@@ -285,7 +286,7 @@
}
llndk_library {
- name: "liblog",
+ name: "liblog.llndk",
symbol_file: "",
}
diff --git a/ui/status/ninja.go b/ui/status/ninja.go
index a11774c..765679f 100644
--- a/ui/status/ninja.go
+++ b/ui/status/ninja.go
@@ -162,6 +162,17 @@
Action: started,
Output: msg.EdgeFinished.GetOutput(),
Error: err,
+ Stats: ActionResultStats{
+ UserTime: msg.EdgeFinished.GetUserTime(),
+ SystemTime: msg.EdgeFinished.GetSystemTime(),
+ MaxRssKB: msg.EdgeFinished.GetMaxRssKb(),
+ MinorPageFaults: msg.EdgeFinished.GetMinorPageFaults(),
+ MajorPageFaults: msg.EdgeFinished.GetMajorPageFaults(),
+ IOInputKB: msg.EdgeFinished.GetIoInputKb(),
+ IOOutputKB: msg.EdgeFinished.GetIoOutputKb(),
+ VoluntaryContextSwitches: msg.EdgeFinished.GetVoluntaryContextSwitches(),
+ InvoluntaryContextSwitches: msg.EdgeFinished.GetInvoluntaryContextSwitches(),
+ },
})
}
}
diff --git a/ui/status/ninja_frontend/frontend.pb.go b/ui/status/ninja_frontend/frontend.pb.go
index 7ba9de2..86e474b 100644
--- a/ui/status/ninja_frontend/frontend.pb.go
+++ b/ui/status/ninja_frontend/frontend.pb.go
@@ -371,10 +371,24 @@
// Number of milliseconds spent executing in user mode
UserTime *uint32 `protobuf:"varint,5,opt,name=user_time,json=userTime" json:"user_time,omitempty"`
// Number of milliseconds spent executing in kernel mode
- SystemTime *uint32 `protobuf:"varint,6,opt,name=system_time,json=systemTime" json:"system_time,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
+ SystemTime *uint32 `protobuf:"varint,6,opt,name=system_time,json=systemTime" json:"system_time,omitempty"`
+ // Max resident set size in kB
+ MaxRssKb *uint64 `protobuf:"varint,7,opt,name=max_rss_kb,json=maxRssKb" json:"max_rss_kb,omitempty"`
+ // Minor page faults
+ MinorPageFaults *uint64 `protobuf:"varint,8,opt,name=minor_page_faults,json=minorPageFaults" json:"minor_page_faults,omitempty"`
+ // Major page faults
+ MajorPageFaults *uint64 `protobuf:"varint,9,opt,name=major_page_faults,json=majorPageFaults" json:"major_page_faults,omitempty"`
+ // IO input in kB
+ IoInputKb *uint64 `protobuf:"varint,10,opt,name=io_input_kb,json=ioInputKb" json:"io_input_kb,omitempty"`
+ // IO output in kB
+ IoOutputKb *uint64 `protobuf:"varint,11,opt,name=io_output_kb,json=ioOutputKb" json:"io_output_kb,omitempty"`
+ // Voluntary context switches
+ VoluntaryContextSwitches *uint64 `protobuf:"varint,12,opt,name=voluntary_context_switches,json=voluntaryContextSwitches" json:"voluntary_context_switches,omitempty"`
+ // Involuntary context switches
+ InvoluntaryContextSwitches *uint64 `protobuf:"varint,13,opt,name=involuntary_context_switches,json=involuntaryContextSwitches" json:"involuntary_context_switches,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
}
func (m *Status_EdgeFinished) Reset() { *m = Status_EdgeFinished{} }
@@ -444,6 +458,55 @@
return 0
}
+func (m *Status_EdgeFinished) GetMaxRssKb() uint64 {
+ if m != nil && m.MaxRssKb != nil {
+ return *m.MaxRssKb
+ }
+ return 0
+}
+
+func (m *Status_EdgeFinished) GetMinorPageFaults() uint64 {
+ if m != nil && m.MinorPageFaults != nil {
+ return *m.MinorPageFaults
+ }
+ return 0
+}
+
+func (m *Status_EdgeFinished) GetMajorPageFaults() uint64 {
+ if m != nil && m.MajorPageFaults != nil {
+ return *m.MajorPageFaults
+ }
+ return 0
+}
+
+func (m *Status_EdgeFinished) GetIoInputKb() uint64 {
+ if m != nil && m.IoInputKb != nil {
+ return *m.IoInputKb
+ }
+ return 0
+}
+
+func (m *Status_EdgeFinished) GetIoOutputKb() uint64 {
+ if m != nil && m.IoOutputKb != nil {
+ return *m.IoOutputKb
+ }
+ return 0
+}
+
+func (m *Status_EdgeFinished) GetVoluntaryContextSwitches() uint64 {
+ if m != nil && m.VoluntaryContextSwitches != nil {
+ return *m.VoluntaryContextSwitches
+ }
+ return 0
+}
+
+func (m *Status_EdgeFinished) GetInvoluntaryContextSwitches() uint64 {
+ if m != nil && m.InvoluntaryContextSwitches != nil {
+ return *m.InvoluntaryContextSwitches
+ }
+ return 0
+}
+
type Status_Message struct {
// Message priority level (DEBUG, INFO, WARNING, ERROR).
Level *Status_Message_Level `protobuf:"varint,1,opt,name=level,enum=ninja.Status_Message_Level,def=0" json:"level,omitempty"`
@@ -511,39 +574,48 @@
}
var fileDescriptor_eca3873955a29cfe = []byte{
- // 539 bytes of a gzipped FileDescriptorProto
- 0x1f,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x53, 0xf3, 0x86, 0x5c, 0xea, 0x40,
+ 0xfd, 0x14, 0x7a, 0x7a, 0xc6, 0x95, 0xd7, 0x43, 0xde, 0x9b, 0x13, 0xef, 0x2c, 0x70, 0x54, 0xc4,
+ 0xc9, 0x1b, 0x58, 0x13, 0xe9, 0x7f, 0xf2, 0xfb, 0x98, 0xef, 0x57, 0x98, 0x1b, 0x0a, 0xfe, 0xaf,
+ 0x1a, 0x74, 0x8a, 0x7f, 0x87, 0xbc, 0x80, 0x56, 0xcc, 0x2f, 0x78, 0x8c, 0xfb, 0x1d, 0xdc, 0x7c,
+ 0x1d, 0x0a, 0x6a, 0xfc, 0xc9, 0x20, 0xaf, 0x9a, 0x7b, 0x07, 0x3b, 0x87, 0xd4, 0xf2, 0xe6, 0x02,
+ 0x95, 0x3f, 0x67, 0xdd, 0x5e, 0xad, 0xc2, 0xdc, 0x78, 0x0e, 0x2d, 0xe4, 0x49, 0x17, 0x30, 0x63,
+ 0x78, 0x8f, 0xb8, 0xd0, 0xf9, 0xf6, 0x96, 0x1e, 0xec, 0x1d, 0xec, 0x0e, 0x6b, 0xc4, 0x81, 0xd6,
+ 0x36, 0xa5, 0x87, 0x74, 0x58, 0x37, 0x9f, 0xef, 0xb7, 0x27, 0x5f, 0x77, 0x87, 0x8d, 0x09, 0xf9,
+ 0xd0, 0xf8, 0x3e, 0xc0, 0xe2, 0x41, 0xf9, 0xae, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x7a,
+ 0x33, 0x13, 0x62, 0x05, 0x00, 0x00,
}
diff --git a/ui/status/ninja_frontend/frontend.proto b/ui/status/ninja_frontend/frontend.proto
index baa0046..e5e5d9f 100644
--- a/ui/status/ninja_frontend/frontend.proto
+++ b/ui/status/ninja_frontend/frontend.proto
@@ -65,6 +65,20 @@
optional uint32 user_time = 5;
// Number of milliseconds spent executing in kernel mode
optional uint32 system_time = 6;
+ // Max resident set size in kB
+ optional uint64 max_rss_kb = 7;
+ // Minor page faults
+ optional uint64 minor_page_faults = 8;
+ // Major page faults
+ optional uint64 major_page_faults = 9;
+ // IO input in kB
+ optional uint64 io_input_kb = 10;
+ // IO output in kB
+ optional uint64 io_output_kb = 11;
+ // Voluntary context switches
+ optional uint64 voluntary_context_switches = 12;
+ // Involuntary context switches
+ optional uint64 involuntary_context_switches = 13;
}
message Message {
diff --git a/ui/status/status.go b/ui/status/status.go
index df33baa..a5b4a28 100644
--- a/ui/status/status.go
+++ b/ui/status/status.go
@@ -54,6 +54,37 @@
// Error is nil if the Action succeeded, or set to an error if it
// failed.
Error error
+
+ Stats ActionResultStats
+}
+
+type ActionResultStats struct {
+ // Number of milliseconds spent executing in user mode
+ UserTime uint32
+
+ // Number of milliseconds spent executing in kernel mode
+ SystemTime uint32
+
+ // Max resident set size in kB
+ MaxRssKB uint64
+
+ // Minor page faults
+ MinorPageFaults uint64
+
+ // Major page faults
+ MajorPageFaults uint64
+
+ // IO input in kB
+ IOInputKB uint64
+
+ // IO output in kB
+ IOOutputKB uint64
+
+ // Voluntary context switches
+ VoluntaryContextSwitches uint64
+
+ // Involuntary context switches
+ InvoluntaryContextSwitches uint64
}
// Counts describes the number of actions in each state
diff --git a/ui/tracer/status.go b/ui/tracer/status.go
index c831255..a8b4e62 100644
--- a/ui/tracer/status.go
+++ b/ui/tracer/status.go
@@ -80,9 +80,32 @@
Dur: uint64(time.Since(start.start).Nanoseconds()) / 1000,
Pid: 1,
Tid: uint64(start.cpu),
+ Arg: &statsArg{
+ UserTime: result.Stats.UserTime,
+ SystemTime: result.Stats.SystemTime,
+ MaxRssKB: result.Stats.MaxRssKB,
+ MinorPageFaults: result.Stats.MinorPageFaults,
+ MajorPageFaults: result.Stats.MajorPageFaults,
+ IOInputKB: result.Stats.IOInputKB,
+ IOOutputKB: result.Stats.IOOutputKB,
+ VoluntaryContextSwitches: result.Stats.VoluntaryContextSwitches,
+ InvoluntaryContextSwitches: result.Stats.InvoluntaryContextSwitches,
+ },
})
}
+type statsArg struct {
+ UserTime uint32 `json:"user_time"`
+ SystemTime uint32 `json:"system_time_ms"`
+ MaxRssKB uint64 `json:"max_rss_kb"`
+ MinorPageFaults uint64 `json:"minor_page_faults"`
+ MajorPageFaults uint64 `json:"major_page_faults"`
+ IOInputKB uint64 `json:"io_input_kb"`
+ IOOutputKB uint64 `json:"io_output_kb"`
+ VoluntaryContextSwitches uint64 `json:"voluntary_context_switches"`
+ InvoluntaryContextSwitches uint64 `json:"involuntary_context_switches"`
+}
+
func (s *statusOutput) Flush() {}
func (s *statusOutput) Message(level status.MsgLevel, message string) {}