OSDN Git Service

android: add 'Restat: true' to tblgenRule definition
authorMauro Rossi <issor.oruam@gmail.com>
Sun, 9 Feb 2020 10:23:43 +0000 (11:23 +0100)
committerMauro Rossi <issor.oruam@gmail.com>
Thu, 15 Apr 2021 11:05:07 +0000 (13:05 +0200)
Based on suggestion by Colin Cross, to avoid unnecessary rebuild of llvm
in case of *.inc generated sources older than llvm-tblgen binary.

When llvm-tblgen binary is compiled and for some reason the build is interrupted,
the generated *.inc files will have a timestamp older than llvm-tblgen binary,
at this point all libLLVM* targets depending on the *.inc files are always rebuilt.

'NINJA_ARGS="-d explain" make iso_img' command revealed the cause of the problem:

ninja explain: output out/soong/.intermediates/external/llvm/llvm-gen-attributes/gen/llvm/IR/Attributes.inc
older than most recent input out/soong/host/linux-x86/bin/llvm-tblgen (1570914978 vs 1575285173)
ninja explain: out/soong/.intermediates/external/llvm/llvm-gen-attributes/gen/llvm/IR/Attributes.inc is dirty

Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
llvm/soong/tblgen.go

index 02ea0d0..0ce2736 100644 (file)
@@ -39,6 +39,7 @@ var (
                Command:     "${llvmTblgen} ${includes} ${generator} -d ${depfile} -o ${out} ${in}",
                CommandDeps: []string{"${llvmTblgen}"},
                Description: "LLVM TableGen $in => $out",
+               Restat:      true,
        }, "includes", "depfile", "generator")
 )