Merge changes from topic "apex_available" am: 1fd192302c am: f64951518d

Change-Id: Iae64e583e4ae3470da681a8ab4848a0f662bb602
This commit is contained in:
Automerger Merge Worker
2020-02-06 23:33:16 +00:00
2 changed files with 20 additions and 4 deletions

View File

@@ -1780,6 +1780,9 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
for _, lib := range deps.SharedLibs { for _, lib := range deps.SharedLibs {
depTag := SharedDepTag depTag := SharedDepTag
if c.static() {
depTag = SharedFromStaticDepTag
}
if inList(lib, deps.ReexportSharedLibHeaders) { if inList(lib, deps.ReexportSharedLibHeaders) {
depTag = sharedExportDepTag depTag = sharedExportDepTag
} }
@@ -2197,7 +2200,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
depFile := android.OptionalPath{} depFile := android.OptionalPath{}
switch depTag { switch depTag {
case ndkStubDepTag, SharedDepTag, sharedExportDepTag: case ndkStubDepTag, SharedDepTag, SharedFromStaticDepTag, sharedExportDepTag:
ptr = &depPaths.SharedLibs ptr = &depPaths.SharedLibs
depPtr = &depPaths.SharedLibsDeps depPtr = &depPaths.SharedLibsDeps
depFile = ccDep.Toc() depFile = ccDep.Toc()
@@ -2550,9 +2553,17 @@ func (c *Module) AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Write
func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool { func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
if depTag, ok := ctx.OtherModuleDependencyTag(dep).(DependencyTag); ok { if depTag, ok := ctx.OtherModuleDependencyTag(dep).(DependencyTag); ok {
if cc, ok := dep.(*Module); ok && cc.HasStubsVariants() && depTag.Shared && depTag.Library { if cc, ok := dep.(*Module); ok {
// dynamic dep to a stubs lib crosses APEX boundary if cc.HasStubsVariants() && depTag.Shared && depTag.Library {
return false // dynamic dep to a stubs lib crosses APEX boundary
return false
}
if depTag.FromStatic {
// shared_lib dependency from a static lib is considered as crossing
// the APEX boundary because the dependency doesn't actually is
// linked; the dependency is used only during the compilation phase.
return false
}
} }
} }
return true return true

View File

@@ -67,12 +67,17 @@ type DependencyTag struct {
ReexportFlags bool ReexportFlags bool
ExplicitlyVersioned bool ExplicitlyVersioned bool
FromStatic bool
} }
var ( var (
SharedDepTag = DependencyTag{Name: "shared", Library: true, Shared: true} SharedDepTag = DependencyTag{Name: "shared", Library: true, Shared: true}
StaticDepTag = DependencyTag{Name: "static", Library: true} StaticDepTag = DependencyTag{Name: "static", Library: true}
// Same as SharedDepTag, but from a static lib
SharedFromStaticDepTag = DependencyTag{Name: "shared from static", Library: true, Shared: true, FromStatic: true}
CrtBeginDepTag = DependencyTag{Name: "crtbegin"} CrtBeginDepTag = DependencyTag{Name: "crtbegin"}
CrtEndDepTag = DependencyTag{Name: "crtend"} CrtEndDepTag = DependencyTag{Name: "crtend"}
) )