aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-09-17 08:22:12 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-09-17 08:22:12 +0000
commit0e50ee4b94929ff172099bbd0c1029721ac79bc2 (patch)
tree74ec530b346359755989b35e9beef74060d9b90e /lib
parentdb2f237956122fb54b45c988ed9cffeee48e17f9 (diff)
Driver/DarwinClang: Add GCC libexec paths so we can find the cc1 binaries if we
ever use fallback. - Not necessary for clang as a compiler, but useful for testing purposes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114172 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Driver/ToolChains.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index c1b44e45eb..dbb2a9f3d2 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -373,10 +373,30 @@ void DarwinGCC::AddLinkRuntimeLibArgs(const ArgList &Args,
DarwinClang::DarwinClang(const HostInfo &Host, const llvm::Triple& Triple)
: Darwin(Host, Triple)
{
+ getProgramPaths().push_back(getDriver().getInstalledDir());
+ if (getDriver().getInstalledDir() != getDriver().Dir)
+ getProgramPaths().push_back(getDriver().Dir);
+
// We expect 'as', 'ld', etc. to be adjacent to our install dir.
getProgramPaths().push_back(getDriver().getInstalledDir());
if (getDriver().getInstalledDir() != getDriver().Dir)
getProgramPaths().push_back(getDriver().Dir);
+
+ // For fallback, we need to know how to find the GCC cc1 executables, so we
+ // also add the GCC libexec paths. This is legiy code that can be removed once
+ // fallback is no longer useful.
+ std::string ToolChainDir = "i686-apple-darwin";
+ ToolChainDir += llvm::utostr(DarwinVersion[0]);
+ ToolChainDir += "/4.2.1";
+
+ std::string Path = getDriver().Dir;
+ Path += "/../libexec/gcc/";
+ Path += ToolChainDir;
+ getProgramPaths().push_back(Path);
+
+ Path = "/usr/libexec/gcc/";
+ Path += ToolChainDir;
+ getProgramPaths().push_back(Path);
}
void DarwinClang::AddLinkSearchPathArgs(const ArgList &Args,