1From 610d6a7c8c9d21f10b225f971a377be49bbaea4f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 16 Mar 2017 09:02:13 -0700
4Subject: [PATCH] clang: Prepend trailing '/' to sysroot
5
6This is needed to handle a case where clang
7isntall and target sysroot are perilously same
8
9e.g.
10
11sysroot = /mnt/clang/recipe-sysroot
12clang install = /mnt/clang/recipe-sysroot-native
13
14in this case it will mistakenly assume that
15clang is installed under the same sysroot dir
16and it will try to add relative ../lib paths
17to linker steps which would then be wrong
18since they will become relative to clang
19installation and not sysroot
20
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22---
23 clang/lib/Driver/ToolChains/Linux.cpp | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
27index 97e987c37e4a..f9e233f15dfc 100644
28--- a/clang/lib/Driver/ToolChains/Linux.cpp
29+++ b/clang/lib/Driver/ToolChains/Linux.cpp
30@@ -181,7 +181,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
31   Multilibs = GCCInstallation.getMultilibs();
32   SelectedMultilib = GCCInstallation.getMultilib();
33   llvm::Triple::ArchType Arch = Triple.getArch();
34-  std::string SysRoot = computeSysRoot();
35+  std::string SysRoot = computeSysRoot() + "/";
36   ToolChain::path_list &PPaths = getProgramPaths();
37
38   Generic_GCC::PushPPaths(PPaths);
39