From fa869f4c31bf70694014d24f7b50623aa6247f47 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 21 May 2016 21:52:36 -0700
Subject: [PATCH 1/7] clang: driver: Use /lib for ldso on OE

OE does not follow the default base_libdir
that clang has, therefore adjust it for OE
it wont be able to support multilib since
in multilib case OE switches the base libdir
for 64bit to /lib64 instead of /lib

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 lib/Driver/ToolChains/Linux.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
index 1301cdf114..d59512627d 100644
--- a/lib/Driver/ToolChains/Linux.cpp
+++ b/lib/Driver/ToolChains/Linux.cpp
@@ -502,12 +502,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
     Loader = "ld.so.1";
     break;
   case llvm::Triple::ppc64:
-    LibDir = "lib64";
+    LibDir = "lib";
     Loader =
         (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
     break;
   case llvm::Triple::ppc64le:
-    LibDir = "lib64";
+    LibDir = "lib";
     Loader =
         (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
     break;
@@ -517,7 +517,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
     Loader = "ld-linux.so.2";
     break;
   case llvm::Triple::sparcv9:
-    LibDir = "lib64";
+    LibDir = "lib";
     Loader = "ld-linux.so.2";
     break;
   case llvm::Triple::systemz:
@@ -531,7 +531,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
   case llvm::Triple::x86_64: {
     bool X32 = Triple.getEnvironment() == llvm::Triple::GNUX32;
 
-    LibDir = X32 ? "libx32" : "lib64";
+    LibDir = "lib";
     Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2";
     break;
   }
-- 
2.16.1

