diff options
author | Tom Stellard <tstellar@redhat.com> | 2018-06-30 02:55:54 +0000 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2018-06-30 02:55:54 +0000 |
commit | c5fe10f365247c3dd9416b7ec8bad73a60b5946e (patch) | |
tree | 38b098394c226f08bbb452665f904f8bcf1b3047 /clang/lib/Driver/ToolChains/Linux.cpp | |
parent | 0e9de769a0056f50fcf3d8ef59fbef6ca7b6ad66 (diff) | |
download | bcm5719-llvm-c5fe10f365247c3dd9416b7ec8bad73a60b5946e.tar.gz bcm5719-llvm-c5fe10f365247c3dd9416b7ec8bad73a60b5946e.zip |
Driver: Don't mix system tools with devtoolset tools on RHEL
Summary:
On RHEL, devtoolset provides a more up-to-date toolchain than the base
install, and we want to make sure all the tools use are from the same
toolchain.
Reviewers: rsmith, bruno
Reviewed By: bruno
Subscribers: bruno, cfe-commits
Differential Revision: https://reviews.llvm.org/D34848
llvm-svn: 336037
Diffstat (limited to 'clang/lib/Driver/ToolChains/Linux.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/Linux.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp index 3b99ce581fa..9a477556cf0 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -238,6 +238,15 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) ExtraOpts.push_back("relro"); } + if (GCCInstallation.getParentLibPath().find("opt/rh/devtoolset") != + StringRef::npos) + // 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()); + if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb) ExtraOpts.push_back("-X"); |