With the new LLVM_ENABLE_RUNTIMES option introduced in https://reviews.llvm.org/D40233, compiler-rt can now be included as a runtime. Since compiler-rt is needed for PGO, runtimes needs to be included as a dependency of clang-bootstrap-deps when building the stage1 compiler.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/runtimes/CMakeLists.txt | ||
---|---|---|
567 | I don't think we can add this dependency unconditionally. If LLVM_ENABLE_RUNTIMES isn't set, runtimes list would end up empty here https://github.com/llvm/llvm-project/blob/master/llvm/runtimes/CMakeLists.txt#L32, in which case we wouldn't define runtimes target at all here https://github.com/llvm/llvm-project/blob/master/llvm/runtimes/CMakeLists.txt#L497. We also cannot just check whether LLVM_ENABLE_RUNTIMES is set because in theory we still support the nested layout where users can place runtimes directly into llvm/runtimes subdirectory; we probably don't need this now that we're in monorepo, but we shouldn't break it until we officially announce the deprecation of that feature. |
llvm/runtimes/CMakeLists.txt | ||
---|---|---|
567 | We're not adding this dependency unconditionally. This line is under an if(runtimes) block, so at this point where we're adding runtimes to clang-bootstrap-deps, the runtimes list won't be empty and the runtimes target would be defined. Additionally, if the runtimes target wasn't defined, then the runtimes-configure target which is referenced in the line above also wouldn't be defined, but since that line works fine, adding an additional dependency on runtimes should be fine. |
I'd say "we need the profile runtime" instead of "we need it", just to be a bit more specific.