Loading cc/cc.go +15 −4 Original line number Diff line number Diff line Loading @@ -1780,6 +1780,9 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) { for _, lib := range deps.SharedLibs { depTag := SharedDepTag if c.static() { depTag = SharedFromStaticDepTag } if inList(lib, deps.ReexportSharedLibHeaders) { depTag = sharedExportDepTag } Loading Loading @@ -2197,7 +2200,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps { depFile := android.OptionalPath{} switch depTag { case ndkStubDepTag, SharedDepTag, sharedExportDepTag: case ndkStubDepTag, SharedDepTag, SharedFromStaticDepTag, sharedExportDepTag: ptr = &depPaths.SharedLibs depPtr = &depPaths.SharedLibsDeps depFile = ccDep.Toc() Loading Loading @@ -2550,10 +2553,18 @@ func (c *Module) AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Write func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool { 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 { if cc.HasStubsVariants() && depTag.Shared && depTag.Library { // 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 } Loading cc/linkable.go +5 −0 Original line number Diff line number Diff line Loading @@ -67,12 +67,17 @@ type DependencyTag struct { ReexportFlags bool ExplicitlyVersioned bool FromStatic bool } var ( SharedDepTag = DependencyTag{Name: "shared", Library: true, Shared: 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"} CrtEndDepTag = DependencyTag{Name: "crtend"} ) Loading
cc/cc.go +15 −4 Original line number Diff line number Diff line Loading @@ -1780,6 +1780,9 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) { for _, lib := range deps.SharedLibs { depTag := SharedDepTag if c.static() { depTag = SharedFromStaticDepTag } if inList(lib, deps.ReexportSharedLibHeaders) { depTag = sharedExportDepTag } Loading Loading @@ -2197,7 +2200,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps { depFile := android.OptionalPath{} switch depTag { case ndkStubDepTag, SharedDepTag, sharedExportDepTag: case ndkStubDepTag, SharedDepTag, SharedFromStaticDepTag, sharedExportDepTag: ptr = &depPaths.SharedLibs depPtr = &depPaths.SharedLibsDeps depFile = ccDep.Toc() Loading Loading @@ -2550,10 +2553,18 @@ func (c *Module) AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Write func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool { 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 { if cc.HasStubsVariants() && depTag.Shared && depTag.Library { // 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 } Loading
cc/linkable.go +5 −0 Original line number Diff line number Diff line Loading @@ -67,12 +67,17 @@ type DependencyTag struct { ReexportFlags bool ExplicitlyVersioned bool FromStatic bool } var ( SharedDepTag = DependencyTag{Name: "shared", Library: true, Shared: 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"} CrtEndDepTag = DependencyTag{Name: "crtend"} )