Merge "VNDK APEX should not provide native libs" am: 552d4730c3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1335522 Change-Id: I4a98e13de0f1abf32b8d8422b4b27f2f1d167a2e
This commit is contained in:
@@ -1954,8 +1954,10 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
fi := apexFileForNativeLibrary(ctx, c, handleSpecialLibs)
|
fi := apexFileForNativeLibrary(ctx, c, handleSpecialLibs)
|
||||||
fi.isJniLib = isJniLib
|
fi.isJniLib = isJniLib
|
||||||
filesInfo = append(filesInfo, fi)
|
filesInfo = append(filesInfo, fi)
|
||||||
// bootstrap bionic libs are treated as provided by system
|
// Collect the list of stub-providing libs except:
|
||||||
if c.HasStubsVariants() && !cc.InstallToBootstrap(c.BaseModuleName(), ctx.Config()) {
|
// - VNDK libs are only for vendors
|
||||||
|
// - bootstrap bionic libs are treated as provided by system
|
||||||
|
if c.HasStubsVariants() && !a.vndkApex && !cc.InstallToBootstrap(c.BaseModuleName(), ctx.Config()) {
|
||||||
provideNativeLibs = append(provideNativeLibs, fi.Stem())
|
provideNativeLibs = append(provideNativeLibs, fi.Stem())
|
||||||
}
|
}
|
||||||
return true // track transitive dependencies
|
return true // track transitive dependencies
|
||||||
|
@@ -2817,6 +2817,40 @@ func TestVndkApexWithBinder32(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestVndkApexShouldNotProvideNativeLibs(t *testing.T) {
|
||||||
|
ctx, _ := testApex(t, `
|
||||||
|
apex_vndk {
|
||||||
|
name: "myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
file_contexts: ":myapex-file_contexts",
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libz",
|
||||||
|
vendor_available: true,
|
||||||
|
vndk: {
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
stubs: {
|
||||||
|
symbol_file: "libz.map.txt",
|
||||||
|
versions: ["30"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`+vndkLibrariesTxtFiles("current"), withFiles(map[string][]byte{
|
||||||
|
"libz.map.txt": nil,
|
||||||
|
}))
|
||||||
|
|
||||||
|
apexManifestRule := ctx.ModuleForTests("myapex", "android_common_image").Rule("apexManifestRule")
|
||||||
|
provideNativeLibs := names(apexManifestRule.Args["provideNativeLibs"])
|
||||||
|
ensureListEmpty(t, provideNativeLibs)
|
||||||
|
}
|
||||||
|
|
||||||
func TestDependenciesInApexManifest(t *testing.T) {
|
func TestDependenciesInApexManifest(t *testing.T) {
|
||||||
ctx, _ := testApex(t, `
|
ctx, _ := testApex(t, `
|
||||||
apex {
|
apex {
|
||||||
|
Reference in New Issue
Block a user