Merge "Statically link the unwinder into binaries packaged into an unbundled APEX with legacy_android10_support: true."

This commit is contained in:
Peter Collingbourne
2020-02-18 18:12:37 +00:00
committed by Gerrit Code Review
5 changed files with 125 additions and 44 deletions

View File

@@ -95,6 +95,8 @@ type Deps struct {
HeaderLibs []string
RuntimeLibs []string
StaticUnwinderIfLegacy bool
ReexportSharedLibHeaders, ReexportStaticLibHeaders, ReexportHeaderLibHeaders []string
ObjFiles []string
@@ -385,6 +387,7 @@ var (
lateSharedDepTag = DependencyTag{Name: "late shared", Library: true, Shared: true}
staticExportDepTag = DependencyTag{Name: "static", Library: true, ReexportFlags: true}
lateStaticDepTag = DependencyTag{Name: "late static", Library: true}
staticUnwinderDepTag = DependencyTag{Name: "static unwinder", Library: true}
wholeStaticDepTag = DependencyTag{Name: "whole static", Library: true, ReexportFlags: true}
headerDepTag = DependencyTag{Name: "header", Library: true}
headerExportDepTag = DependencyTag{Name: "header", Library: true, ReexportFlags: true}
@@ -1788,6 +1791,12 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
}, depTag, lib)
}
if deps.StaticUnwinderIfLegacy && ctx.Config().UnbundledBuild() {
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "link", Variation: "static"},
}, staticUnwinderDepTag, staticUnwinder(actx))
}
for _, lib := range deps.LateStaticLibs {
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "link", Variation: "static"},
@@ -2161,6 +2170,14 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
}
}
if depTag == staticUnwinderDepTag {
if c.ApexProperties.Info.LegacyAndroid10Support {
depTag = StaticDepTag
} else {
return
}
}
// Extract ExplicitlyVersioned field from the depTag and reset it inside the struct.
// Otherwise, SharedDepTag and lateSharedDepTag with ExplicitlyVersioned set to true
// won't be matched to SharedDepTag and lateSharedDepTag.