libbuildversion should be linked as a whole archive dep as soong does.
Bug: 278789968 Test: Unit tests and CI Change-Id: Ic2c44826bdc03b91cc19d93f96096ec6fdf44833
This commit is contained in:
@@ -153,10 +153,10 @@ cc_library {
|
|||||||
"//build/bazel/platforms/os:linux_glibc": ["linux.cpp"],
|
"//build/bazel/platforms/os:linux_glibc": ["linux.cpp"],
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
})`,
|
})`,
|
||||||
"sdk_version": `"current"`,
|
"sdk_version": `"current"`,
|
||||||
"min_sdk_version": `"29"`,
|
"min_sdk_version": `"29"`,
|
||||||
"use_version_lib": `True`,
|
"use_version_lib": `True`,
|
||||||
"implementation_whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
|
"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -516,8 +516,8 @@ func TestCcLibrarySharedUseVersionLib(t *testing.T) {
|
|||||||
}`,
|
}`,
|
||||||
ExpectedBazelTargets: []string{
|
ExpectedBazelTargets: []string{
|
||||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||||
"use_version_lib": "True",
|
"use_version_lib": "True",
|
||||||
"implementation_whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
|
"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@@ -1613,7 +1613,7 @@ func TestCcLibraryStaticUseVersionLib(t *testing.T) {
|
|||||||
}`,
|
}`,
|
||||||
ExpectedBazelTargets: []string{
|
ExpectedBazelTargets: []string{
|
||||||
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
||||||
"implementation_whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
|
"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@@ -1036,11 +1036,7 @@ func (la *linkerAttributes) bp2buildForAxisAndConfig(ctx android.BazelConversion
|
|||||||
_, staticLibs = android.RemoveFromList(versionLib, staticLibs)
|
_, staticLibs = android.RemoveFromList(versionLib, staticLibs)
|
||||||
// only add the dep if it is not in progress
|
// only add the dep if it is not in progress
|
||||||
if !versionLibAlreadyInDeps {
|
if !versionLibAlreadyInDeps {
|
||||||
if isBinary {
|
wholeStaticLibs = append(wholeStaticLibs, versionLib)
|
||||||
wholeStaticLibs = append(wholeStaticLibs, versionLib)
|
|
||||||
} else {
|
|
||||||
la.implementationWholeArchiveDeps.SetSelectValue(axis, config, bazelLabelForWholeDepsExcludes(ctx, []string{versionLib}, props.Exclude_static_libs))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user