Implement cc_object vendor snapshot

cc_object modules are also necessary for vendor snapshot.

Bug: 157106227
Test: m vendor-snapshot
Change-Id: Idf4fd37a26f6f712f3cbab43133622f9f9bd9372
Merged-In: Idf4fd37a26f6f712f3cbab43133622f9f9bd9372
(cherry picked from commit 502679e061)
This commit is contained in:
Inseob Kim
2020-06-01 23:23:05 +09:00
parent 7f283f4bd0
commit 1042d29705
7 changed files with 186 additions and 15 deletions

View File

@@ -317,6 +317,7 @@ type ModuleContextIntf interface {
staticBinary() bool
header() bool
binary() bool
object() bool
toolchain() config.Toolchain
canUseSdk() bool
useSdk() bool
@@ -1018,14 +1019,8 @@ func (c *Module) nativeCoverage() bool {
}
func (c *Module) isSnapshotPrebuilt() bool {
if _, ok := c.linker.(*vndkPrebuiltLibraryDecorator); ok {
return true
}
if _, ok := c.linker.(*vendorSnapshotLibraryDecorator); ok {
return true
}
if _, ok := c.linker.(*vendorSnapshotBinaryDecorator); ok {
return true
if p, ok := c.linker.(interface{ isSnapshotPrebuilt() bool }); ok {
return p.isSnapshotPrebuilt()
}
return false
}
@@ -1134,6 +1129,10 @@ func (ctx *moduleContextImpl) binary() bool {
return ctx.mod.binary()
}
func (ctx *moduleContextImpl) object() bool {
return ctx.mod.object()
}
func (ctx *moduleContextImpl) canUseSdk() bool {
return ctx.mod.canUseSdk()
}
@@ -2011,11 +2010,13 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
actx.AddVariationDependencies(nil, objDepTag, deps.ObjFiles...)
vendorSnapshotObjects := vendorSnapshotObjects(actx.Config())
if deps.CrtBegin != "" {
actx.AddVariationDependencies(nil, CrtBeginDepTag, deps.CrtBegin)
actx.AddVariationDependencies(nil, CrtBeginDepTag, rewriteSnapshotLibs(deps.CrtBegin, vendorSnapshotObjects))
}
if deps.CrtEnd != "" {
actx.AddVariationDependencies(nil, CrtEndDepTag, deps.CrtEnd)
actx.AddVariationDependencies(nil, CrtEndDepTag, rewriteSnapshotLibs(deps.CrtEnd, vendorSnapshotObjects))
}
if deps.LinkerFlagsFile != "" {
actx.AddDependency(c, linkerFlagsDepTag, deps.LinkerFlagsFile)
@@ -2766,6 +2767,15 @@ func (c *Module) binary() bool {
return false
}
func (c *Module) object() bool {
if o, ok := c.linker.(interface {
object() bool
}); ok {
return o.object()
}
return false
}
func (c *Module) getMakeLinkType(actx android.ModuleContext) string {
if c.UseVndk() {
if lib, ok := c.linker.(*llndkStubDecorator); ok {