-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[clang][Driver] Handle ROCm installation layout of lib/llvm/bin/clang #138928
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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-clang Author: Jacob Lambert (lamb-j) ChangesCommitting on behalf of @stellaraccident Full diff: https://github.com/llvm/llvm-project/pull/138928.diff 1 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/AMDGPU.cpp b/clang/lib/Driver/ToolChains/AMDGPU.cpp
index 35ca019795ddc..7405ffecb577c 100644
--- a/clang/lib/Driver/ToolChains/AMDGPU.cpp
+++ b/clang/lib/Driver/ToolChains/AMDGPU.cpp
@@ -181,8 +181,15 @@ RocmInstallationDetector::getInstallationPathCandidates() {
// Some versions of the rocm llvm package install to /opt/rocm/llvm/bin
// Some versions of the aomp package install to /opt/rocm/aomp/bin
- if (ParentName == "llvm" || ParentName.starts_with("aomp"))
+ if (ParentName == "llvm" || ParentName.starts_with("aomp")) {
ParentDir = llvm::sys::path::parent_path(ParentDir);
+ ParentName = llvm::sys::path::filename(ParentDir);
+
+ // Some versions of the rocm llvm package install to
+ // /opt/rocm/lib/llvm/bin, so also back up if within the lib dir still.
+ if (ParentName == "lib")
+ ParentDir = llvm::sys::path::parent_path(ParentDir);
+ }
return Candidate(ParentDir.str(), /*StrictChecking=*/true);
};
|
@@ -181,8 +181,15 @@ RocmInstallationDetector::getInstallationPathCandidates() { | |||
|
|||
// Some versions of the rocm llvm package install to /opt/rocm/llvm/bin |
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.
Doesn't this end up being the clang resource directory? Why do we need additional handling?
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.
Also needs test
Committing on behalf of @stellaraccident