[clang] [clang][Driver] Handle ROCm installation layout of lib/llvm/bin/clang (PR #138928)

Jacob Lambert via cfe-commits cfe-commits at lists.llvm.org
Wed May 7 11:03:42 PDT 2025


================
@@ -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.
----------------
lamb-j wrote:

```suggestion
      // /opt/rocm/lib/llvm/bin, so also back up if within the lib dir still
```

https://github.com/llvm/llvm-project/pull/138928


More information about the cfe-commits mailing list