Clean up LLNDK stubs

So far we created {"", "current"} stubs for LLNDK modules. But we don't
need "current" because "" itself is a stub.

This change only removes unused LLNDK stub modules with "current"
version, which aren't used at all.

Bug: 329183083
Test: m blueprint_tests
Change-Id: Ib8e880b6d88952b489657ea1ac557a48afe562a4
This commit is contained in:
Jooyung Han 2024-03-12 14:12:12 +09:00
parent 64342427b8
commit 5e8994e5ed
3 changed files with 7 additions and 10 deletions

View file

@ -2068,7 +2068,7 @@ func TestApexMinSdkVersion_InVendorApex(t *testing.T) {
// Ensure that mylib links with "current" LLNDK
libFlags := names(mylib.Rule("ld").Args["libFlags"])
ensureListContains(t, libFlags, "out/soong/.intermediates/libbar/"+vendorVariant+"_shared_current/libbar.so")
ensureListContains(t, libFlags, "out/soong/.intermediates/libbar/"+vendorVariant+"_shared/libbar.so")
// Ensure that mylib is targeting 29
ccRule := ctx.ModuleForTests("mylib", vendorVariant+"_static_apex29").Output("obj/mylib.o")

View file

@ -2680,9 +2680,7 @@ func TestLlndkLibrary(t *testing.T) {
}
}
expected := []string{
"android_vendor.29_arm64_armv8-a_shared_current",
"android_vendor.29_arm64_armv8-a_shared",
"android_vendor.29_arm_armv7-a-neon_shared_current",
"android_vendor.29_arm_armv7-a-neon_shared",
}
android.AssertArrayString(t, "variants for llndk stubs", expected, actual)

View file

@ -1913,12 +1913,15 @@ func (library *libraryDecorator) stubsVersions(ctx android.BaseMutatorContext) [
}
if library.hasLLNDKStubs() && ctx.Module().(*Module).InVendorOrProduct() {
// LLNDK libraries only need a single stubs variant.
return []string{android.FutureApiLevel.String()}
// LLNDK libraries only need a single stubs variant (""), which is
// added automatically in createVersionVariations().
return nil
}
// Future API level is implicitly added if there isn't
return addCurrentVersionIfNotPresent(library.Properties.Stubs.Versions)
versions := addCurrentVersionIfNotPresent(library.Properties.Stubs.Versions)
normalizeVersions(ctx, versions)
return versions
}
func addCurrentVersionIfNotPresent(vers []string) []string {
@ -2290,10 +2293,6 @@ func setStubsVersions(mctx android.BottomUpMutatorContext, library libraryInterf
return
}
versions := library.stubsVersions(mctx)
if len(versions) <= 0 {
return
}
normalizeVersions(mctx, versions)
if mctx.Failed() {
return
}