Dump abi for vendor variants of VNDK libraries.
Currently, abi is dumped for platform variants of system libraries. Dump them for vendor variants since they are the ones which need to be abi stable on security updates. This also ties abi dumping to BOARD_VNDK_VERSION. Test: For libfoo: 1) Added a source file with a dummy function for the core variant. 2) Excluded the source file from the vendor variant. 3) BOARD_VNDK_VERSION=current mm -j64 produces libfoo.so.lsdump with no dummy_function since the source file was not included in the vendor variant. Test: Inspected build.ninja and confirmed that all of a library's abi dump dependencies (.sdump files are dependencies of the final .lsdump files) are from vendor variants. Change-Id: Ie0bf91fcd81606c131845d9872261166b5db72aa
This commit is contained in:
parent
4f26bc0263
commit
a4fce191ba
3 changed files with 4 additions and 4 deletions
2
cc/cc.go
2
cc/cc.go
|
@ -465,7 +465,7 @@ func (ctx *moduleContextImpl) isVndkSp() bool {
|
||||||
|
|
||||||
// Create source abi dumps if the module belongs to the list of VndkLibraries.
|
// Create source abi dumps if the module belongs to the list of VndkLibraries.
|
||||||
func (ctx *moduleContextImpl) createVndkSourceAbiDump() bool {
|
func (ctx *moduleContextImpl) createVndkSourceAbiDump() bool {
|
||||||
return ctx.ctx.Device() && (ctx.mod.isVndk() || inList(ctx.baseModuleName(), llndkLibraries))
|
return ctx.ctx.Device() && ((ctx.vndk() && ctx.isVndk()) || inList(ctx.baseModuleName(), llndkLibraries))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *moduleContextImpl) selectedStl() string {
|
func (ctx *moduleContextImpl) selectedStl() string {
|
||||||
|
|
|
@ -349,7 +349,7 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa
|
||||||
return Objects{}
|
return Objects{}
|
||||||
}
|
}
|
||||||
if ctx.createVndkSourceAbiDump() || library.sabi.Properties.CreateSAbiDumps {
|
if ctx.createVndkSourceAbiDump() || library.sabi.Properties.CreateSAbiDumps {
|
||||||
exportIncludeDirs := android.PathsForModuleSrc(ctx, library.flagExporter.Properties.Export_include_dirs)
|
exportIncludeDirs := library.flagExporter.exportedIncludes(ctx)
|
||||||
var SourceAbiFlags []string
|
var SourceAbiFlags []string
|
||||||
for _, dir := range exportIncludeDirs.Strings() {
|
for _, dir := range exportIncludeDirs.Strings() {
|
||||||
SourceAbiFlags = append(SourceAbiFlags, "-I"+dir)
|
SourceAbiFlags = append(SourceAbiFlags, "-I"+dir)
|
||||||
|
@ -600,7 +600,7 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
|
||||||
if versionScript.Valid() {
|
if versionScript.Valid() {
|
||||||
symbolFile = versionScript
|
symbolFile = versionScript
|
||||||
}
|
}
|
||||||
exportIncludeDirs := android.PathsForModuleSrc(ctx, library.flagExporter.Properties.Export_include_dirs)
|
exportIncludeDirs := library.flagExporter.exportedIncludes(ctx)
|
||||||
var SourceAbiFlags []string
|
var SourceAbiFlags []string
|
||||||
for _, dir := range exportIncludeDirs.Strings() {
|
for _, dir := range exportIncludeDirs.Strings() {
|
||||||
SourceAbiFlags = append(SourceAbiFlags, "-I"+dir)
|
SourceAbiFlags = append(SourceAbiFlags, "-I"+dir)
|
||||||
|
|
|
@ -79,7 +79,7 @@ func (sabimod *sabi) flags(ctx ModuleContext, flags Flags) Flags {
|
||||||
|
|
||||||
func sabiDepsMutator(mctx android.TopDownMutatorContext) {
|
func sabiDepsMutator(mctx android.TopDownMutatorContext) {
|
||||||
if c, ok := mctx.Module().(*Module); ok &&
|
if c, ok := mctx.Module().(*Module); ok &&
|
||||||
(c.isVndk() || inList(c.Name(), llndkLibraries) ||
|
((c.isVndk() && c.vndk()) || inList(c.Name(), llndkLibraries) ||
|
||||||
(c.sabi != nil && c.sabi.Properties.CreateSAbiDumps)) {
|
(c.sabi != nil && c.sabi.Properties.CreateSAbiDumps)) {
|
||||||
mctx.VisitDirectDeps(func(m blueprint.Module) {
|
mctx.VisitDirectDeps(func(m blueprint.Module) {
|
||||||
tag := mctx.OtherModuleDependencyTag(m)
|
tag := mctx.OtherModuleDependencyTag(m)
|
||||||
|
|
Loading…
Reference in a new issue