Add implicit outputs to link actions
Change-Id: I9b6ae97f5bbfe8f9c4b9c089544a768982794f32 Bug: b/154733231 Test: Built the failing action with / without this change
This commit is contained in:
@@ -71,10 +71,10 @@ var (
|
|||||||
ExecStrategy: "${config.RECXXLinksExecStrategy}",
|
ExecStrategy: "${config.RECXXLinksExecStrategy}",
|
||||||
Inputs: []string{"${out}.rsp"},
|
Inputs: []string{"${out}.rsp"},
|
||||||
RSPFile: "${out}.rsp",
|
RSPFile: "${out}.rsp",
|
||||||
OutputFiles: []string{"${out}"},
|
OutputFiles: []string{"${out}", "$implicitOutputs"},
|
||||||
ToolchainInputs: []string{"$ldCmd"},
|
ToolchainInputs: []string{"$ldCmd"},
|
||||||
Platform: map[string]string{remoteexec.PoolKey: "${config.RECXXLinksPool}"},
|
Platform: map[string]string{remoteexec.PoolKey: "${config.RECXXLinksPool}"},
|
||||||
}, []string{"ldCmd", "crtBegin", "libFlags", "crtEnd", "ldFlags", "extraLibFlags"}, nil)
|
}, []string{"ldCmd", "crtBegin", "libFlags", "crtEnd", "ldFlags", "extraLibFlags"}, []string{"implicitOutputs"})
|
||||||
|
|
||||||
partialLd, partialLdRE = remoteexec.StaticRules(pctx, "partialLd",
|
partialLd, partialLdRE = remoteexec.StaticRules(pctx, "partialLd",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
@@ -83,13 +83,12 @@ var (
|
|||||||
Command: "$reTemplate$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}",
|
ExecStrategy: "${config.RECXXLinksExecStrategy}", Inputs: []string{"$inCommaList"},
|
||||||
Inputs: []string{"$inCommaList"},
|
OutputFiles: []string{"${out}", "$implicitOutputs"},
|
||||||
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}"},
|
||||||
}, []string{"ldCmd", "ldFlags"}, []string{"inCommaList"})
|
}, []string{"ldCmd", "ldFlags"}, []string{"inCommaList", "implicitOutputs"})
|
||||||
|
|
||||||
ar = pctx.AndroidStaticRule("ar",
|
ar = pctx.AndroidStaticRule("ar",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
@@ -676,8 +675,17 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rule := ld
|
rule := ld
|
||||||
|
args := map[string]string{
|
||||||
|
"ldCmd": ldCmd,
|
||||||
|
"crtBegin": crtBegin.String(),
|
||||||
|
"libFlags": strings.Join(libFlagsList, " "),
|
||||||
|
"extraLibFlags": flags.extraLibFlags,
|
||||||
|
"ldFlags": flags.globalLdFlags + " " + flags.localLdFlags,
|
||||||
|
"crtEnd": crtEnd.String(),
|
||||||
|
}
|
||||||
if ctx.Config().IsEnvTrue("RBE_CXX_LINKS") {
|
if ctx.Config().IsEnvTrue("RBE_CXX_LINKS") {
|
||||||
rule = ldRE
|
rule = ldRE
|
||||||
|
args["implicitOutputs"] = strings.Join(implicitOutputs.Strings(), ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Build(pctx, android.BuildParams{
|
ctx.Build(pctx, android.BuildParams{
|
||||||
@@ -687,14 +695,7 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext,
|
|||||||
ImplicitOutputs: implicitOutputs,
|
ImplicitOutputs: implicitOutputs,
|
||||||
Inputs: objFiles,
|
Inputs: objFiles,
|
||||||
Implicits: deps,
|
Implicits: deps,
|
||||||
Args: map[string]string{
|
Args: args,
|
||||||
"ldCmd": ldCmd,
|
|
||||||
"crtBegin": crtBegin.String(),
|
|
||||||
"libFlags": strings.Join(libFlagsList, " "),
|
|
||||||
"extraLibFlags": flags.extraLibFlags,
|
|
||||||
"ldFlags": flags.globalLdFlags + " " + flags.localLdFlags,
|
|
||||||
"crtEnd": crtEnd.String(),
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user