Add LLNDK support for the VNDK

Instead of using the NDK headers and libraries, add LL-NDK specific
headers and library stubs for VNDK users. This allows us to provide an
expanded liblog interface.

Test: aosp_arm; m -j
Test: Enable BOARD_VNDK_VERSION on aosp_arm; m -j
Test: Inspect out/soong/build.ninja before/after (w/o vndk)
Change-Id: Ic85f07fa10c695b5baab10c41f5e0ad38700bf3d
diff --git a/cc/cc.go b/cc/cc.go
index 6f5539f..3ed1d7e 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -638,7 +638,7 @@
 
 	variantNdkLibs := []string{}
 	variantLateNdkLibs := []string{}
-	if ctx.sdk() || ctx.vndk() {
+	if ctx.Os() == android.Android {
 		version := ctx.sdkVersion()
 
 		// Rewrites the names of shared libraries into the names of the NDK
@@ -655,12 +655,14 @@
 			variantLibs := []string{}
 			nonvariantLibs := []string{}
 			for _, entry := range list {
-				if inList(entry, ndkPrebuiltSharedLibraries) {
+				if ctx.sdk() && inList(entry, ndkPrebuiltSharedLibraries) {
 					if !inList(entry, ndkMigratedLibs) {
 						nonvariantLibs = append(nonvariantLibs, entry+".ndk."+version)
 					} else {
 						variantLibs = append(variantLibs, entry+ndkLibrarySuffix)
 					}
+				} else if ctx.vndk() && inList(entry, config.LLndkLibraries()) {
+					nonvariantLibs = append(nonvariantLibs, entry+llndkLibrarySuffix)
 				} else {
 					nonvariantLibs = append(nonvariantLibs, entry)
 				}