Remove versioned LLNDK stubs

Nothing links against the versioned LLNDK stubs, only current and the
implementation are used.  Remove the numbered LLNDK variants.

Also remove llndkStubDepTag, it is never used to add a dependency.

Test: TestLlndkLibrary
Change-Id: Idde62007d77b8e6ceee31144c05756faf9b41f23
This commit is contained in:
Colin Cross
2021-05-06 13:42:48 -07:00
parent 57892ceafb
commit c1b3644e91
3 changed files with 8 additions and 21 deletions

View File

@@ -726,7 +726,6 @@ var (
runtimeDepTag = installDependencyTag{name: "runtime lib"}
testPerSrcDepTag = dependencyTag{name: "test_per_src"}
stubImplDepTag = dependencyTag{name: "stub_impl"}
llndkStubDepTag = dependencyTag{name: "llndk stub"}
)
type copyDirectlyInAnyApexDependencyTag dependencyTag
@@ -3224,8 +3223,8 @@ func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Modu
return false
}
}
if depTag == stubImplDepTag || depTag == llndkStubDepTag {
// We don't track beyond LLNDK or from an implementation library to its stubs.
if depTag == stubImplDepTag {
// We don't track from an implementation library to its stubs.
return false
}
if depTag == staticVariantTag {

View File

@@ -2792,12 +2792,8 @@ func TestLlndkLibrary(t *testing.T) {
}
}
expected := []string{
"android_vendor.29_arm64_armv8-a_shared_1",
"android_vendor.29_arm64_armv8-a_shared_2",
"android_vendor.29_arm64_armv8-a_shared_current",
"android_vendor.29_arm64_armv8-a_shared",
"android_vendor.29_arm_armv7-a-neon_shared_1",
"android_vendor.29_arm_armv7-a-neon_shared_2",
"android_vendor.29_arm_armv7-a-neon_shared_current",
"android_vendor.29_arm_armv7-a-neon_shared",
}
@@ -2806,9 +2802,6 @@ func TestLlndkLibrary(t *testing.T) {
params := result.ModuleForTests("libllndk", "android_vendor.29_arm_armv7-a-neon_shared").Description("generate stub")
android.AssertSame(t, "use VNDK version for default stubs", "current", params.Args["apiLevel"])
params = result.ModuleForTests("libllndk", "android_vendor.29_arm_armv7-a-neon_shared_1").Description("generate stub")
android.AssertSame(t, "override apiLevel for versioned stubs", "1", params.Args["apiLevel"])
checkExportedIncludeDirs := func(module, variant string, expectedDirs ...string) {
t.Helper()
m := result.ModuleForTests(module, variant).Module()

View File

@@ -1769,6 +1769,11 @@ func (library *libraryDecorator) stubsVersions(ctx android.BaseMutatorContext) [
return nil
}
if library.hasLLNDKStubs() && ctx.Module().(*Module).UseVndk() {
// LLNDK libraries only need a single stubs variant.
return []string{android.FutureApiLevel.String()}
}
// Future API level is implicitly added if there isn't
vers := library.Properties.Stubs.Versions
if inList(android.FutureApiLevel.String(), vers) {
@@ -2110,8 +2115,7 @@ func moduleLibraryInterface(module blueprint.Module) libraryInterface {
return nil
}
// versionSelector normalizes the versions in the Stubs.Versions property into MutatedProperties.AllStubsVersions,
// and propagates the value from implementation libraries to llndk libraries with the same name.
// versionSelector normalizes the versions in the Stubs.Versions property into MutatedProperties.AllStubsVersions.
func versionSelectorMutator(mctx android.BottomUpMutatorContext) {
if library := moduleLibraryInterface(mctx.Module()); library != nil && CanBeVersionVariant(mctx.Module().(*Module)) {
if library.buildShared() {
@@ -2125,15 +2129,6 @@ func versionSelectorMutator(mctx android.BottomUpMutatorContext) {
// depend on the implementation library and haven't been mutated yet.
library.setAllStubsVersions(versions)
}
if mctx.Module().(*Module).UseVndk() && library.hasLLNDKStubs() {
// Propagate the version to the llndk stubs module.
mctx.VisitDirectDepsWithTag(llndkStubDepTag, func(stubs android.Module) {
if stubsLib := moduleLibraryInterface(stubs); stubsLib != nil {
stubsLib.setAllStubsVersions(library.allStubsVersions())
}
})
}
}
}
}