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/llndk_library.go b/cc/llndk_library.go
index c3d3462..30c4d4c 100644
--- a/cc/llndk_library.go
+++ b/cc/llndk_library.go
@@ -50,6 +50,11 @@
// Whether the system library uses symbol versions.
Unversioned bool
+
+ // whether this module can be directly depended upon by libs that are installed to /vendor.
+ // When set to false, this module can only be depended on by VNDK libraries, not vendor
+ // libraries. This effectively hides this module from vendors. Default value is true.
+ Vendor_available bool
}
type llndkStubDecorator struct {
@@ -149,6 +154,7 @@
stub := &llndkStubDecorator{
libraryDecorator: library,
}
+ stub.Properties.Vendor_available = true
module.compiler = stub
module.linker = stub
module.installer = nil