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
diff --git a/cc/androidmk.go b/cc/androidmk.go
index eb63065..2114031 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -89,7 +89,7 @@
}
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