Don't force libraries upon static executables.
The linker uses libc++_static but needs to avoid the libc.a
dependency. It does this by setting `stl: "none"` and manually
linking libc++. This behavior matches make.
A better approach would probably be to generalize system_shared_libs
to system_libs and apply those to static executables the same way we
do for dynamic ones, but that's a patch for another day.
Test: make checkbuild
Bug: http://b/34740564
Change-Id: Ie9da0d49a453a220593e8ec2ee721e9af9378007
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