Merge "Move toc.sh to use LLVM binutils" am: 948205699b am: 115fc28122 am: 84c6d3c48d

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1661823

Change-Id: Ic6df699e0f25b1ce952317b0b8e6520f01cd24bb
This commit is contained in:
Yi Kong
2021-04-02 04:50:08 +00:00
committed by Automerger Merge Worker
2 changed files with 19 additions and 23 deletions

View File

@@ -182,11 +182,11 @@ var (
blueprint.RuleParams{
Depfile: "${out}.d",
Deps: blueprint.DepsGCC,
Command: "CROSS_COMPILE=$crossCompile $tocPath $format -i ${in} -o ${out} -d ${out}.d",
Command: "CLANG_BIN=$clangBin $tocPath $format -i ${in} -o ${out} -d ${out}.d",
CommandDeps: []string{"$tocPath"},
Restat: true,
},
"crossCompile", "format")
"clangBin", "format")
// Rule for invoking clang-tidy (a clang-based linter).
clangTidy, clangTidyRE = pctx.RemoteStaticRules("clangTidy",
@@ -918,16 +918,12 @@ func transformSharedObjectToToc(ctx android.ModuleContext, inputFile android.Pat
outputFile android.WritablePath, flags builderFlags) {
var format string
var crossCompile string
if ctx.Darwin() {
format = "--macho"
crossCompile = "${config.MacToolPath}"
} else if ctx.Windows() {
format = "--pe"
crossCompile = gccCmd(flags.toolchain, "")
} else {
format = "--elf"
crossCompile = gccCmd(flags.toolchain, "")
}
ctx.Build(pctx, android.BuildParams{
@@ -936,8 +932,8 @@ func transformSharedObjectToToc(ctx android.ModuleContext, inputFile android.Pat
Output: outputFile,
Input: inputFile,
Args: map[string]string{
"crossCompile": crossCompile,
"format": format,
"clangBin": "${config.ClangBin}",
"format": format,
},
})
}