Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebdf61ec authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Remove versioned LLNDK stubs"

parents c5e4a075 c1b3644e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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"}
)

func IsSharedDepTag(depTag blueprint.DependencyTag) bool {
@@ -3238,8 +3237,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 {
+0 −7
Original line number Diff line number Diff line
@@ -2799,12 +2799,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",
	}
@@ -2813,9 +2809,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()
+6 −11
Original line number Diff line number Diff line
@@ -1813,6 +1813,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) {
@@ -2154,8 +2159,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() {
@@ -2169,15 +2173,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())
					}
				})
			}
		}
	}
}