[clang] 9e6f19f - Fix missing build dependency on omp_gen.

Simon Tatham via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 2 01:18:51 PDT 2020


Author: Simon Tatham
Date: 2020-07-02T09:16:15+01:00
New Revision: 9e6f19fd8390d39a0351941da1582f888d18c369

URL: https://github.com/llvm/llvm-project/commit/9e6f19fd8390d39a0351941da1582f888d18c369
DIFF: https://github.com/llvm/llvm-project/commit/9e6f19fd8390d39a0351941da1582f888d18c369.diff

LOG: Fix missing build dependency on omp_gen.

Summary:
`include/llvm/Frontend/OpenMP/CMakeLists.txt` creates a new target
called `omp_gen` which builds the generated include file `OMP.h.inc`.
This target must therefore be a dependency of every compilation step
whose transitive #include dependencies contain `OMP.h.inc`, or else
it's possible for builds to fail if Ninja (or make or whatever)
schedules that compilation step before building `OMP.h.inc` at all.

A few of those dependencies are currently missing, which leads to
intermittent build failures, depending on the order that Ninja (or
whatever) happens to schedule its commands. As far as I can see,
compiles in `clang/lib/CodeGen`, `clang/lib/Frontend`, and
`clang/examples` all depend transitivily on `OMP.h.inc` (usually via
`clang/AST/AST.h`), but don't have the formal dependency in the ninja
graph.

Adding `omp_gen` to the dependencies of `clang-tablegen-targets` seems
to be the way to get the missing dependency into the `clang/examples`
subdirectory. This also fixes the other two clang subdirectories, as
far as I can see.

Reviewers: clementval, thakis, chandlerc, jdoerfert

Reviewed By: clementval

Subscribers: cfe-commits, jdenny, mgorny, sstefan1, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D82659

Added: 
    

Modified: 
    clang/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 5a5e34aacbeb..83c30528499c 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -517,7 +517,10 @@ add_subdirectory(include)
 
 # All targets below may depend on all tablegen'd files.
 get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY CLANG_TABLEGEN_TARGETS)
-add_custom_target(clang-tablegen-targets DEPENDS ${CLANG_TABLEGEN_TARGETS})
+add_custom_target(clang-tablegen-targets
+  DEPENDS
+  omp_gen
+  ${CLANG_TABLEGEN_TARGETS})
 set_target_properties(clang-tablegen-targets PROPERTIES FOLDER "Misc")
 list(APPEND LLVM_COMMON_DEPENDS clang-tablegen-targets)
 


        


More information about the cfe-commits mailing list