-From b2205f063ec2644d0777b277d77426f0e55509fa Mon Sep 17 00:00:00 2001
+From b9831e3886b22d243eeb01f0ae67e9485aafd64b 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 02/18] clang: driver: Use /lib for ldso on OE
+Subject: [PATCH 01/18] clang: driver: Use /lib for ldso on OE
 
 OE does not follow the default base_libdir
 that clang has, therefore adjust it for OE

     Loader = "ld-linux.so.2";
     break;
   case llvm::Triple::systemz:
@@ -631,7 +631,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.20.1


in multilib case OE switches the base libdir
for 64bit to /lib64 instead of /lib

Make sure that the change only happens for cross
compilation on x86_64 architecture

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

diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index e9169e91fd4..9c08a794f5c 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -595,12 +595,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
     Loader = "ld.so.1";
     break;
   case llvm::Triple::ppc64:
