[cfe-commits] r111839 - /cfe/trunk/lib/Driver/ToolChains.cpp
Daniel Dunbar
daniel at zuster.org
Mon Aug 23 13:58:52 PDT 2010
Author: ddunbar
Date: Mon Aug 23 15:58:52 2010
New Revision: 111839
URL: http://llvm.org/viewvc/llvm-project?rev=111839&view=rev
Log:
Driver/Darwin: When using the simplified Clang toolchain, make sure to also pass
the arch specific gcc lib path.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=111839&r1=111838&r2=111839&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Mon Aug 23 15:58:52 2010
@@ -263,7 +263,7 @@
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;
@@ -369,6 +369,32 @@
break;
}
P.appendComponent("4.2.1");
+
+ // Determine the arch specific GCC subdirectory.
+ const char *ArchSpecificDir = 0;
+ switch (getTriple().getArch()) {
+ default:
+ break;
+ case llvm::Triple::arm:
+ case llvm::Triple::thumb:
+ // FIXME: Get the right subdirectory for ARM.
+ break;
+ case llvm::Triple::ppc64:
+ ArchSpecificDir = "ppc64";
+ break;
+ case llvm::Triple::x86_64:
+ ArchSpecificDir = "x86_64";
+ break;
+ }
+
+ if (ArchSpecificDir) {
+ P.appendComponent(ArchSpecificDir);
+ llvm::errs() << P.str() << "\n";
+ if (P.exists())
+ CmdArgs.push_back(Args.MakeArgString("-L" + P.str()));
+ P.eraseComponent();
+ }
+
if (P.exists())
CmdArgs.push_back(Args.MakeArgString("-L" + P.str()));
}
More information about the cfe-commits
mailing list