Allow cc_object to use libc headers under the VNDK

Bionic headers aren't implicit when building with the VNDK, they're
exported from libc. So add libc to the shared libraries of a cc_object
if it wants the standard flags.

Removes a duplicate No_default_compiler_flags

Test: Add cc_object with vendor_available, build on aosp_arm64_ab (VNDK-enabled)
Change-Id: I9bfcd1e1a65de4edc597bd348b79d625ecae4f5e
diff --git a/cc/linker.go b/cc/linker.go
index 59c979d..7c997d5 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -43,10 +43,6 @@
 	// list of module-specific flags that will be used for all link steps
 	Ldflags []string `android:"arch_variant"`
 
-	// don't insert default compiler flags into asflags, cflags,
-	// cppflags, conlyflags, ldflags, or include_dirs
-	No_default_compiler_flags *bool
-
 	// list of system libraries that will be dynamically linked to
 	// shared library and executable modules.  If unset, generally defaults to libc,
 	// libm, and libdl.  Set to [] to prevent linking against the defaults.
diff --git a/cc/object.go b/cc/object.go
index 1478908..3cc089c 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -53,6 +53,11 @@
 func (*objectLinker) linkerInit(ctx BaseModuleContext) {}
 
 func (object *objectLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
+	if !ctx.noDefaultCompilerFlags() && ctx.toolchain().Bionic() {
+		// Needed for VNDK builds where bionic headers aren't automatically added.
+		deps.LateSharedLibs = append(deps.LateSharedLibs, "libc")
+	}
+
 	deps.ObjFiles = append(deps.ObjFiles, object.Properties.Objs...)
 	return deps
 }