-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[offload] Add missing build dependency #149326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-offload Author: Joachim (jprotze) Changeslibc++ headers must be generated before compiling part of liboffload. Full diff: https://github.com/llvm/llvm-project/pull/149326.diff 1 Files Affected:
diff --git a/offload/tools/offload-tblgen/CMakeLists.txt b/offload/tools/offload-tblgen/CMakeLists.txt
index 15525dc44ea60..64562fc72feac 100644
--- a/offload/tools/offload-tblgen/CMakeLists.txt
+++ b/offload/tools/offload-tblgen/CMakeLists.txt
@@ -22,5 +22,9 @@ add_tablegen(offload-tblgen OFFLOAD
RecordTypes.hpp
)
+if(TARGET cxx-headers)
+ add_dependencies(offload-tblgen cxx-headers)
+endif()
+
set(OFFLOAD_TABLEGEN_EXE "${OFFLOAD_TABLEGEN_EXE}" CACHE INTERNAL "")
set(OFFLOAD_TABLEGEN_TARGET "${OFFLOAD_TABLEGEN_TARGET}" CACHE INTERNAL "")
|
This change looks fine, but is there a reason it only affects |
I was also a bit surprised, that adding this specific dependency fixes the build reproducibly (I did multiple clean builds with 100 processes). I think, that simply all other liboffload code depends on
|
So, this is for bootstapping with libcxx headers? It makes sense but i am wondering why it only shows up here. |
I'm not completely sure, what you mean with bootstrapping here, but I would say: No! It affects building the whole llvm-project, even when using a llvm build from the same sources (built without offload). The problem is that for compiling the runtimes, we use the clang from the outer build directory, but it doesn't have the includes available at this point. I tried to understand the dependencies in the ninja build file. I think that all other targets in offload have a dependency on some inc files that are processes with offload-tblgen and therefore have a dependency on offload-tblgen. |
I just tested, whether I can use a more general dependency and tried Empirically, I would say this dependency is both necessary and sufficient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since in a bootstrapping build the just-built Clang is being used, and offload-tblgen is writen in C++, requiring the libc++ includes to be builts before makes sense (unless Clang decides to use a a libstdc++ installation).
It looks like the entire tblgen setup will not work when building the runtimes for other targets than "default", but that's another issue.
@@ -22,5 +22,9 @@ add_tablegen(offload-tblgen OFFLOAD | |||
RecordTypes.hpp | |||
) | |||
|
|||
if(TARGET cxx-headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment for what this dependency is for?
libc++ headers must be generated before compiling part of liboffload. The build error occurs if clang is configured to use libc++ by default. Fixes issue llvm#149324
1f2340a
to
9e30007
Compare
libc++ headers must be generated before compiling part of liboffload.
The build error occurs if clang is configured to use libc++ by default.
Fixes issue #149324