Refine logic choosing vendor snapshot modules

This refines the vendor snapshot codes in order to fix logic errors.

- Capture toolchain_library and cc_library_headers correctly.
- Redirect unwind static library correctly.
- Filter out sanitize / coverage / lto by looking at HideFromMake.
- Add binary() function for clear and shorter codes.
- Include test modules.
- Add more tests to prevent further snapshot breakages.

Bug: 157106227
Test: m vendor-snapshot
Test: m nothing for all available targets
Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true \
NATIVE_COVERAGE=true COVERAGE_PATHS="*" m nothing

Change-Id: Id90082b5ab730f928582ad24f022ba410855400e
Merged-In: Id90082b5ab730f928582ad24f022ba410855400e
(cherry picked from commit 4d8d8fec4a)
This commit is contained in:
Inseob Kim
2020-06-01 21:53:49 +09:00
parent 5539e7b568
commit 7f283f4bd0
6 changed files with 99 additions and 43 deletions

View File

@@ -316,6 +316,7 @@ type ModuleContextIntf interface {
static() bool
staticBinary() bool
header() bool
binary() bool
toolchain() config.Toolchain
canUseSdk() bool
useSdk() bool
@@ -1129,6 +1130,10 @@ func (ctx *moduleContextImpl) header() bool {
return ctx.mod.header()
}
func (ctx *moduleContextImpl) binary() bool {
return ctx.mod.binary()
}
func (ctx *moduleContextImpl) canUseSdk() bool {
return ctx.mod.canUseSdk()
}
@@ -1925,7 +1930,7 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
if deps.StaticUnwinderIfLegacy {
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "link", Variation: "static"},
}, staticUnwinderDepTag, staticUnwinder(actx))
}, staticUnwinderDepTag, rewriteSnapshotLibs(staticUnwinder(actx), vendorSnapshotStaticLibs))
}
for _, lib := range deps.LateStaticLibs {
@@ -2752,6 +2757,15 @@ func (c *Module) header() bool {
return false
}
func (c *Module) binary() bool {
if b, ok := c.linker.(interface {
binary() bool
}); ok {
return b.binary()
}
return false
}
func (c *Module) getMakeLinkType(actx android.ModuleContext) string {
if c.UseVndk() {
if lib, ok := c.linker.(*llndkStubDecorator); ok {