summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch')
-rw-r--r--recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
new file mode 100644
index 0000000..d43e705
--- /dev/null
+++ b/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
@@ -0,0 +1,40 @@
1From c9802082e3c3014e68040efdc7520a4cee1a38f6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 16 Mar 2017 19:06:26 -0700
4Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime
5
6In OE compiler-rt and libc++ are built and staged into target
7sysroot and not into resourcedir which is relative to clang
8driver installation where the libraries are not instlled
9
10Specific to cross compiling the way yocto/OE works
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 clang/lib/Driver/ToolChain.cpp | 6 +++++-
15 1 file changed, 5 insertions(+), 1 deletion(-)
16
17diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
18index cab97b1a601..059a5e62c40 100644
19--- a/clang/lib/Driver/ToolChain.cpp
20+++ b/clang/lib/Driver/ToolChain.cpp
21@@ -14,6 +14,7 @@
22 #include "ToolChains/Flang.h"
23 #include "clang/Basic/ObjCRuntime.h"
24 #include "clang/Basic/Sanitizers.h"
25+#include "clang/Basic/Version.h"
26 #include "clang/Config/config.h"
27 #include "clang/Driver/Action.h"
28 #include "clang/Driver/Driver.h"
29@@ -379,7 +380,10 @@ StringRef ToolChain::getOSLibName() const {
30 }
31
32 std::string ToolChain::getCompilerRTPath() const {
33- SmallString<128> Path(getDriver().ResourceDir);
34+ SmallString<128> Path(getDriver().SysRoot);
35+ StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX);
36+ llvm::sys::path::append(Path, "/usr/", Twine("lib") + ClangLibdirSuffix, "clang",
37+ CLANG_VERSION_STRING);
38 if (Triple.isOSUnknown()) {
39 llvm::sys::path::append(Path, "lib");
40 } else {