summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2017-05-31 09:58:34 +0000
committerTom Stellard <tstellar@redhat.com>2017-05-31 09:58:34 +0000
commit476b65415fd05f9825ffec4af4a98844c6885c84 (patch)
tree008c0aaeca838d23683fbf23b5d595fc03f6ad92
parent9b5539e2ce96af00c820c471ffffa76011764e51 (diff)
Driver: Don't mix system tools with devtoolset tools on RHEL
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
-rw-r--r--lib/Driver/ToolChains.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 5ddc32bfc6..1dd34ae70a 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -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");