Refactor ccDynamic for static binaries

ccLibrary uses ccDynamic for linking shared libraries, but bypasses
it by calling directly into ccBase for static libraries.  Instead of
duplicating the same mess for ccBinary, rename ccDynamic to ccLinked
and add the logic for dealing with static or shared linkage.  This
also allows moving the stl logic out of ccBase and into ccLinked.

Change-Id: Idfa6d86de16911c8851f694d6ed92681c8939281
diff --git a/cc/util.go b/cc/util.go
index e0effeb..db14c74 100644
--- a/cc/util.go
+++ b/cc/util.go
@@ -69,6 +69,18 @@
 	return false
 }
 
+func filterList(list []string, filter []string) (remainder []string, filtered []string) {
+	for _, l := range list {
+		if inList(l, filter) {
+			filtered = append(filtered, l)
+		} else {
+			remainder = append(remainder, l)
+		}
+	}
+
+	return
+}
+
 var libNameRegexp = regexp.MustCompile(`^lib(.*)$`)
 
 func moduleToLibName(module string) (string, error) {