Index: clang/lib/Driver/ToolChains/Linux.cpp =================================================================== --- clang/lib/Driver/ToolChains/Linux.cpp +++ clang/lib/Driver/ToolChains/Linux.cpp @@ -244,9 +244,9 @@ // With devtoolset on RHEL, we want to add a bin directory that is relative // to the detected gcc install, because if we are using devtoolset gcc then // we want to use other tools from devtoolset (e.g. ld) instead of the - // standard system tools. - PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + - "/../bin").str()); + // standard system tools. This should take precedence over InstalledDir. + PPaths.insert(PPaths.begin(), + Twine(GCCInstallation.getParentLibPath() + "/../bin").str()); if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb) ExtraOpts.push_back("-X");