]> granicus.if.org Git - clang/commitdiff
Handle O32/N64 ABIs for NetBSD/MIPS64. From Matt Thomas.
authorJoerg Sonnenberger <joerg@bec.de>
Sun, 2 Feb 2014 22:59:16 +0000 (22:59 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Sun, 2 Feb 2014 22:59:16 +0000 (22:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200668 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp
lib/Driver/Tools.cpp

index 00341728b1ec5882e4ee4f80fefd867c02ca830c..9c4213bc18d9edb34f475c350fc205edc09b25b6 100644 (file)
@@ -2248,6 +2248,13 @@ NetBSD::NetBSD(const Driver &D, const llvm::Triple& Triple, const ArgList &Args)
         break;
       }
       break;
+    case llvm::Triple::mips64:
+    case llvm::Triple::mips64el:
+      if (hasMipsABIArg(Args, "o32"))
+        getFilePaths().push_back("=/usr/lib/o32");
+      else if (hasMipsABIArg(Args, "64"))
+        getFilePaths().push_back("=/usr/lib/64");
+      break;
     default:
       break;
     }
index 4bfc272f743a329ce5df54066c5681483e8f4f6e..10194b1dda7e4194c3cf26c6379bd9e116a985a9 100644 (file)
@@ -6132,6 +6132,22 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
       break;
     }
     break;
+  case llvm::Triple::mips64:
+  case llvm::Triple::mips64el:
+    if (hasMipsABIArg(Args, "32")) {
+      CmdArgs.push_back("-m");
+      if (getToolChain().getArch() == llvm::Triple::mips64)
+        CmdArgs.push_back("elf32btsmip");
+      else
+        CmdArgs.push_back("elf32ltsmip");
+   } else if (hasMipsABIArg(Args, "64")) {
+     CmdArgs.push_back("-m");
+     if (getToolChain().getArch() == llvm::Triple::mips64)
+       CmdArgs.push_back("elf64btsmip");
+     else
+       CmdArgs.push_back("elf64ltsmip");
+   }
+   break;
   default:
     break;
   }