Fix DepsInSameApex for some dependencies of static libraries

The implementation before libraryDependencyTag was added failed to
treat shared library dependencies with reexported headers on a
static library as crossing the apex boundary because the dependency
tag was overwritten from SharedFromStaticDepTag to sharedExportDepTag,
causing FromStatic to be false.

Bug: 162437057
Test: m checkbuild
Change-Id: I514b90aeb0f1477045e92b46d17336d4fb2fb62c
This commit is contained in:
Colin Cross 2020-07-29 12:51:56 -07:00
parent 370173e0af
commit aac3222cdf
1 changed files with 1 additions and 3 deletions

View File

@ -2989,9 +2989,7 @@ func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Modu
return false
}
}
// TODO(ccross): The libDepTag.reexportFlags is there to maintain previous behavior
// when adding libraryDependencyTag and should be removed.
if isLibDepTag && c.static() && libDepTag.shared() && !libDepTag.reexportFlags {
if isLibDepTag && c.static() && libDepTag.shared() {
// 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.