]> granicus.if.org Git - clang/commitdiff
Driver: Don't mix system tools with devtoolset tools on RHEL
authorTom Stellard <tstellar@redhat.com>
Wed, 31 May 2017 09:58:34 +0000 (09:58 +0000)
committerTom Stellard <tstellar@redhat.com>
Wed, 31 May 2017 09:58:34 +0000 (09:58 +0000)
For example, we don't want to mix a devtoolset gcc with system ld, because
they don't always work together.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@304293 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index 5ddc32bfc627ec6bb4b26a7f82a4c42b8a5a6050..1dd34ae70a705ea66bb79a4c5ba744ad12fa6598 100644 (file)
@@ -4111,6 +4111,15 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
 
   Distro Distro(D.getVFS());
 
+  if (Distro.IsRedhat()) {
+    // 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());
+  }
+
   if (Distro.IsOpenSUSE() || Distro.IsUbuntu()) {
     ExtraOpts.push_back("-z");
     ExtraOpts.push_back("relro");