diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-07-27 10:40:11 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-31 15:13:32 +0100 |
commit | 5c77067ee9c18e056515a5e83e7282b0035dfb49 (patch) | |
tree | 50508739f29e81b23586480eab22bda43f0e936a /meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch | |
parent | e7bb5ae841eabe86763f8e2fe5c92f4c7080420d (diff) | |
download | poky-5c77067ee9c18e056515a5e83e7282b0035dfb49.tar.gz |
llvm: Add recipe for 5.0
Based on recipe from meta-oe and clang recipe from meta-clang
Needed by mesa
Fixes
[YOCTO #11529]
(From OE-Core rev: 8724ef9c53e7804ead9ba0f019369b0e4daada63)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch')
-rw-r--r-- | meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch b/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch new file mode 100644 index 0000000000..832bd729ef --- /dev/null +++ b/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From d776487bac17650704614248d19d1e6b35775001 Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Kelly <mkelly@xevo.com> | ||
3 | Date: Fri, 19 May 2017 00:22:57 -0700 | ||
4 | Subject: [PATCH 2/2] llvm: allow env override of exe path | ||
5 | |||
6 | When using a native llvm-config from inside a sysroot, we need llvm-config to | ||
7 | return the libraries, include directories, etc. from inside the sysroot rather | ||
8 | than from the native sysroot. Thus provide an env override for calling | ||
9 | llvm-config from a target sysroot. | ||
10 | |||
11 | Signed-off-by: Martin Kelly <mkelly@xevo.com> | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | Upstream-Status: Pending | ||
15 | |||
16 | tools/llvm-config/llvm-config.cpp | 7 +++++++ | ||
17 | 1 file changed, 7 insertions(+) | ||
18 | |||
19 | diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp | ||
20 | index 08b096afb05..d8d7742744e 100644 | ||
21 | --- a/tools/llvm-config/llvm-config.cpp | ||
22 | +++ b/tools/llvm-config/llvm-config.cpp | ||
23 | @@ -225,6 +225,13 @@ Typical components:\n\ | ||
24 | |||
25 | /// \brief Compute the path to the main executable. | ||
26 | std::string GetExecutablePath(const char *Argv0) { | ||
27 | + // Hack for Yocto: we need to override the root path when we are using | ||
28 | + // llvm-config from within a target sysroot. | ||
29 | + const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); | ||
30 | + if (Sysroot != nullptr) { | ||
31 | + return Sysroot; | ||
32 | + } | ||
33 | + | ||
34 | // This just needs to be some symbol in the binary; C++ doesn't | ||
35 | // allow taking the address of ::main however. | ||
36 | void *P = (void *)(intptr_t)GetExecutablePath; | ||
37 | -- | ||
38 | 2.13.1 | ||
39 | |||