Allow darwin targets to use -framework CoreFoundation.

Bug: http://b/31245118
Change-Id: I5aa6162715b643af4a3073e6e403a6e1729f7c15
diff --git a/cc/check.go b/cc/check.go
index 82d5a9f..bb2c9df 100644
--- a/cc/check.go
+++ b/cc/check.go
@@ -91,8 +91,8 @@
 		flag = strings.TrimSpace(flag)
 
 		// TODO: Probably should just redo this property to prefix -l in Soong
-		if !strings.HasPrefix(flag, "-l") {
-			ctx.PropertyErrorf(prop, "Invalid flag: `%s`, must start with `-l`", flag)
+		if !strings.HasPrefix(flag, "-l") && !strings.HasPrefix(flag, "-framework") {
+			ctx.PropertyErrorf(prop, "Invalid flag: `%s`, must start with `-l` or `-framework`", flag)
 		} else if !inList(flag, allowed_ldlibs) {
 			ctx.PropertyErrorf(prop, "Host library `%s` not available", flag)
 		}
diff --git a/cc/config/x86_darwin_host.go b/cc/config/x86_darwin_host.go
index e89fc9c..1a4972e 100644
--- a/cc/config/x86_darwin_host.go
+++ b/cc/config/x86_darwin_host.go
@@ -91,14 +91,14 @@
 		"10.11",
 	}
 
-	darwinAvailableLibraries = addPrefix([]string{
+	darwinAvailableLibraries = append(addPrefix([]string{
 		"c",
 		"dl",
 		"m",
 		"ncurses",
 		"pthread",
 		"z",
-	}, "-l")
+	}, "-l"), "-framework CoreFoundation")
 )
 
 const (