Merge "Fixed androidmk crash when parsing external/aac/Android.mk"
diff --git a/cc/binary.go b/cc/binary.go
index 78883fa..d6a72a2 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -131,7 +131,7 @@
 		}
 
 		if binary.static() {
-			if inList("libc++_static", deps.StaticLibs) {
+			if ctx.selectedStl() == "libc++_static" {
 				deps.StaticLibs = append(deps.StaticLibs, "libm", "libc", "libdl")
 			}
 			// static libraries libcompiler_rt, libc and libc_nomalloc need to be linked with