[OpenMP] Use Clang resource dir only in bootstrapping build#156018
[OpenMP] Use Clang resource dir only in bootstrapping build#156018Meinersbur merged 2 commits intollvm:mainfrom
Conversation
tblah
left a comment
There was a problem hiding this comment.
Thanks Michael. Makes sense to me but please wait for another review.
David and Pawel: this came up because of a missconfiguration of one of our internal CI bots. We have fixed that configuration now but I mentioned it to Michael anyway as it seemed like a regression.
|
@Meinersbur the commit message seems misleading. This is not what is deprecated: The other thing is. |
Thanks, this was a blunder |
|
I forgot that LLVM_RUNTIMES_BUILD does not imply LLVM_TREE_AVAILABLE (happens in non-boostrapping build: llvm-project/runtimes/CMakeLists.txt Lines 97 to 100 in 8cc1d6f Re-added LLVM_TREE_AVAILABLE condition and switched the if/else to keep the condition simpler. Please re-approve if you are OK with this change. |
In an LLVM_ENABLE_PROJECTS=openmp build, the LLVM build tree in which just-built Clang is available, but in contrast to an LLVM_ENABLE_RUNTIMES=openmp build, is not the compiler that openmp is built with (CMAKE_CXX_COMPILER). The latter compiler (which might also be gcc) will not look into the resource directory of just-built Clang, where the OpenMP headers are installed. There may not even be a just-built Clang without LLVM_ENABLE_PROJECTS=clang.
We cannot add the OpenMP header output directory to the search path which also include's Clang's internal headers that will conflict with CMAKE_CXX_COMPILER's internal headers. The only choice left is to use what the OpenMP standalone build does: Use CMAKE_CURRENT_BINARY_DIR which is added unconditionally to the header search path to compile openmp itself.
Note that LLVM_ENABLE_PROJECTS=openmp is deprecated. Consider switching to a LLVM_ENABLE_RUNTIMES=openmp build and supporting removing the LLVM_ENABLE_PROJECTS=openmp build mode.