Remove vndkVsNdk()

This commmit removes `vndkVsNdk()`, which is essentially
`!inList(ctx.baseModuleName(), llndkLibraries)`.

Test: lunch aosp_arm64_ab-userdebug && make
Change-Id: I8e2352f302df30057997944678f176f4550d3f75
This commit is contained in:
Logan Chien 2018-07-11 17:15:57 +08:00
parent 83c415f955
commit 5237bed1c4
2 changed files with 10 additions and 14 deletions

View file

@ -828,25 +828,27 @@ func pathForModule(ctx ModuleContext) OutputPath {
// PathForVndkRefDump returns an OptionalPath representing the path of the reference // PathForVndkRefDump returns an OptionalPath representing the path of the reference
// abi dump for the given module. This is not guaranteed to be valid. // abi dump for the given module. This is not guaranteed to be valid.
func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string, vndkOrNdk bool) OptionalPath { func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string, isLlndk bool) OptionalPath {
arches := ctx.DeviceConfig().Arches() arches := ctx.DeviceConfig().Arches()
currentArch := ctx.Arch() currentArch := ctx.Arch()
archNameAndVariant := currentArch.ArchType.String() archNameAndVariant := currentArch.ArchType.String()
if currentArch.ArchVariant != "" { if currentArch.ArchVariant != "" {
archNameAndVariant += "_" + currentArch.ArchVariant archNameAndVariant += "_" + currentArch.ArchVariant
} }
var vndkOrNdkDir string
if vndkOrNdk { var dirName string
vndkOrNdkDir = "vndk" if isLlndk {
dirName = "ndk"
} else { } else {
vndkOrNdkDir = "ndk" dirName = "vndk"
} }
if len(arches) == 0 { if len(arches) == 0 {
panic("device build with no primary arch") panic("device build with no primary arch")
} }
binderBitness := ctx.DeviceConfig().BinderBitness() binderBitness := ctx.DeviceConfig().BinderBitness()
ext := ".lsdump.gz" ext := ".lsdump.gz"
refDumpFileStr := "prebuilts/abi-dumps/" + vndkOrNdkDir + "/" + version + "/" + binderBitness + "/" + refDumpFileStr := "prebuilts/abi-dumps/" + dirName + "/" + version + "/" + binderBitness + "/" +
archNameAndVariant + "/source-based/" + fileName + ext archNameAndVariant + "/source-based/" + fileName + ext
return ExistentPathForSource(ctx, refDumpFileStr) return ExistentPathForSource(ctx, refDumpFileStr)
} }

View file

@ -649,7 +649,8 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
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)
refSourceDumpFile := android.PathForVndkRefAbiDump(ctx, vndkVersion, fileName, vndkVsNdk(ctx)) isLlndk := inList(ctx.baseModuleName(), llndkLibraries)
refSourceDumpFile := android.PathForVndkRefAbiDump(ctx, vndkVersion, fileName, isLlndk)
if refSourceDumpFile.Valid() { if refSourceDumpFile.Valid() {
unzippedRefDump := UnzipRefDump(ctx, refSourceDumpFile.Path(), fileName) unzippedRefDump := UnzipRefDump(ctx, refSourceDumpFile.Path(), fileName)
library.sAbiDiff = SourceAbiDiff(ctx, library.sAbiOutputFile.Path(), library.sAbiDiff = SourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
@ -658,13 +659,6 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
} }
} }
func vndkVsNdk(ctx ModuleContext) bool {
if inList(ctx.baseModuleName(), llndkLibraries) {
return false
}
return true
}
func (library *libraryDecorator) link(ctx ModuleContext, func (library *libraryDecorator) link(ctx ModuleContext,
flags Flags, deps PathDeps, objs Objects) android.Path { flags Flags, deps PathDeps, objs Objects) android.Path {