[PATCH] D127310: [clang][driver] fix to correctly set devtoolset on RHEL

Nemanja Ivanovic via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 08:13:06 PDT 2022


nemanjai added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:2152
         ChosenToolsetVersion = ToolsetVersion;
-        ChosenToolsetDir = "/opt/rh/" + ToolsetDir.str();
+        ChosenToolsetDir = "/opt/rh/" + ToolsetDir.str() + "/root/usr";
       }
----------------
I believe this will cause a failure with the unit test added in the original patch.

And presumably since the unit test tests for paths that don't include `/root/usr`, there are real world toolsets that also don't use that suffix. So we should presumably add both `Prefixes`.


================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:2157
     if (ChosenToolsetVersion > 0)
       Prefixes.push_back(ChosenToolsetDir);
   }
----------------
Can we not just change this to something like:
```
    if (ChosenToolsetVersion > 0) {
      Prefixes.push_back(ChosenToolsetDir);
      Prefixes.push_back(ChosenToolsetDir + "/root/usr");
    }
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127310/new/

https://reviews.llvm.org/D127310



More information about the cfe-commits mailing list