Apply system_shared_libs to all variants
Remove the odd semantics of system_shared_libs that ignore the property
for non-bionic variants by always honoring it. For the common case
of system_shared_libs: [] this is generally correct, a non-bionic
variant of a module that doesn't compile against bionic libc probably
also doesn't want some other libc. For modules that use something
like system_shard_libs: ["libc"] to link against libc but not libdl
and libm this may cause problems, as it will cause a host varaint to
try to link against the non-existent host "libc" module, but there
aren't very many of those and they can be fixed to use a target.bionic
clause.
Bug: 193559105
Test: m checkbuild
Change-Id: I94454a71144e3e68c7148b8d0bf2d974d2ad2bc6
diff --git a/cc/linker.go b/cc/linker.go
index 13df232..14564b6 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -15,9 +15,10 @@
package cc
import (
+ "fmt"
+
"android/soong/android"
"android/soong/cc/config"
- "fmt"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
@@ -244,8 +245,7 @@
if linker.Properties.System_shared_libs != nil && linker.Properties.Default_shared_libs != nil {
ctx.PropertyErrorf("system_shared_libs", "cannot be specified if default_shared_libs is also specified")
}
- if ctx.toolchain().Bionic() && linker.Properties.System_shared_libs != nil {
- // system_shared_libs is only honored when building against bionic.
+ if linker.Properties.System_shared_libs != nil {
return linker.Properties.System_shared_libs
}
return linker.Properties.Default_shared_libs