-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
[CMAKE][AMDGPU] fix build failure caused by PR #133619 #133776
Conversation
While clangCodeGenTargetBuiltins and clangCodeGenTargets are static libraries clangCodeGen is not and so this is creating a circular reference in the linux amdgpu-offload CIs on ubuntu and RHEL. removing the circular reference doesn't break anything and looks to be a vestigial element of the origional PR.
@llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-clang Author: Farzon Lotfi (farzonl) ChangesWhile clangCodeGenTargetBuiltins and clangCodeGenTargets are static libraries clangCodeGen is not and so this is creating a circular reference in the linux amdgpu-offload CIs on ubuntu and RHEL. removing the circular reference doesn't break anything and looks to be a vestigial element of the origional PR. Full diff: https://github.com/llvm/llvm-project/pull/133776.diff 2 Files Affected:
diff --git a/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
index 8526c063b4593..76be68a11d02a 100644
--- a/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
+++ b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
@@ -12,8 +12,3 @@ add_clang_library(clangCodeGenTargetBuiltins STATIC
WebAssembly.cpp
X86.cpp
)
-
-target_link_libraries(clangCodeGenTargetBuiltins
- PRIVATE
- clangCodeGen
-)
diff --git a/clang/lib/CodeGen/Targets/CMakeLists.txt b/clang/lib/CodeGen/Targets/CMakeLists.txt
index fd79b6191b379..6b6e7ce5b0b29 100644
--- a/clang/lib/CodeGen/Targets/CMakeLists.txt
+++ b/clang/lib/CodeGen/Targets/CMakeLists.txt
@@ -28,8 +28,3 @@ add_clang_library(clangCodeGenTargets STATIC
X86.cpp
XCore.cpp
)
-
-target_link_libraries(clangCodeGenTargets
- PRIVATE
- clangCodeGen
-)
|
@llvm/pr-subscribers-clang-codegen Author: Farzon Lotfi (farzonl) ChangesWhile clangCodeGenTargetBuiltins and clangCodeGenTargets are static libraries clangCodeGen is not and so this is creating a circular reference in the linux amdgpu-offload CIs on ubuntu and RHEL. removing the circular reference doesn't break anything and looks to be a vestigial element of the origional PR. Full diff: https://github.com/llvm/llvm-project/pull/133776.diff 2 Files Affected:
diff --git a/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
index 8526c063b4593..76be68a11d02a 100644
--- a/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
+++ b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
@@ -12,8 +12,3 @@ add_clang_library(clangCodeGenTargetBuiltins STATIC
WebAssembly.cpp
X86.cpp
)
-
-target_link_libraries(clangCodeGenTargetBuiltins
- PRIVATE
- clangCodeGen
-)
diff --git a/clang/lib/CodeGen/Targets/CMakeLists.txt b/clang/lib/CodeGen/Targets/CMakeLists.txt
index fd79b6191b379..6b6e7ce5b0b29 100644
--- a/clang/lib/CodeGen/Targets/CMakeLists.txt
+++ b/clang/lib/CodeGen/Targets/CMakeLists.txt
@@ -28,8 +28,3 @@ add_clang_library(clangCodeGenTargets STATIC
X86.cpp
XCore.cpp
)
-
-target_link_libraries(clangCodeGenTargets
- PRIVATE
- clangCodeGen
-)
|
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.
LGTM
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.
I tried to build it locally and I got a series of 'undefined reference' errors. Sorry, I will need to revert my approval.
Attn. @jhuber6
Thanks
@farzonl can you please revert the original commit? It seems to break just any LLVM build, so I guess the CI testing of all new PRs should be affected. |
I don't see it breaking any build in LLVM, just the amd offload ones. Al the Premerge tests also passed. I suspect the but the PR to revert is here #133795 |
Could you provide the failures you were seeing, specific build instructions, and platform you were doing this on. |
Thanks! I think, it only affects the A couple more examples: https://lab.llvm.org/buildbot/#/builders/145/builds/6156 https://lab.llvm.org/buildbot/#/builders/89/builds/19738 |
Thanks @vzakhari, I also am building with -DBUILD_SHARED_LIBS=ON |
…3850) fixes #133199 As of the third commit the fix to the linker missing references in `Targets/DirectX.cpp` found in #133776 was fixed by moving `HLSLBufferLayoutBuilder.cpp` to `clang/lib/CodeGen/Targets/`. It fixes the circular reference issue found in #133619 for all `-DBUILD_SHARED_LIBS=ON` builds by removing `target_link_libraries` from the sub directory cmake files. testing for amdgpu offload was done via `cmake -B ../llvm_amdgpu -S llvm -GNinja -C offload/cmake/caches/Offload.cmake -DCMAKE_BUILD_TYPE=Release` PR #132252 Created a second file that shared <TargetName>.cpp in clang/lib/CodeGen/CMakeLists.txt For example There were two AMDGPU.cpp's one in TargetBuiltins and the other in Targets. Even though these were in different directories libtool warns that it might not distinguish them because they share the same base name. There are two potential fixes. The easy fix is to rename one of them and keep one cmake file. That solution though doesn't future proof this problem in the event of a third <TargetName>.cpp and it seems teams want to just use the target name #132252 (comment). The alternative fix that this PR went with is to seperate the cmake files into their own sub directories as static libs.
…rnings (#133850) fixes llvm/llvm-project#133199 As of the third commit the fix to the linker missing references in `Targets/DirectX.cpp` found in llvm/llvm-project#133776 was fixed by moving `HLSLBufferLayoutBuilder.cpp` to `clang/lib/CodeGen/Targets/`. It fixes the circular reference issue found in llvm/llvm-project#133619 for all `-DBUILD_SHARED_LIBS=ON` builds by removing `target_link_libraries` from the sub directory cmake files. testing for amdgpu offload was done via `cmake -B ../llvm_amdgpu -S llvm -GNinja -C offload/cmake/caches/Offload.cmake -DCMAKE_BUILD_TYPE=Release` PR llvm/llvm-project#132252 Created a second file that shared <TargetName>.cpp in clang/lib/CodeGen/CMakeLists.txt For example There were two AMDGPU.cpp's one in TargetBuiltins and the other in Targets. Even though these were in different directories libtool warns that it might not distinguish them because they share the same base name. There are two potential fixes. The easy fix is to rename one of them and keep one cmake file. That solution though doesn't future proof this problem in the event of a third <TargetName>.cpp and it seems teams want to just use the target name llvm/llvm-project#132252 (comment). The alternative fix that this PR went with is to seperate the cmake files into their own sub directories as static libs.
While clangCodeGenTargetBuiltins and clangCodeGenTargets are static libraries clangCodeGen is not and so this is creating a circular reference in the linux amdgpu-offload CIs on ubuntu and RHEL.
removing the circular reference doesn't break anything and looks to be a vestigial element of the origional PR.