Sporadic build failure doing 'make -j' from CMake-generated Unix Makefiles in AArch64 backend

Hi everyone. I’m seeing a sporadic failure in building the AArch64 backend when doing a parallel make from CMake-generated Unix makefiles:

  • (cd “$WORKSPACE/llvm/build” &&
    cmake -G “Unix Makefiles”
    … &&
    make -j &&
    make install)

…normal build output…

make[2]: *** No rule to make target lib/Target/AArch64/AArch64GenDAGISel.inc', needed by lib/Target/AArch64/Utils/CMakeFiles/LLVMAArch64Utils.dir/AArch64BaseInfo.cpp.o’. Stop.
make[1]: *** [lib/Target/AArch64/Utils/CMakeFiles/LLVMAArch64Utils.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…

It doesn’t happen consistently, so maybe there’s a missing dependency there that causes it to try to build things out of order with -j.