Monitor the ABI declared in CommonGlobalIncludes

The modules linked with the libraries in APEX implicitly include
CommonGlobalIncludes. A function declared in CommonGlobalIncludes can be
defined in any APEX. Therefore the ABI tool should consider
CommonGlobalIncludes to be exported by every APEX.

Test: make
Bug: 385733305
Change-Id: Iae08a42e17f8131e9e0f71b3899b96f62d5f741a
diff --git a/cc/compiler.go b/cc/compiler.go
index f2bced1..b478e10 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -324,6 +324,10 @@
 	getNamedMapForConfig(ctx.Config(), key).Store(module, true)
 }
 
+func requiresGlobalIncludes(ctx ModuleContext) bool {
+	return !(ctx.useSdk() || ctx.InVendorOrProduct()) || ctx.Host()
+}
+
 func useGnuExtensions(gnuExtensions *bool) bool {
 	return proptools.BoolDefault(gnuExtensions, true)
 }
@@ -429,7 +433,7 @@
 		flags.Local.YasmFlags = append(flags.Local.YasmFlags, "-I"+modulePath)
 	}
 
-	if !(ctx.useSdk() || ctx.InVendorOrProduct()) || ctx.Host() {
+	if requiresGlobalIncludes(ctx) {
 		flags.SystemIncludeFlags = append(flags.SystemIncludeFlags,
 			"${config.CommonGlobalIncludes}",
 			tc.IncludeFlags())