diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-03-16 20:17:44 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2017-03-16 20:17:44 -0700 |
commit | 3c7d61adb41a5de270ea3817353e395ced5ac893 (patch) | |
tree | 2ee55e205ef5779db585fde70251c7bef9360684 | |
parent | a1c9ef3c831a473777985beb8d33d44d9350a858 (diff) | |
download | meta-clang-3c7d61adb41a5de270ea3817353e395ced5ac893.tar.gz |
clang: Fix cross compiler search path for compiler-rt
It was looking into compiler install area but for OE
cross compiling scenario the compiler runtime is installed
into target sysroot, Fix clang to look into sysroot
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch | 41 | ||||
-rw-r--r-- | recipes-devtools/clang/clang_git.bb | 1 |
2 files changed, 42 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch new file mode 100644 index 0000000..a887588 --- /dev/null +++ b/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 63b01a5bf84c836a42b792cdee5ac6322296ae0b Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 16 Mar 2017 17:06:45 -0700 | ||
4 | Subject: [PATCH 5/5] clang: Look inside the target sysroot for compiler | ||
5 | runtime | ||
6 | |||
7 | In OE compiler-rt and libc++ are built and staged into target | ||
8 | sysroot and not into resourcedir which is relative to clang | ||
9 | driver installation where the libraries are not instlled | ||
10 | |||
11 | Specific to cross compiling the way yocto/OE works | ||
12 | |||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | lib/Driver/ToolChain.cpp | 4 +++- | ||
16 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
17 | |||
18 | Index: clang/lib/Driver/ToolChain.cpp | ||
19 | =================================================================== | ||
20 | --- clang.orig/lib/Driver/ToolChain.cpp | ||
21 | +++ clang/lib/Driver/ToolChain.cpp | ||
22 | @@ -10,6 +10,7 @@ | ||
23 | #include "clang/Driver/ToolChain.h" | ||
24 | #include "Tools.h" | ||
25 | #include "clang/Basic/ObjCRuntime.h" | ||
26 | +#include "clang/Basic/Version.h" | ||
27 | #include "clang/Config/config.h" | ||
28 | #include "clang/Driver/Action.h" | ||
29 | #include "clang/Driver/Driver.h" | ||
30 | @@ -306,7 +307,10 @@ std::string ToolChain::getCompilerRT(con | ||
31 | const char *Suffix = Shared ? (Triple.isOSWindows() ? ".dll" : ".so") | ||
32 | : (IsITANMSVCWindows ? ".lib" : ".a"); | ||
33 | |||
34 | - SmallString<128> Path(getDriver().ResourceDir); | ||
35 | + SmallString<128> Path(getDriver().SysRoot); | ||
36 | + StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX); | ||
37 | + llvm::sys::path::append(Path, "/usr/", Twine("lib") + ClangLibdirSuffix, "clang", | ||
38 | + CLANG_VERSION_STRING); | ||
39 | StringRef OSLibName = Triple.isOSFreeBSD() ? "freebsd" : getOS(); | ||
40 | llvm::sys::path::append(Path, "lib", OSLibName); | ||
41 | llvm::sys::path::append(Path, Prefix + Twine("clang_rt.") + Component + "-" + | ||
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 29e2e8f..798b9c7 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb | |||
@@ -30,6 +30,7 @@ SRC_URI += "\ | |||
30 | file://0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch;patchdir=tools/clang \ | 30 | file://0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch;patchdir=tools/clang \ |
31 | file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \ | 31 | file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \ |
32 | file://0004-clang-Prepend-trailing-to-sysroot.patch;patchdir=tools/clang \ | 32 | file://0004-clang-Prepend-trailing-to-sysroot.patch;patchdir=tools/clang \ |
33 | file://0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch;patchdir=tools/clang \ | ||
33 | " | 34 | " |
34 | 35 | ||
35 | SRCREV_FORMAT = "llvm_clang" | 36 | SRCREV_FORMAT = "llvm_clang" |