summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch
blob: 0692cf6294e0d42e7dd0362c01f94141483c69da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From d9abc62bb1e99f56df20194122a1aac5a74d0282 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 16 Mar 2017 09:02:13 -0700
Subject: [PATCH 11/24] clang: Prepend trailing '/' to sysroot

This is needed to handle a case where clang
isntall and target sysroot are perilously same

e.g.

sysroot = /mnt/clang/recipe-sysroot
clang install = /mnt/clang/recipe-sysroot-native

in this case it will mistakenly assume that
clang is installed under the same sysroot dir
and it will try to add relative ../lib paths
to linker steps which would then be wrong
since they will become relative to clang
installation and not sysroot

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 clang/lib/Driver/ToolChains/Linux.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index 8606705b721..d908e40d86e 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -214,7 +214,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
   Multilibs = GCCInstallation.getMultilibs();
   SelectedMultilib = GCCInstallation.getMultilib();
   llvm::Triple::ArchType Arch = Triple.getArch();
-  std::string SysRoot = computeSysRoot();
+  std::string SysRoot = computeSysRoot() + "/";
   ToolChain::path_list &PPaths = getProgramPaths();
 
   Generic_GCC::PushPPaths(PPaths);
-- 
2.27.0