Merge "Add a header_abi_checker section"
This commit is contained in:
@@ -663,18 +663,33 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext,
|
|||||||
// Generate a rule to combine .dump sAbi dump files from multiple source files
|
// Generate a rule to combine .dump sAbi dump files from multiple source files
|
||||||
// into a single .ldump sAbi dump file
|
// into a single .ldump sAbi dump file
|
||||||
func TransformDumpToLinkedDump(ctx android.ModuleContext, sAbiDumps android.Paths, soFile android.Path,
|
func TransformDumpToLinkedDump(ctx android.ModuleContext, sAbiDumps android.Paths, soFile android.Path,
|
||||||
baseName, exportedHeaderFlags string) android.OptionalPath {
|
baseName, exportedHeaderFlags string, symbolFile android.OptionalPath,
|
||||||
|
excludedSymbolVersions, excludedSymbolTags []string) android.OptionalPath {
|
||||||
|
|
||||||
outputFile := android.PathForModuleOut(ctx, baseName+".lsdump")
|
outputFile := android.PathForModuleOut(ctx, baseName+".lsdump")
|
||||||
sabiLock.Lock()
|
sabiLock.Lock()
|
||||||
lsdumpPaths = append(lsdumpPaths, outputFile.String())
|
lsdumpPaths = append(lsdumpPaths, outputFile.String())
|
||||||
sabiLock.Unlock()
|
sabiLock.Unlock()
|
||||||
|
|
||||||
|
implicits := android.Paths{soFile}
|
||||||
symbolFilterStr := "-so " + soFile.String()
|
symbolFilterStr := "-so " + soFile.String()
|
||||||
|
|
||||||
|
if symbolFile.Valid() {
|
||||||
|
implicits = append(implicits, symbolFile.Path())
|
||||||
|
symbolFilterStr += " -v " + symbolFile.String()
|
||||||
|
}
|
||||||
|
for _, ver := range excludedSymbolVersions {
|
||||||
|
symbolFilterStr += " --exclude-symbol-version " + ver
|
||||||
|
}
|
||||||
|
for _, tag := range excludedSymbolTags {
|
||||||
|
symbolFilterStr += " --exclude-symbol-tag " + tag
|
||||||
|
}
|
||||||
ctx.Build(pctx, android.BuildParams{
|
ctx.Build(pctx, android.BuildParams{
|
||||||
Rule: sAbiLink,
|
Rule: sAbiLink,
|
||||||
Description: "header-abi-linker " + outputFile.Base(),
|
Description: "header-abi-linker " + outputFile.Base(),
|
||||||
Output: outputFile,
|
Output: outputFile,
|
||||||
Inputs: sAbiDumps,
|
Inputs: sAbiDumps,
|
||||||
Implicit: soFile,
|
Implicits: implicits,
|
||||||
Args: map[string]string{
|
Args: map[string]string{
|
||||||
"symbolFilter": symbolFilterStr,
|
"symbolFilter": symbolFilterStr,
|
||||||
"arch": ctx.Arch().ArchType.Name,
|
"arch": ctx.Arch().ArchType.Name,
|
||||||
|
@@ -87,6 +87,19 @@ type LibraryProperties struct {
|
|||||||
// binaries would be installed by default (in PRODUCT_PACKAGES) the other library will be removed
|
// binaries would be installed by default (in PRODUCT_PACKAGES) the other library will be removed
|
||||||
// from PRODUCT_PACKAGES.
|
// from PRODUCT_PACKAGES.
|
||||||
Overrides []string
|
Overrides []string
|
||||||
|
|
||||||
|
// Properties for ABI compatibility checker
|
||||||
|
Header_abi_checker struct {
|
||||||
|
// Path to a symbol file that specifies the symbols to be included in the generated
|
||||||
|
// ABI dump file
|
||||||
|
Symbol_file *string
|
||||||
|
|
||||||
|
// Symbol versions that should be ignored from the symbol file
|
||||||
|
Exclude_symbol_versions []string
|
||||||
|
|
||||||
|
// Symbol tags that should be ignored from the symbol file
|
||||||
|
Exclude_symbol_tags []string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type LibraryMutatedProperties struct {
|
type LibraryMutatedProperties struct {
|
||||||
@@ -760,7 +773,10 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
|
|||||||
SourceAbiFlags = append(SourceAbiFlags, reexportedInclude)
|
SourceAbiFlags = append(SourceAbiFlags, reexportedInclude)
|
||||||
}
|
}
|
||||||
exportedHeaderFlags := strings.Join(SourceAbiFlags, " ")
|
exportedHeaderFlags := strings.Join(SourceAbiFlags, " ")
|
||||||
library.sAbiOutputFile = TransformDumpToLinkedDump(ctx, objs.sAbiDumpFiles, soFile, fileName, exportedHeaderFlags)
|
library.sAbiOutputFile = TransformDumpToLinkedDump(ctx, objs.sAbiDumpFiles, soFile, fileName, exportedHeaderFlags,
|
||||||
|
android.OptionalPathForModuleSrc(ctx, library.Properties.Header_abi_checker.Symbol_file),
|
||||||
|
library.Properties.Header_abi_checker.Exclude_symbol_versions,
|
||||||
|
library.Properties.Header_abi_checker.Exclude_symbol_tags)
|
||||||
|
|
||||||
refAbiDumpFile := getRefAbiDumpFile(ctx, vndkVersion, fileName)
|
refAbiDumpFile := getRefAbiDumpFile(ctx, vndkVersion, fileName)
|
||||||
if refAbiDumpFile != nil {
|
if refAbiDumpFile != nil {
|
||||||
|
Reference in New Issue
Block a user