Merge "Use -advice-only for libraries which do not export headers."

This commit is contained in:
Treehugger Robot
2018-01-19 05:20:33 +00:00
committed by Gerrit Code Review
2 changed files with 7 additions and 3 deletions

View File

@@ -711,8 +711,12 @@ func UnzipRefDump(ctx android.ModuleContext, zippedRefDump android.Path, baseNam
}
func SourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceDump android.Path,
baseName string) android.OptionalPath {
baseName, exportedHeaderFlags string) android.OptionalPath {
outputFile := android.PathForModuleOut(ctx, baseName+".abidiff")
localAbiCheckAllowFlags := append([]string(nil), abiCheckAllowFlags...)
if exportedHeaderFlags == "" {
localAbiCheckAllowFlags = append(localAbiCheckAllowFlags, "-advice-only")
}
ctx.Build(pctx, android.BuildParams{
Rule: sAbiDiff,
Description: "header-abi-diff " + outputFile.Base(),
@@ -723,7 +727,7 @@ func SourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD
"referenceDump": referenceDump.String(),
"libName": baseName,
"arch": ctx.Arch().ArchType.Name,
"allowFlags": strings.Join(abiCheckAllowFlags, " "),
"allowFlags": strings.Join(localAbiCheckAllowFlags, " "),
},
})
return android.OptionalPathForPath(outputFile)

View File

@@ -632,7 +632,7 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
library.sAbiOutputFile = TransformDumpToLinkedDump(ctx, objs.sAbiDumpFiles, soFile, fileName, exportedHeaderFlags)
if refSourceDumpFile.Valid() {
unzippedRefDump := UnzipRefDump(ctx, refSourceDumpFile.Path(), fileName)
library.sAbiDiff = SourceAbiDiff(ctx, library.sAbiOutputFile.Path(), unzippedRefDump, fileName)
library.sAbiDiff = SourceAbiDiff(ctx, library.sAbiOutputFile.Path(), unzippedRefDump, fileName, exportedHeaderFlags)
}
}
}