Merge "Remove system shared libs from non-bionic dep list" am: d75966e7db am: 88e5cb05ce

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2176083

Change-Id: I1c05c219e753115fd58d30d5b3fa6d77f1090281
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2022-09-02 17:43:25 +00:00 committed by Automerger Merge Worker
commit f0472e7a4a
2 changed files with 5 additions and 8 deletions

View file

@ -1419,13 +1419,7 @@ cc_library_static {
}
`,
ExpectedBazelTargets: []string{
MakeBazelTarget("cc_library_static", "all", AttrNameToString{
"implementation_dynamic_deps": `select({
"//build/bazel/platforms/os:android": [],
"//build/bazel/platforms/os:linux_bionic": [],
"//conditions:default": [":libc"],
})`,
}),
MakeBazelTarget("cc_library_static", "all", AttrNameToString{}),
MakeBazelTarget("cc_library_static", "keep_for_empty_system_shared_libs", AttrNameToString{
"implementation_dynamic_deps": `[":libc"]`,
"system_dynamic_deps": `[]`,

View file

@ -1084,9 +1084,12 @@ func (la *linkerAttributes) convertProductVariables(ctx android.BazelConversionP
func (la *linkerAttributes) finalize(ctx android.BazelConversionPathContext) {
// if system dynamic deps have the default value, any use of a system dynamic library used will
// result in duplicate library errors for bionic OSes. Here, we explicitly exclude those libraries
// from bionic OSes.
// from bionic OSes and the no config case as these libraries only build for bionic OSes.
if la.systemDynamicDeps.IsNil() && len(la.usedSystemDynamicDepAsDynamicDep) > 0 {
toRemove := bazelLabelForSharedDeps(ctx, android.SortedStringKeys(la.usedSystemDynamicDepAsDynamicDep))
la.dynamicDeps.Exclude(bazel.NoConfigAxis, "", toRemove)
la.implementationDynamicDeps.Exclude(bazel.NoConfigAxis, "", toRemove)
la.implementationDynamicDeps.Exclude(bazel.NoConfigAxis, "", toRemove)
la.dynamicDeps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)
la.dynamicDeps.Exclude(bazel.OsConfigurationAxis, "linux_bionic", toRemove)
la.implementationDynamicDeps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)