summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch
diff options
context:
space:
mode:
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.patch66
1 files changed, 54 insertions, 12 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
index 6a9283323c..2970b0827b 100644
--- 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
@@ -1,4 +1,4 @@
1From aeccf16eaccdd80e4d5ecaa51673ce4b2bac1130 Mon Sep 17 00:00:00 2001 1From 0570fe02c07244a8724c1e6c0437f893c8aa8e93 Mon Sep 17 00:00:00 2001
2From: Martin Kelly <mkelly@xevo.com> 2From: Martin Kelly <mkelly@xevo.com>
3Date: Fri, 19 May 2017 00:22:57 -0700 3Date: Fri, 19 May 2017 00:22:57 -0700
4Subject: [PATCH 2/2] llvm: allow env override of exe path 4Subject: [PATCH 2/2] llvm: allow env override of exe path
@@ -16,16 +16,16 @@ Upstream-Status: Inappropriate [OE-Specific]
16Signed-off-by: Martin Kelly <mkelly@xevo.com> 16Signed-off-by: Martin Kelly <mkelly@xevo.com>
17Signed-off-by: Khem Raj <raj.khem@gmail.com> 17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18--- 18---
19 tools/llvm-config/llvm-config.cpp | 17 ++++++++++++++++- 19 tools/llvm-config/llvm-config.cpp | 35 ++++++++++++++++++++++---------
20 1 file changed, 16 insertions(+), 1 deletion(-) 20 1 file changed, 25 insertions(+), 10 deletions(-)
21 21
22diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp 22diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
23index 08b096afb05..360cc5abf4e 100644 23index bec89fef98c..91b4d6e4c43 100644
24--- a/tools/llvm-config/llvm-config.cpp 24--- a/tools/llvm-config/llvm-config.cpp
25+++ b/tools/llvm-config/llvm-config.cpp 25+++ b/tools/llvm-config/llvm-config.cpp
26@@ -225,6 +225,13 @@ Typical components:\n\ 26@@ -226,6 +226,13 @@ Typical components:\n\
27 27
28 /// \brief Compute the path to the main executable. 28 /// Compute the path to the main executable.
29 std::string GetExecutablePath(const char *Argv0) { 29 std::string GetExecutablePath(const char *Argv0) {
30+ // Hack for Yocto: we need to override the root path when we are using 30+ // Hack for Yocto: we need to override the root path when we are using
31+ // llvm-config from within a target sysroot. 31+ // llvm-config from within a target sysroot.
@@ -37,7 +37,25 @@ index 08b096afb05..360cc5abf4e 100644
37 // This just needs to be some symbol in the binary; C++ doesn't 37 // This just needs to be some symbol in the binary; C++ doesn't
38 // allow taking the address of ::main however. 38 // allow taking the address of ::main however.
39 void *P = (void *)(intptr_t)GetExecutablePath; 39 void *P = (void *)(intptr_t)GetExecutablePath;
40@@ -306,12 +313,20 @@ int main(int argc, char **argv) { 40@@ -284,7 +291,7 @@ int main(int argc, char **argv) {
41 // bin dir).
42 sys::fs::make_absolute(CurrentPath);
43 CurrentExecPrefix =
44- sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();
45+ sys::path::parent_path(sys::path::parent_path(sys::path::parent_path(CurrentPath))).str();
46
47 // Check to see if we are inside a development tree by comparing to possible
48 // locations (prefix style or CMake style).
49@@ -293,7 +300,7 @@ int main(int argc, char **argv) {
50 DevelopmentTreeLayout = CMakeStyle;
51 ActiveObjRoot = LLVM_OBJ_ROOT;
52 } else if (sys::fs::equivalent(CurrentExecPrefix,
53- Twine(LLVM_OBJ_ROOT) + "/bin")) {
54+ Twine(LLVM_OBJ_ROOT) + "/bin/llvm8.0")) {
55 IsInDevelopmentTree = true;
56 DevelopmentTreeLayout = CMakeBuildModeStyle;
57 ActiveObjRoot = LLVM_OBJ_ROOT;
58@@ -307,37 +314,45 @@ int main(int argc, char **argv) {
41 std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir, 59 std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
42 ActiveCMakeDir; 60 ActiveCMakeDir;
43 std::string ActiveIncludeOption; 61 std::string ActiveIncludeOption;
@@ -45,11 +63,12 @@ index 08b096afb05..360cc5abf4e 100644
45+ // llvm-config from within a target sysroot. 63+ // llvm-config from within a target sysroot.
46+ std::string Multilibdir = std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME"); 64+ std::string Multilibdir = std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");
47+ if (Multilibdir.empty()) { 65+ if (Multilibdir.empty()) {
48+ Multilibdir = "/lib" LLVM_LIBDIR_SUFFIX; 66+ Multilibdir = "/lib/llvm8.0" LLVM_LIBDIR_SUFFIX;
49+ } 67+ }
50+ 68+
51 if (IsInDevelopmentTree) { 69 if (IsInDevelopmentTree) {
52 ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include"; 70- ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
71+ ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include/llvm8.0";
53 ActivePrefix = CurrentExecPrefix; 72 ActivePrefix = CurrentExecPrefix;
54 73
55 // CMake organizes the products differently than a normal prefix style 74 // CMake organizes the products differently than a normal prefix style
@@ -57,8 +76,31 @@ index 08b096afb05..360cc5abf4e 100644
57+ 76+
58 switch (DevelopmentTreeLayout) { 77 switch (DevelopmentTreeLayout) {
59 case CMakeStyle: 78 case CMakeStyle:
60 ActiveBinDir = ActiveObjRoot + "/bin"; 79- ActiveBinDir = ActiveObjRoot + "/bin";
61@@ -336,7 +351,7 @@ int main(int argc, char **argv) { 80- ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
81+ ActiveBinDir = ActiveObjRoot + "/bin/llvm8.0";
82+ ActiveLibDir = ActiveObjRoot + "/lib/llvm8.0" + LLVM_LIBDIR_SUFFIX;
83 ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
84 break;
85 case CMakeBuildModeStyle:
86 ActivePrefix = ActiveObjRoot;
87- ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
88+ ActiveBinDir = ActiveObjRoot + "/bin/llvm8.0/" + build_mode;
89 ActiveLibDir =
90- ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
91+ ActiveObjRoot + "/lib/llvm8.0" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
92 ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
93 break;
94 }
95
96 // We need to include files from both the source and object trees.
97 ActiveIncludeOption =
98- ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
99+ ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include/llvm8.0");
100 } else {
101 ActivePrefix = CurrentExecPrefix;
102- ActiveIncludeDir = ActivePrefix + "/include";
103+ ActiveIncludeDir = ActivePrefix + "/include/llvm8.0";
62 SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); 104 SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
63 sys::fs::make_absolute(ActivePrefix, path); 105 sys::fs::make_absolute(ActivePrefix, path);
64 ActiveBinDir = path.str(); 106 ActiveBinDir = path.str();
@@ -68,5 +110,5 @@ index 08b096afb05..360cc5abf4e 100644
68 ActiveIncludeOption = "-I" + ActiveIncludeDir; 110 ActiveIncludeOption = "-I" + ActiveIncludeDir;
69 } 111 }
70-- 112--
712.18.0 1132.20.1
72 114