Index: lib/Driver/ToolChain.cpp
===================================================================
--- lib/Driver/ToolChain.cpp	(revision 160718)
+++ lib/Driver/ToolChain.cpp	(working copy)
@@ -128,32 +128,37 @@
 
 std::string ToolChain::ComputeLLVMTriple(const ArgList &Args, 
                                          types::ID InputType) const {
+  llvm::Triple Triple = getTriple();
+  // FIXME: Thumb should just be another -target-feaure, not in the triple.
+  StringRef Suffix = getLLVMArchSuffixForARM(getARMTargetCPU(Args, Triple));
+
   switch (getTriple().getArch()) {
   default:
     return getTripleString();
 
-  case llvm::Triple::arm:
-  case llvm::Triple::thumb: {
+  case llvm::Triple::thumb:
     // FIXME: Factor into subclasses.
-    llvm::Triple Triple = getTriple();
+    Triple.setArchName("thumb" + Suffix.str());
+    break;
 
-    // Thumb2 is the default for V7 on Darwin.
-    //
-    // FIXME: Thumb should just be another -target-feaure, not in the triple.
-    StringRef Suffix =
-      getLLVMArchSuffixForARM(getARMTargetCPU(Args, Triple));
-    bool ThumbDefault = (Suffix == "v7" && getTriple().isOSDarwin());
-    std::string ArchName = "arm";
+  case llvm::Triple::arm: {
+    if (Triple.isOSDarwin()) {
+      // Thumb2 is the default for V7 on Darwin.
+      // FIXME: Shouldn't Thumb2 be the default on all systems?
+      bool ThumbDefault = (Suffix == "v7");
 
-    // Assembly files should start in ARM mode.
-    if (InputType != types::TY_PP_Asm &&
-        Args.hasFlag(options::OPT_mthumb, options::OPT_mno_thumb, ThumbDefault))
-      ArchName = "thumb";
-    Triple.setArchName(ArchName + Suffix.str());
-
-    return Triple.getTriple();
+      // Assembly files should start in ARM mode.
+      if (InputType != types::TY_PP_Asm &&
+          Args.hasFlag(options::OPT_mthumb, options::OPT_mno_thumb, ThumbDefault)) {
+        Triple.setArchName("thumb" + Suffix.str());
+        break;
+      }
+    }
+    // Everything else is just ARM
+    Triple.setArchName("arm" + Suffix.str());
   }
   }
+  return Triple.getTriple();
 }
 
 std::string ToolChain::ComputeEffectiveClangTriple(const ArgList &Args, 
Index: test/Driver/thumb-triple.c
===================================================================
--- test/Driver/thumb-triple.c	(revision 0)
+++ test/Driver/thumb-triple.c	(revision 0)
@@ -0,0 +1,7 @@
+// RUN: %clang -target thumbv7a-unknown-linux-gnueabi -S %s -o - | FileCheck %s
+
+// CHECK: .thumb_func
+extern foo;
+int get_foo() {
+    return foo;
+}
