From ea97f51a2901d1285132f4e7c6ad169e5d68da71 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 31 Mar 2020 15:31:17 +0900 Subject: [PATCH] Don't allow a lib having stubs to become a member of VNDK If a lib has stubs, that means the library provides stable C APIs and the APIs are guaranteed to be maintained in a backwards compatible manner. Then there is no reason to have the same library in VNDK, because VNDK is for libraries (usually having C++ interfaces) where API stability across the yearly releases is hard (or impossible) to be guaranteed. This change triggers an error when the build system finds a VNDK lib which has stubs defined. Users are suggested to make the lib an LLNDK one. Bug: 151303316 Test: m Change-Id: Id305196a9d5a6fc7e7f9c02f3fa076859dc9a282 --- cc/vndk.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cc/vndk.go b/cc/vndk.go index 4888dcf07..73ff38bab 100644 --- a/cc/vndk.go +++ b/cc/vndk.go @@ -309,6 +309,10 @@ func processVndkLibrary(mctx android.BottomUpMutatorContext, m *Module) { panic(err) } + if m.HasStubsVariants() { + mctx.PropertyErrorf("vndk.enabled", "This library provides stubs. Shouldn't be VNDK. Consider making it as LLNDK") + } + vndkLibrariesLock.Lock() defer vndkLibrariesLock.Unlock()