[cfe-commits] r127128 - in /cfe/trunk/lib/Driver: ToolChains.cpp Tools.cpp

Douglas Gregor dgregor at apple.com
Sun Mar 6 11:11:49 PST 2011


Author: dgregor
Date: Sun Mar  6 13:11:49 2011
New Revision: 127128

URL: http://llvm.org/viewvc/llvm-project?rev=127128&view=rev
Log:
Fix driver for thumb-capable ARM hosts, from Mikko Lehtonen!

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=127128&r1=127127&r2=127128&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sun Mar  6 13:11:49 2011
@@ -114,7 +114,8 @@
   switch (getTriple().getArch()) {
   default:
     return getArchName();
-
+  
+  case llvm::Triple::thumb:
   case llvm::Triple::arm: {
     if (const Arg *A = Args.getLastArg(options::OPT_march_EQ))
       if (const char *Arch = GetArmArchForMArch(A->getValue(Args)))
@@ -1401,7 +1402,7 @@
     Lib64 = "lib64";
 
   std::string GccTriple = "";
-  if (Arch == llvm::Triple::arm) {
+  if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb) {
     if (!llvm::sys::fs::exists("/usr/lib/gcc/arm-linux-gnueabi", Exists) &&
         Exists)
       GccTriple = "arm-linux-gnueabi";
@@ -1486,7 +1487,7 @@
     ExtraOpts.push_back("relro");
   }
 
-  if (Arch == llvm::Triple::arm)
+  if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
     ExtraOpts.push_back("-X");
 
   if (IsFedora(Distro) || Distro == UbuntuMaverick)

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=127128&r1=127127&r2=127128&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sun Mar  6 13:11:49 2011
@@ -3599,13 +3599,15 @@
   CmdArgs.push_back("-m");
   if (ToolChain.getArch() == llvm::Triple::x86)
     CmdArgs.push_back("elf_i386");
-  else if (ToolChain.getArch() == llvm::Triple::arm)
+  else if (ToolChain.getArch() == llvm::Triple::arm 
+           ||  ToolChain.getArch() == llvm::Triple::thumb)
     CmdArgs.push_back("armelf_linux_eabi");
   else
     CmdArgs.push_back("elf_x86_64");
 
   if (Args.hasArg(options::OPT_static)) {
-    if (ToolChain.getArch() == llvm::Triple::arm)
+    if (ToolChain.getArch() == llvm::Triple::arm
+        || ToolChain.getArch() == llvm::Triple::thumb)
       CmdArgs.push_back("-Bstatic");
     else
       CmdArgs.push_back("-static");
@@ -3614,12 +3616,14 @@
   }
 
   if (ToolChain.getArch() == llvm::Triple::arm ||
+      ToolChain.getArch() == llvm::Triple::thumb ||
       (!Args.hasArg(options::OPT_static) &&
        !Args.hasArg(options::OPT_shared))) {
     CmdArgs.push_back("-dynamic-linker");
     if (ToolChain.getArch() == llvm::Triple::x86)
       CmdArgs.push_back("/lib/ld-linux.so.2");
-    else if (ToolChain.getArch() == llvm::Triple::arm)
+    else if (ToolChain.getArch() == llvm::Triple::arm ||
+             ToolChain.getArch() == llvm::Triple::thumb)
       CmdArgs.push_back("/lib/ld-linux.so.3");
     else
       CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");





More information about the cfe-commits mailing list