Always respect system_shared_libs from Android.bp
This commit removes a special case that ignores `system_shared_libs`
when `sdk_version`, `vendor_available`, or `vendor` is specified.
In the past, that special case was required for `libasync_safe` and
`libpropertyinfoparser`. However, ignoring `system_shared_libs` meant
that we didn't have a way to skip the default libs when `sdk_version`
was specified. This becomes a problem when the dependencies of
prebuilts are actually checked. To be specific,
`libclang_rt.builtins-${arch}` falls into circular dependencies.
Bug: 123006819
Test: make checkbuild
Change-Id: I5fe038c00892b3abe5189b30d57ba59884b47cbb
diff --git a/cc/linker.go b/cc/linker.go
index eb71268..cda392d 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -240,11 +240,11 @@
deps.LateStaticLibs = append(deps.LateStaticLibs, "libgcc")
}
- var systemSharedLibs []string
- if !ctx.useSdk() && !ctx.useVndk() {
- systemSharedLibs = linker.Properties.System_shared_libs
- }
+ systemSharedLibs := linker.Properties.System_shared_libs
if systemSharedLibs == nil {
+ // Provide a default system_shared_libs if it is unspecified. Note: If an
+ // empty list [] is specified, it implies that the module declines the
+ // default system_shared_libs.
systemSharedLibs = []string{"libc", "libm", "libdl"}
}