summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch')
-rw-r--r--recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch
new file mode 100644
index 0000000..d19d165
--- /dev/null
+++ b/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch
@@ -0,0 +1,32 @@
1From 0a80036efcec431252a1e8a521e7aab3df11c8fc Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 11 Aug 2021 18:37:11 -0700
4Subject: [PATCH] clang: Do not use install relative libc++ headers
5
6In OE we use same clang for native and cross builds, therefore we need
7to ensure that native sysroot install of libc++ is not searched for
8headers when doing cross compile instead it searches the target sysroot
9this is especially troublesome when libcxx-native is staged along with
10libcxx e.g. chromium
11
12Upstream-Status: Pending
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++-
16 1 file changed, 3 insertions(+), 1 deletion(-)
17
18diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
19index 0db37c6ef1a8..80a21d58c86c 100644
20--- a/clang/lib/Driver/ToolChains/Gnu.cpp
21+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
22@@ -3093,7 +3093,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
23
24 // Android never uses the libc++ headers installed alongside the toolchain,
25 // which are generally incompatible with the NDK libraries anyway.
26- if (!getTriple().isAndroid())
27+ // And also do not add it when --sysroot is specified, since it would expect
28+ // libc++ headers from sysroot
29+ if (!getTriple().isAndroid() && SysRoot.empty())
30 if (AddIncludePath(getDriver().Dir + "/../include"))
31 return;
32 // If this is a development, non-installed, clang, libcxx will