vendor_available:false hides a lib from vendors

When a lib is explicitly marked as `vendor_available: false`, then it
can't be directly depended by a vendor lib which is installed to /vendor
partition. This is to hide some VNDK libs (including llndk) from vendors
so that platform owners can have a freedom of modifying their ABI
without breaking vendors.

In addition, the list of the private libs are exported to the make world
as VNDK_PRIVATE_LIBRARIES.

Also, fixed a bug that allowed a vndk lib to link against to vendor
library (or vendor variant of a system lib) if the lib is prebuilt.

Bug: 64730695
Bug: 64994918
Test: Add `vendor_available: false` to libft2 and libcompiler_rt.
Add the libs to shared_libs property of a vendor library in soong
(i.e. libnbaio_mono). The build fails with the error message.

Change-Id: Iab575db96bb4f6739a592f3fa0a75124296bea0c
This commit is contained in:
Jiyong Park
2017-08-16 14:05:54 +09:00
parent c7ba6a2e46
commit 82e2bf3b7f
5 changed files with 85 additions and 30 deletions

View File

@@ -89,7 +89,7 @@ func (c *Module) AndroidMk() android.AndroidMkData {
}
c.subAndroidMk(&ret, c.installer)
if c.vndk() && Bool(c.VendorProperties.Vendor_available) {
if c.vndk() && c.hasVendorVariant() {
// .vendor suffix is added only when we will have two variants: core and vendor.
// The suffix is not added for vendor-only module.
ret.SubName += vendorSuffix