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

Chad Rosier mcrosier at apple.com
Tue Jul 10 10:00:00 PDT 2012


Jiangning,
LGTM.  If you have commit access please commit.  Otherwise, let me know and I'll do it on your behalf.
Also, not a big deal, but this should have been sent to the cfe-commits list.

 Chad

On Jul 10, 2012, at 3:06 AM, Jiangning Liu wrote:

> 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<multi_arch_1.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list