Driver: Make sure to get the default arch name from the tool chain, not the
host; the toolchain may differ based on command line arguments.
llvm-svn: 67106
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index e809487..c2df48cb 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -155,6 +155,8 @@
ArgList *Args = ParseArgStrings(Start, End);
Host = GetHostInfo(HostTriple);
+ // FIXME: This shouldn't live inside Driver, the default tool chain
+ // is part of the compilation (it is arg dependent).
DefaultToolChain = Host->getToolChain(*Args);
// FIXME: This behavior shouldn't be here.
@@ -306,7 +308,7 @@
// When there is no explicit arch for this platform, get one from
// the host so that -Xarch_ is handled correctly.
if (!Archs.size()) {
- const char *Arch = Host->getArchName().c_str();
+ const char *Arch = DefaultToolChain->getArchName().c_str();
Archs.push_back(Arch);
}