diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-06-30 23:56:13 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-30 23:56:13 +0000 |
commit | 424b6613a9e5631d61c4c8ed2f1601457b64bfd4 (patch) | |
tree | e45a5b10ec3c3af2752a4de7056620ba72bfdd71 /lib/Driver/ToolChains.cpp | |
parent | 8578981ada66dae44a5a0752f949a5e65b477588 (diff) |
Driver/Darwin: Add one -L for the DarwinClang toolchain to point into the gcc
library directory, as we still rely on a few libraries that are hiding there (in
particular libstdc++.dylib).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r-- | lib/Driver/ToolChains.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index a31978c0bc..b071864e21 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -325,6 +325,33 @@ DarwinClang::DarwinClang(const HostInfo &Host, const llvm::Triple& Triple, void DarwinClang::AddLinkSearchPathArgs(const ArgList &Args, ArgStringList &CmdArgs) const { // The Clang toolchain uses explicit paths for internal libraries. + + // Unfortunately, we still might depend on a few of the libraries that are + // only available in the gcc library directory (in particular + // libstdc++.dylib). For now, hardcode the path to the known install location. + llvm::sys::Path P(getDriver().Dir); + P.eraseComponent(); // .../usr/bin -> ../usr + P.appendComponent("lib"); + P.appendComponent("gcc"); + switch (getTriple().getArch()) { + default: + assert(0 && "Invalid Darwin arch!"); + case llvm::Triple::x86: + case llvm::Triple::x86_64: + P.appendComponent("i686-apple-darwin10"); + break; + case llvm::Triple::arm: + case llvm::Triple::thumb: + P.appendComponent("arm-apple-darwin10"); + break; + case llvm::Triple::ppc: + case llvm::Triple::ppc64: + P.appendComponent("powerpc-apple-darwin10"); + break; + } + P.appendComponent("4.2.1"); + if (P.exists()) + CmdArgs.push_back(Args.MakeArgString("-L" + P.str())); } void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, |