Use SystemSharedLibs as StaticLibs for static executables

Shared libraries are ignored for static executables, treat
SystemSharedLibs as StaticLibs to avoid every static executable
having to list libc as a static dependency.

Test: m checkbuild
Change-Id: I02442a1a2a8d4164ec3dd389a16da2346e2d8751
This commit is contained in:
Colin Cross 2021-08-18 13:52:09 -07:00
parent 60880e0517
commit 450744e718

View file

@ -156,6 +156,10 @@ func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
}
}
if binary.static() {
deps.StaticLibs = append(deps.StaticLibs, deps.SystemSharedLibs...)
}
if ctx.toolchain().Bionic() {
if binary.static() {
if ctx.selectedStl() == "libc++_static" {