Specify working directory and OUT_DIR to ABI tools
This commit adds `--root-dir . --root-dir $OUT_DIR:out` to the commands
of ABI tools. If the user sets non-default $OUT_DIR, the tools write
"out" instead of the actual $OUT_DIR to the ABI dumps.
Test: export OUT_DIR=~/aosp_out ; \
make libstagefright_bufferqueue_helper.vendor
Bug: 192157880
Change-Id: I4e2d1b252273106fb6a3ecfa1727d5c91ba03444
diff --git a/cc/builder.go b/cc/builder.go
index b0842ec..842ce85 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -237,7 +237,7 @@
// -w has been added since header-abi-dumper does not need to produce any sort of diagnostic information.
sAbiDump, sAbiDumpRE = pctx.RemoteStaticRules("sAbiDump",
blueprint.RuleParams{
- Command: "rm -f $out && $reTemplate$sAbiDumper -o ${out} $in $exportDirs -- $cFlags -w -isystem prebuilts/clang-tools/${config.HostPrebuiltTag}/clang-headers",
+ Command: "rm -f $out && $reTemplate$sAbiDumper --root-dir . --root-dir $$OUT_DIR:out -o ${out} $in $exportDirs -- $cFlags -w -isystem prebuilts/clang-tools/${config.HostPrebuiltTag}/clang-headers",
CommandDeps: []string{"$sAbiDumper"},
}, &remoteexec.REParams{
Labels: map[string]string{"type": "abi-dump", "tool": "header-abi-dumper"},
@@ -255,7 +255,7 @@
// sAbi dump file.
sAbiLink, sAbiLinkRE = pctx.RemoteStaticRules("sAbiLink",
blueprint.RuleParams{
- Command: "$reTemplate$sAbiLinker -o ${out} $symbolFilter -arch $arch $exportedHeaderFlags @${out}.rsp ",
+ Command: "$reTemplate$sAbiLinker --root-dir . --root-dir $$OUT_DIR:out -o ${out} $symbolFilter -arch $arch $exportedHeaderFlags @${out}.rsp",
CommandDeps: []string{"$sAbiLinker"},
Rspfile: "${out}.rsp",
RspfileContent: "${in}",