[llvm-commits] [PATCH] Clang fails to find correct lib path from GNU binutils for ARM supporting multi-arch folder

Jiangning Liu jiangning.liu at arm.com
Tue Jul 10 03:06:31 PDT 2012


Hi,

This patch is to fix a simple bug in Clang driver. Clang fails to find
correct path prefix for libc object files from GNU binutils supporting
multi-arch folder for ARM target. For example, on Ubuntu 11.10 for ARM,
Clang driver doesn't find and path prefix for crt1.o, crti.o and crtn.o when
passing command line options to GNU linker. The fix completely follows the
implementation of other targets.

diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 93df747..b858c3e 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1905,6 +1905,11 @@ static std::string getMultiarchTriple(const
llvm::Triple TargetTriple,
     // common linux triples that don't quite match the Clang triple for
both
     // 32-bit and 64-bit targets. Multiarch fixes its install triples to
these
     // regardless of what the actual target triple is.
+  case llvm::Triple::arm:
+  case llvm::Triple::thumb:
+    if (llvm::sys::fs::exists(SysRoot + "/lib/arm-linux-gnueabi"))
+      return "arm-linux-gnueabi";
+    return TargetTriple.str();
   case llvm::Triple::x86:
     if (llvm::sys::fs::exists(SysRoot + "/lib/i386-linux-gnu"))
       return "i386-linux-gnu";

Thanks,
-Jiangning
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multi_arch_1.patch
Type: application/octet-stream
Size: 784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120710/f9009ffe/attachment.obj>


More information about the llvm-commits mailing list