Merge "NDK library: remove remnants of abidw usage" into main

This commit is contained in:
Matthias Männich
2023-08-02 15:18:02 +00:00
committed by Gerrit Code Review

View File

@@ -31,7 +31,6 @@ import (
func init() { func init() {
pctx.HostBinToolVariable("ndkStubGenerator", "ndkstubgen") pctx.HostBinToolVariable("ndkStubGenerator", "ndkstubgen")
pctx.HostBinToolVariable("abidw", "abidw")
pctx.HostBinToolVariable("stg", "stg") pctx.HostBinToolVariable("stg", "stg")
pctx.HostBinToolVariable("stgdiff", "stgdiff") pctx.HostBinToolVariable("stgdiff", "stgdiff")
} }
@@ -44,28 +43,12 @@ var (
CommandDeps: []string{"$ndkStubGenerator"}, CommandDeps: []string{"$ndkStubGenerator"},
}, "arch", "apiLevel", "apiMap", "flags") }, "arch", "apiLevel", "apiMap", "flags")
// TODO(b/156513478): remove once migration to STG is complete
abidw = pctx.AndroidStaticRule("abidw",
blueprint.RuleParams{
Command: "$abidw --type-id-style hash --no-corpus-path " +
"--no-show-locs --no-comp-dir-path -w $symbolList " +
"$in --out-file $out",
CommandDeps: []string{"$abidw"},
}, "symbolList")
stg = pctx.AndroidStaticRule("stg", stg = pctx.AndroidStaticRule("stg",
blueprint.RuleParams{ blueprint.RuleParams{
Command: "$stg -S :$symbolList --elf $in -o $out", Command: "$stg -S :$symbolList --elf $in -o $out",
CommandDeps: []string{"$stg"}, CommandDeps: []string{"$stg"},
}, "symbolList") }, "symbolList")
// TODO(b/156513478): remove once migration to STG is complete
xml2stg = pctx.AndroidStaticRule("xml2stg",
blueprint.RuleParams{
Command: "$stg --abi -i $in -o $out",
CommandDeps: []string{"$stg"},
})
stgdiff = pctx.AndroidStaticRule("stgdiff", stgdiff = pctx.AndroidStaticRule("stgdiff",
blueprint.RuleParams{ blueprint.RuleParams{
// Need to create *some* output for ninja. We don't want to use tee // Need to create *some* output for ninja. We don't want to use tee
@@ -117,10 +100,6 @@ type libraryProperties struct {
// Headers presented by this library to the Public API Surface // Headers presented by this library to the Public API Surface
Export_header_libs []string Export_header_libs []string
// TODO(b/156513478): remove once migration to STG is complete
// Fall back to the legacy abidw ABI extraction pipeline
Legacy_use_abidw *bool
} }
type stubDecorator struct { type stubDecorator struct {
@@ -363,34 +342,6 @@ func canDiffAbi() bool {
return false return false
} }
// TODO(b/156513478): remove once migration to STG is complete
func (this *stubDecorator) dumpAbiLegacy(ctx ModuleContext, symbolList android.Path) {
implementationLibrary := this.findImplementationLibrary(ctx)
abiRawPath := getNdkAbiDumpInstallBase(ctx).Join(ctx,
this.apiLevel.String(), ctx.Arch().ArchType.String(),
this.libraryName(ctx), "abi.raw.xml")
ctx.Build(pctx, android.BuildParams{
Rule: abidw,
Description: fmt.Sprintf("abidw %s", implementationLibrary),
Input: implementationLibrary,
Output: abiRawPath,
Implicit: symbolList,
Args: map[string]string{
"symbolList": symbolList.String(),
},
})
this.abiDumpPath = getNdkAbiDumpInstallBase(ctx).Join(ctx,
this.apiLevel.String(), ctx.Arch().ArchType.String(),
this.libraryName(ctx), "abi.stg")
ctx.Build(pctx, android.BuildParams{
Rule: xml2stg,
Description: fmt.Sprintf("xml2stg %s", implementationLibrary),
Input: abiRawPath,
Output: this.abiDumpPath,
})
}
func (this *stubDecorator) dumpAbi(ctx ModuleContext, symbolList android.Path) { func (this *stubDecorator) dumpAbi(ctx ModuleContext, symbolList android.Path) {
implementationLibrary := this.findImplementationLibrary(ctx) implementationLibrary := this.findImplementationLibrary(ctx)
this.abiDumpPath = getNdkAbiDumpInstallBase(ctx).Join(ctx, this.abiDumpPath = getNdkAbiDumpInstallBase(ctx).Join(ctx,
@@ -506,11 +457,7 @@ func (c *stubDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) O
objs := compileStubLibrary(ctx, flags, nativeAbiResult.stubSrc) objs := compileStubLibrary(ctx, flags, nativeAbiResult.stubSrc)
c.versionScriptPath = nativeAbiResult.versionScript c.versionScriptPath = nativeAbiResult.versionScript
if canDumpAbi(ctx.Config()) { if canDumpAbi(ctx.Config()) {
if proptools.BoolDefault(c.properties.Legacy_use_abidw, false) { c.dumpAbi(ctx, nativeAbiResult.symbolList)
c.dumpAbiLegacy(ctx, nativeAbiResult.symbolList)
} else {
c.dumpAbi(ctx, nativeAbiResult.symbolList)
}
if canDiffAbi() { if canDiffAbi() {
c.diffAbi(ctx) c.diffAbi(ctx)
} }