aboutsummaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2017-01-26 17:44:26 -0800
committerDan Albert <danalbert@google.com>2017-01-26 17:44:26 -0800
commitdc2597d25a453cd26b99754efedc1101f114b2b8 (patch)
treee84880eb682a6b05207468fc6c674d451d2eb992 /cc
parent29c69e83dd1ef05e985d5bbee106d4dc29f2ca5e (diff)
downloadbuild_soong-dc2597d25a453cd26b99754efedc1101f114b2b8.tar.gz
build_soong-dc2597d25a453cd26b99754efedc1101f114b2b8.tar.bz2
build_soong-dc2597d25a453cd26b99754efedc1101f114b2b8.zip
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
Diffstat (limited to 'cc')
-rw-r--r--cc/binary.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cc/binary.go b/cc/binary.go
index 78883fae..d6a72a26 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -131,7 +131,7 @@ func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
}
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