]> granicus.if.org Git - clang/commitdiff
Driver/Darwin: Pass the right arch specific dir for ARM, when linking.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 26 Aug 2010 00:55:52 +0000 (00:55 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 26 Aug 2010 00:55:52 +0000 (00:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112124 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index 5be810da4f296fe3636b2d34a8a3317785904f31..f5ed56b3ef6185f78e552c6843cb58860c945693 100644 (file)
@@ -409,9 +409,17 @@ void DarwinClang::AddLinkSearchPathArgs(const ArgList &Args,
   default:
     break;
   case llvm::Triple::arm:
-  case llvm::Triple::thumb:
-    // FIXME: Get the right subdirectory for ARM.
+  case llvm::Triple::thumb: {
+    std::string Triple = ComputeLLVMTriple(Args);
+    llvm::StringRef TripleStr = Triple;
+    if (TripleStr.startswith("armv5") || TripleStr.startswith("thumbv5"))
+      ArchSpecificDir = "v5";
+    else if (TripleStr.startswith("armv6") || TripleStr.startswith("thumbv6"))
+      ArchSpecificDir = "v6";
+    else if (TripleStr.startswith("armv7") || TripleStr.startswith("thumbv7"))
+      ArchSpecificDir = "v7";
     break;
+  }
   case llvm::Triple::ppc64:
     ArchSpecificDir = "ppc64";
     break;
@@ -422,7 +430,6 @@ void DarwinClang::AddLinkSearchPathArgs(const ArgList &Args,
 
   if (ArchSpecificDir) {
     P.appendComponent(ArchSpecificDir);
-    llvm::errs() << P.str() << "\n";
     if (P.exists())
       CmdArgs.push_back(Args.MakeArgString("-L" + P.str()));
     P.eraseComponent();