diff options
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r-- | lib/Driver/ToolChains.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 105eab0..1cd8ee1 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -217,6 +217,8 @@ Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA) const { void DarwinGCC::AddLinkSearchPathArgs(const ArgList &Args, ArgStringList &CmdArgs) const { + std::string Tmp; + // FIXME: Derive these correctly. if (getArchName() == "x86_64") { CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir + @@ -225,10 +227,24 @@ void DarwinGCC::AddLinkSearchPathArgs(const ArgList &Args, CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir + "/x86_64")); } + CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/" + ToolChainDir)); + + Tmp = getDriver().Dir + "/../lib/gcc/" + ToolChainDir; + if (llvm::sys::Path(Tmp).exists()) + CmdArgs.push_back(Args.MakeArgString("-L" + Tmp)); + Tmp = getDriver().Dir + "/../lib/gcc"; + if (llvm::sys::Path(Tmp).exists()) + CmdArgs.push_back(Args.MakeArgString("-L" + Tmp)); CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir)); // Intentionally duplicated for (temporary) gcc bug compatibility. CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir)); + Tmp = getDriver().Dir + "/../lib/" + ToolChainDir; + if (llvm::sys::Path(Tmp).exists()) + CmdArgs.push_back(Args.MakeArgString("-L" + Tmp)); + Tmp = getDriver().Dir + "/../lib"; + if (llvm::sys::Path(Tmp).exists()) + CmdArgs.push_back(Args.MakeArgString("-L" + Tmp)); CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir + "/../../../" + ToolChainDir)); CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir + @@ -656,6 +672,11 @@ const char *Darwin::GetForcedPicModel() const { return 0; } +bool Darwin::SupportsObjCGC() const { + // Garbage collection is supported everywhere except on iPhone OS. + return !isTargetIPhoneOS(); +} + /// Generic_GCC - A tool chain using the 'gcc' command to perform /// all subcommands; this relies on gcc translating the majority of /// command line options. |