Add support for no-vendor-variant VNDK

When no-vendor-variant VNDK is enabled, the vendor variant of VNDK
libraries are not installed.  Since not all VNDK libraries will be
ready for this, we keep a list of library names in cc/vndk.go to
indicate which libraries must have their vendor variants always
installed regardless of whether no-vendor-variant VNDK is enabled.

Also add --remove-build-id option to the strip script to facilitate
the check of functional identity of the two variants.

Bug: 119423884
Test: Add a dummy VNDK library and build with
      TARGET_VNDK_USE_CORE_VARIANT := true, with the corresponding
      build/make change.

Change-Id: Ieb1589488690e1cef1e310669a8b47a8b8759dac
diff --git a/cc/vndk.go b/cc/vndk.go
index 623097d..44a83e7 100644
--- a/cc/vndk.go
+++ b/cc/vndk.go
@@ -21,6 +21,7 @@
 	"sync"
 
 	"android/soong/android"
+	"android/soong/cc/config"
 )
 
 type VndkProperties struct {
@@ -191,11 +192,12 @@
 }
 
 var (
-	vndkCoreLibraries    []string
-	vndkSpLibraries      []string
-	llndkLibraries       []string
-	vndkPrivateLibraries []string
-	vndkLibrariesLock    sync.Mutex
+	vndkCoreLibraries             []string
+	vndkSpLibraries               []string
+	llndkLibraries                []string
+	vndkPrivateLibraries          []string
+	vndkUsingCoreVariantLibraries []string
+	vndkLibrariesLock             sync.Mutex
 )
 
 // gather list of vndk-core, vndk-sp, and ll-ndk libs
@@ -223,6 +225,12 @@
 				if m.vndkdep.isVndk() && !m.vndkdep.isVndkExt() {
 					vndkLibrariesLock.Lock()
 					defer vndkLibrariesLock.Unlock()
+					if mctx.DeviceConfig().VndkUseCoreVariant() && !inList(name, config.VndkMustUseVendorVariantList) {
+						if !inList(name, vndkUsingCoreVariantLibraries) {
+							vndkUsingCoreVariantLibraries = append(vndkUsingCoreVariantLibraries, name)
+							sort.Strings(vndkUsingCoreVariantLibraries)
+						}
+					}
 					if m.vndkdep.isVndkSp() {
 						if !inList(name, vndkSpLibraries) {
 							vndkSpLibraries = append(vndkSpLibraries, name)