Disallow shared libraries in bootclasspath_fragment contents

Bug: 177892522
Test: m nothing
Change-Id: I78c8ef8664ec1eb0fe3456a2de2cb956162ca0da
This commit is contained in:
Paul Duffin
2021-05-13 22:34:45 +01:00
parent 0589914135
commit f4600f6e6a
4 changed files with 37 additions and 22 deletions

View File

@@ -372,7 +372,11 @@ func (b *BootclasspathFragmentModule) GenerateAndroidBuildActions(ctx android.Mo
ctx.VisitDirectDeps(func(module android.Module) {
tag := ctx.OtherModuleDependencyTag(module)
if IsBootclasspathFragmentContentDepTag(tag) {
contents = append(contents, module)
if sdkLibrary, ok := module.(SdkLibraryDependency); ok && sdkLibrary.sharedLibrary() {
ctx.PropertyErrorf("contents", "invalid module: %s, shared libraries cannot be on the bootclasspath", ctx.OtherModuleName(module))
} else {
contents = append(contents, module)
}
}
})