Add support for remotely executing header-abi-dumper actions.
Test: built with and without RBE_ABI_DUMPER set. Change-Id: Ie752c07325453076d191813eaa50da03e3a0c2d8
This commit is contained in:
committed by
Kousik Kumar
parent
383683559c
commit
31ec942ff7
@@ -65,7 +65,7 @@ var (
|
|||||||
|
|
||||||
ld, ldRE = remoteexec.StaticRules(pctx, "ld",
|
ld, ldRE = remoteexec.StaticRules(pctx, "ld",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
Command: "$ldCmd ${crtBegin} @${out}.rsp " +
|
Command: "$reTemplate$ldCmd ${crtBegin} @${out}.rsp " +
|
||||||
"${libFlags} ${crtEnd} -o ${out} ${ldFlags} ${extraLibFlags}",
|
"${libFlags} ${crtEnd} -o ${out} ${ldFlags} ${extraLibFlags}",
|
||||||
CommandDeps: []string{"$ldCmd"},
|
CommandDeps: []string{"$ldCmd"},
|
||||||
Rspfile: "${out}.rsp",
|
Rspfile: "${out}.rsp",
|
||||||
@@ -73,7 +73,8 @@ var (
|
|||||||
// clang -Wl,--out-implib doesn't update its output file if it hasn't changed.
|
// clang -Wl,--out-implib doesn't update its output file if it hasn't changed.
|
||||||
Restat: true,
|
Restat: true,
|
||||||
},
|
},
|
||||||
&remoteexec.REParams{Labels: map[string]string{"type": "link", "tool": "clang"},
|
&remoteexec.REParams{
|
||||||
|
Labels: map[string]string{"type": "link", "tool": "clang"},
|
||||||
ExecStrategy: "${config.RECXXLinksExecStrategy}",
|
ExecStrategy: "${config.RECXXLinksExecStrategy}",
|
||||||
Inputs: []string{"${out}.rsp"},
|
Inputs: []string{"${out}.rsp"},
|
||||||
RSPFile: "${out}.rsp",
|
RSPFile: "${out}.rsp",
|
||||||
@@ -86,11 +87,12 @@ var (
|
|||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
// Without -no-pie, clang 7.0 adds -pie to link Android files,
|
// Without -no-pie, clang 7.0 adds -pie to link Android files,
|
||||||
// but -r and -pie cannot be used together.
|
// but -r and -pie cannot be used together.
|
||||||
Command: "$ldCmd -fuse-ld=lld -nostdlib -no-pie -Wl,-r ${in} -o ${out} ${ldFlags}",
|
Command: "$reTemplate$ldCmd -fuse-ld=lld -nostdlib -no-pie -Wl,-r ${in} -o ${out} ${ldFlags}",
|
||||||
CommandDeps: []string{"$ldCmd"},
|
CommandDeps: []string{"$ldCmd"},
|
||||||
}, &remoteexec.REParams{
|
}, &remoteexec.REParams{
|
||||||
Labels: map[string]string{"type": "link", "tool": "clang"},
|
Labels: map[string]string{"type": "link", "tool": "clang"},
|
||||||
ExecStrategy: "${config.RECXXLinksExecStrategy}", Inputs: []string{"$inCommaList"},
|
ExecStrategy: "${config.RECXXLinksExecStrategy}",
|
||||||
|
Inputs: []string{"$inCommaList"},
|
||||||
OutputFiles: []string{"${out}"},
|
OutputFiles: []string{"${out}"},
|
||||||
ToolchainInputs: []string{"$ldCmd"},
|
ToolchainInputs: []string{"$ldCmd"},
|
||||||
Platform: map[string]string{remoteexec.PoolKey: "${config.RECXXLinksPool}"},
|
Platform: map[string]string{remoteexec.PoolKey: "${config.RECXXLinksPool}"},
|
||||||
@@ -199,12 +201,18 @@ var (
|
|||||||
_ = pctx.SourcePathVariable("sAbiDumper", "prebuilts/clang-tools/${config.HostPrebuiltTag}/bin/header-abi-dumper")
|
_ = pctx.SourcePathVariable("sAbiDumper", "prebuilts/clang-tools/${config.HostPrebuiltTag}/bin/header-abi-dumper")
|
||||||
|
|
||||||
// -w has been added since header-abi-dumper does not need to produce any sort of diagnostic information.
|
// -w has been added since header-abi-dumper does not need to produce any sort of diagnostic information.
|
||||||
sAbiDump = pctx.AndroidStaticRule("sAbiDump",
|
sAbiDump, sAbiDumpRE = remoteexec.StaticRules(pctx, "sAbiDump",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
Command: "rm -f $out && $sAbiDumper -o ${out} $in $exportDirs -- $cFlags -w -isystem prebuilts/clang-tools/${config.HostPrebuiltTag}/clang-headers",
|
Command: "rm -f $out && $reTemplate$sAbiDumper -o ${out} $in $exportDirs -- $cFlags -w -isystem prebuilts/clang-tools/${config.HostPrebuiltTag}/clang-headers",
|
||||||
CommandDeps: []string{"$sAbiDumper"},
|
CommandDeps: []string{"$sAbiDumper"},
|
||||||
},
|
}, &remoteexec.REParams{
|
||||||
"cFlags", "exportDirs")
|
Labels: map[string]string{"type": "abi-dump", "tool": "header-abi-dumper"},
|
||||||
|
ExecStrategy: "${config.REAbiDumperExecStrategy}",
|
||||||
|
Platform: map[string]string{
|
||||||
|
remoteexec.PoolKey: "${config.RECXXPool}",
|
||||||
|
"InputRootAbsolutePath": android.AbsSrcDirForExistingUseCases(),
|
||||||
|
},
|
||||||
|
}, []string{"cFlags", "exportDirs"}, nil)
|
||||||
|
|
||||||
_ = pctx.SourcePathVariable("sAbiLinker", "prebuilts/clang-tools/${config.HostPrebuiltTag}/bin/header-abi-linker")
|
_ = pctx.SourcePathVariable("sAbiLinker", "prebuilts/clang-tools/${config.HostPrebuiltTag}/bin/header-abi-linker")
|
||||||
|
|
||||||
@@ -567,8 +575,12 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
|
|||||||
sAbiDumpFile := android.ObjPathWithExt(ctx, subdir, srcFile, "sdump")
|
sAbiDumpFile := android.ObjPathWithExt(ctx, subdir, srcFile, "sdump")
|
||||||
sAbiDumpFiles = append(sAbiDumpFiles, sAbiDumpFile)
|
sAbiDumpFiles = append(sAbiDumpFiles, sAbiDumpFile)
|
||||||
|
|
||||||
|
dumpRule := sAbiDump
|
||||||
|
if ctx.Config().IsEnvTrue("RBE_ABI_DUMPER") {
|
||||||
|
dumpRule = sAbiDumpRE
|
||||||
|
}
|
||||||
ctx.Build(pctx, android.BuildParams{
|
ctx.Build(pctx, android.BuildParams{
|
||||||
Rule: sAbiDump,
|
Rule: dumpRule,
|
||||||
Description: "header-abi-dumper " + srcFile.Rel(),
|
Description: "header-abi-dumper " + srcFile.Rel(),
|
||||||
Output: sAbiDumpFile,
|
Output: sAbiDumpFile,
|
||||||
Input: srcFile,
|
Input: srcFile,
|
||||||
|
@@ -257,8 +257,10 @@ func init() {
|
|||||||
return ""
|
return ""
|
||||||
})
|
})
|
||||||
|
|
||||||
|
pctx.VariableFunc("RECXXPool", envOverrideFunc("RBE_CXX_POOL", remoteexec.DefaultPool))
|
||||||
pctx.VariableFunc("RECXXLinksPool", envOverrideFunc("RBE_CXX_LINKS_POOL", remoteexec.DefaultPool))
|
pctx.VariableFunc("RECXXLinksPool", envOverrideFunc("RBE_CXX_LINKS_POOL", remoteexec.DefaultPool))
|
||||||
pctx.VariableFunc("RECXXLinksExecStrategy", envOverrideFunc("RBE_CXX_LINKS_EXEC_STRATEGY", remoteexec.LocalExecStrategy))
|
pctx.VariableFunc("RECXXLinksExecStrategy", envOverrideFunc("RBE_CXX_LINKS_EXEC_STRATEGY", remoteexec.LocalExecStrategy))
|
||||||
|
pctx.VariableFunc("REAbiDumperExecStrategy", envOverrideFunc("RBE_ABI_DUMPER_EXEC_STRATEGY", remoteexec.LocalExecStrategy))
|
||||||
}
|
}
|
||||||
|
|
||||||
var HostPrebuiltTag = pctx.VariableConfigMethod("HostPrebuiltTag", android.Config.PrebuiltOS)
|
var HostPrebuiltTag = pctx.VariableConfigMethod("HostPrebuiltTag", android.Config.PrebuiltOS)
|
||||||
|
@@ -148,7 +148,8 @@ func (r *REParams) Template() string {
|
|||||||
// locally executable rule and the second rule is a remotely executable rule.
|
// locally executable rule and the second rule is a remotely executable rule.
|
||||||
func StaticRules(ctx android.PackageContext, name string, ruleParams blueprint.RuleParams, reParams *REParams, commonArgs []string, reArgs []string) (blueprint.Rule, blueprint.Rule) {
|
func StaticRules(ctx android.PackageContext, name string, ruleParams blueprint.RuleParams, reParams *REParams, commonArgs []string, reArgs []string) (blueprint.Rule, blueprint.Rule) {
|
||||||
ruleParamsRE := ruleParams
|
ruleParamsRE := ruleParams
|
||||||
ruleParamsRE.Command = reParams.Template() + ruleParamsRE.Command
|
ruleParams.Command = strings.ReplaceAll(ruleParams.Command, "$reTemplate", "")
|
||||||
|
ruleParamsRE.Command = strings.ReplaceAll(ruleParamsRE.Command, "$reTemplate", reParams.Template())
|
||||||
|
|
||||||
return ctx.AndroidStaticRule(name, ruleParams, commonArgs...),
|
return ctx.AndroidStaticRule(name, ruleParams, commonArgs...),
|
||||||
ctx.AndroidRemoteStaticRule(name+"RE", android.RemoteRuleSupports{RBE: true}, ruleParamsRE, append(commonArgs, reArgs...)...)
|
ctx.AndroidRemoteStaticRule(name+"RE", android.RemoteRuleSupports{RBE: true}, ruleParamsRE, append(commonArgs, reArgs...)...)
|
||||||
|
Reference in New Issue
Block a user