Skip to contentSkip to conversation

llvm: fix llvm-config to work again with multilib

PATCH Superseded Yann Dirson 2 participants 5 messages Oct 6, 2020 – Oct 8, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 llvm: fix llvm-config to work again with multilib

From: Yann Dirson <[email protected]>

Newer llvm versions have changed the logic for finding libraries, which prevents Mesa from building with PACKAGECONFIG[gallium-llvm]:

See https://bugzilla.yoctoproject.org/show_bug.cgi?id=13937

This patch comes from meta-amd, which exhibits one such situation.

---
 ...-llvm-allow-env-override-of-exe-path.patch | 96 +++++++++++++++++--
 1 file changed, 87 insertions(+), 9 deletions(-)

Note that I took the updated patch from meta-amd without a change, and I'm dubious about the [OE-Specific] tag in patch metadata.

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +87 -9
index b01b8647c9..417eaf0aa1 100644
@@ -1,27 +1,30 @@
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
-
-From 61b00e1e051e367f5483d7b5253b6c85a9e8a90f Mon Sep 17 00:00:00 2001
+From 0570fe02c07244a8724c1e6c0437f893c8aa8e93 Mon Sep 17 00:00:00 2001
 From: Martin Kelly <[email protected]>
 Date: Fri, 19 May 2017 00:22:57 -0700
-Subject: [PATCH] llvm: allow env override of exe path
+Subject: [PATCH 2/2] llvm: allow env override of exe path
 
 When using a native llvm-config from inside a sysroot, we need llvm-config to
 return the libraries, include directories, etc. from inside the sysroot rather
 than from the native sysroot. Thus provide an env override for calling
 llvm-config from a target sysroot.
 
+To let it work in multilib environment, we need to provide a knob to supply
+multilib dirname as well
+
+Upstream-Status: Inappropriate [OE-Specific]
+
 Signed-off-by: Martin Kelly <[email protected]>
 Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Arsalan H. Awan <[email protected]>
 ---
- llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++
- 1 file changed, 7 insertions(+)
+ llvm/tools/llvm-config/llvm-config.cpp | 35 ++++++++++++++++++++++---------
+ 1 file changed, 25 insertions(+), 10 deletions(-)
 
 diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
-index 7ef7c46a262..a4f7ed82c7b 100644
+index bec89fef98c..91b4d6e4c43 100644
 --- a/llvm/tools/llvm-config/llvm-config.cpp
 +++ b/llvm/tools/llvm-config/llvm-config.cpp
-@@ -225,6 +225,13 @@ Typical components:\n\
+@@ -226,6 +226,13 @@ Typical components:\n\
  
  /// Compute the path to the main executable.
  std::string GetExecutablePath(const char *Argv0) {
@@ -35,3 +38,78 @@ index 7ef7c46a262..a4f7ed82c7b 100644
    // This just needs to be some symbol in the binary; C++ doesn't
    // allow taking the address of ::main however.
    void *P = (void *)(intptr_t)GetExecutablePath;
+@@ -284,7 +291,7 @@ int main(int argc, char **argv) {
+   // bin dir).
+   sys::fs::make_absolute(CurrentPath);
+   CurrentExecPrefix =
+-      sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();
++      sys::path::parent_path(sys::path::parent_path(sys::path::parent_path(CurrentPath))).str();
+ 
+   // Check to see if we are inside a development tree by comparing to possible
+   // locations (prefix style or CMake style).
+@@ -293,7 +300,7 @@ int main(int argc, char **argv) {
+     DevelopmentTreeLayout = CMakeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+   } else if (sys::fs::equivalent(CurrentExecPrefix,
+-                                 Twine(LLVM_OBJ_ROOT) + "/bin")) {
++                                 Twine(LLVM_OBJ_ROOT) + "/bin/llvm9.0.1")) {
+     IsInDevelopmentTree = true;
+     DevelopmentTreeLayout = CMakeBuildModeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+@@ -307,37 +314,45 @@ int main(int argc, char **argv) {
+   std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
+               ActiveCMakeDir;
+   std::string ActiveIncludeOption;
++  // Hack for Yocto: we need to override the multilib path when we are using
++  // llvm-config from within a target sysroot.
++  std::string Multilibdir = std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");
++  if (Multilibdir.empty()) {
++    Multilibdir = "/lib/llvm9.0.1" LLVM_LIBDIR_SUFFIX;
++  }
++
+   if (IsInDevelopmentTree) {
+-    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
++    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include/llvm9.0.1";
+     ActivePrefix = CurrentExecPrefix;
+ 
+     // CMake organizes the products differently than a normal prefix style
+     // layout.
++
+     switch (DevelopmentTreeLayout) {
+     case CMakeStyle:
+-      ActiveBinDir = ActiveObjRoot + "/bin";
+-      ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1";
++      ActiveLibDir = ActiveObjRoot + "/lib/llvm9.0.1" + LLVM_LIBDIR_SUFFIX;
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     case CMakeBuildModeStyle:
+       ActivePrefix = ActiveObjRoot;
+-      ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1/" + build_mode;
+       ActiveLibDir =
+-          ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
++          ActiveObjRoot + "/lib/llvm9.0.1" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     }
+ 
+     // We need to include files from both the source and object trees.
+     ActiveIncludeOption =
+-        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
++        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include/llvm9.0.1");
+   } else {
+     ActivePrefix = CurrentExecPrefix;
+-    ActiveIncludeDir = ActivePrefix + "/include";
++    ActiveIncludeDir = ActivePrefix + "/include/llvm9.0.1";
+     SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+     sys::fs::make_absolute(ActivePrefix, path);
+     ActiveBinDir = path.str();
+-    ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
++    ActiveLibDir = ActivePrefix + Multilibdir;
+     ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+     ActiveIncludeOption = "-I" + ActiveIncludeDir;
+   }
+-- 
+2.20.1
+
Signature · 1 line
2.28.0
#1 lore raw

in master we have llvm 10 but the patch seems to be accessing llvm9.0.1 dir, that seems incorrect to me.

Quoted 149 lines · Yann Dirson

From: Yann Dirson <[email protected]>

Newer llvm versions have changed the logic for finding libraries, which prevents Mesa from building with PACKAGECONFIG[gallium-llvm]:

See https://bugzilla.yoctoproject.org/show_bug.cgi?id=13937

This patch comes from meta-amd, which exhibits one such situation.

---
 ...-llvm-allow-env-override-of-exe-path.patch | 96 +++++++++++++++++--
 1 file changed, 87 insertions(+), 9 deletions(-)

Note that I took the updated patch from meta-amd without a change, and I'm dubious about the [OE-Specific] tag in patch metadata.

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +87 -10
index b01b8647c9..417eaf0aa1 100644
@@ -1,27 +1,30 @@
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
-
-From 61b00e1e051e367f5483d7b5253b6c85a9e8a90f Mon Sep 17 00:00:00 2001
+From 0570fe02c07244a8724c1e6c0437f893c8aa8e93 Mon Sep 17 00:00:00 2001
 From: Martin Kelly <[email protected]>
 Date: Fri, 19 May 2017 00:22:57 -0700
-Subject: [PATCH] llvm: allow env override of exe path
+Subject: [PATCH 2/2] llvm: allow env override of exe path
 
 When using a native llvm-config from inside a sysroot, we need llvm-config to
 return the libraries, include directories, etc. from inside the sysroot rather
 than from the native sysroot. Thus provide an env override for calling
 llvm-config from a target sysroot.
 
+To let it work in multilib environment, we need to provide a knob to supply
+multilib dirname as well
+
+Upstream-Status: Inappropriate [OE-Specific]
+
 Signed-off-by: Martin Kelly <[email protected]>
 Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Arsalan H. Awan <[email protected]>
 ---
- llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++
- 1 file changed, 7 insertions(+)
+ llvm/tools/llvm-config/llvm-config.cpp | 35 ++++++++++++++++++++++---------
+ 1 file changed, 25 insertions(+), 10 deletions(-)
 
 diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
-index 7ef7c46a262..a4f7ed82c7b 100644
+index bec89fef98c..91b4d6e4c43 100644
 --- a/llvm/tools/llvm-config/llvm-config.cpp
 +++ b/llvm/tools/llvm-config/llvm-config.cpp
-@@ -225,6 +225,13 @@ Typical components:\n\
+@@ -226,6 +226,13 @@ Typical components:\n\
 
  /// Compute the path to the main executable.
  std::string GetExecutablePath(const char *Argv0) {
@@ -35,3 +38,78 @@ index 7ef7c46a262..a4f7ed82c7b 100644
    // This just needs to be some symbol in the binary; C++ doesn't
    // allow taking the address of ::main however.
    void *P = (void *)(intptr_t)GetExecutablePath;
+@@ -284,7 +291,7 @@ int main(int argc, char **argv) {
+   // bin dir).
+   sys::fs::make_absolute(CurrentPath);
+   CurrentExecPrefix =
+-      sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();
++      sys::path::parent_path(sys::path::parent_path(sys::path::parent_path(CurrentPath))).str();
+
+   // Check to see if we are inside a development tree by comparing to possible
+   // locations (prefix style or CMake style).
+@@ -293,7 +300,7 @@ int main(int argc, char **argv) {
+     DevelopmentTreeLayout = CMakeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+   } else if (sys::fs::equivalent(CurrentExecPrefix,
+-                                 Twine(LLVM_OBJ_ROOT) + "/bin")) {
++                                 Twine(LLVM_OBJ_ROOT) + "/bin/llvm9.0.1")) {
+     IsInDevelopmentTree = true;
+     DevelopmentTreeLayout = CMakeBuildModeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+@@ -307,37 +314,45 @@ int main(int argc, char **argv) {
+   std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
+               ActiveCMakeDir;
+   std::string ActiveIncludeOption;
++  // Hack for Yocto: we need to override the multilib path when we are using
++  // llvm-config from within a target sysroot.
++  std::string Multilibdir = std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");
++  if (Multilibdir.empty()) {
++    Multilibdir = "/lib/llvm9.0.1" LLVM_LIBDIR_SUFFIX;
++  }
++
+   if (IsInDevelopmentTree) {
+-    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
++    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include/llvm9.0.1";
+     ActivePrefix = CurrentExecPrefix;
+
+     // CMake organizes the products differently than a normal prefix style
+     // layout.
++
+     switch (DevelopmentTreeLayout) {
+     case CMakeStyle:
+-      ActiveBinDir = ActiveObjRoot + "/bin";
+-      ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1";
++      ActiveLibDir = ActiveObjRoot + "/lib/llvm9.0.1" + LLVM_LIBDIR_SUFFIX;
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     case CMakeBuildModeStyle:
+       ActivePrefix = ActiveObjRoot;
+-      ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1/" + build_mode;
+       ActiveLibDir =
+-          ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
++          ActiveObjRoot + "/lib/llvm9.0.1" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     }
+
+     // We need to include files from both the source and object trees.
+     ActiveIncludeOption =
+-        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
++        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include/llvm9.0.1");
+   } else {
+     ActivePrefix = CurrentExecPrefix;
+-    ActiveIncludeDir = ActivePrefix + "/include";
++    ActiveIncludeDir = ActivePrefix + "/include/llvm9.0.1";
+     SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+     sys::fs::make_absolute(ActivePrefix, path);
+     ActiveBinDir = path.str();
+-    ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
++    ActiveLibDir = ActivePrefix + Multilibdir;
+     ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+     ActiveIncludeOption = "-I" + ActiveIncludeDir;
+   }
+--
+2.20.1
+
--

2.28.0

#2 lore raw

Oh right that one is targeting dunfell and I did not check, will reroll

Quoted 178 lines · Khem Raj

in master we have llvm 10 but the patch seems to be accessing llvm9.0.1 dir, that seems incorrect to me.

Quoted 16 lines · Yann Dirson

From: Yann Dirson <[email protected]>

Newer llvm versions have changed the logic for finding libraries, which prevents Mesa from building with PACKAGECONFIG[gallium-llvm]:

See https://bugzilla.yoctoproject.org/show_bug.cgi?id=13937

This patch comes from meta-amd, which exhibits one such situation.

---
 ...-llvm-allow-env-override-of-exe-path.patch | 96 +++++++++++++++++--
 1 file changed, 87 insertions(+), 9 deletions(-)
Quoted 5 lines

Note that I took the updated patch from meta-amd without a change, and I'm dubious about the [OE-Specific] tag in patch metadata.

diff --git

a/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch b/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 2 lines

index b01b8647c9..417eaf0aa1 100644
---

a/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 1 line

+++

b/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch line 6

Quoted 12 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +2 -5
@@ -1,27 +1,30 @@
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
-
-From 61b00e1e051e367f5483d7b5253b6c85a9e8a90f Mon Sep 17 00:00:00 2001
+From 0570fe02c07244a8724c1e6c0437f893c8aa8e93 Mon Sep 17 00:00:00 2001
 From: Martin Kelly <[email protected]>
 Date: Fri, 19 May 2017 00:22:57 -0700
-Subject: [PATCH] llvm: allow env override of exe path
+Subject: [PATCH 2/2] llvm: allow env override of exe path
 
 When using a native llvm-config from inside a sysroot, we need

llvm-config to

Review line 7

Quoted 1 line
(quoted diff) +0 -0
 return the libraries, include directories, etc. from inside the sysroot

rather

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 4 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +1 -0
 than from the native sysroot. Thus provide an env override for calling
 llvm-config from a target sysroot.
 
+To let it work in multilib environment, we need to provide a knob to

supply

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 11 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +6 -2
+multilib dirname as well
+
+Upstream-Status: Inappropriate [OE-Specific]
+
 Signed-off-by: Martin Kelly <[email protected]>
 Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Arsalan H. Awan <[email protected]>
 ---
- llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++
- 1 file changed, 7 insertions(+)
+ llvm/tools/llvm-config/llvm-config.cpp | 35

++++++++++++++++++++++---------

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 3 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +1 -0
+ 1 file changed, 25 insertions(+), 10 deletions(-)
 
 diff --git a/llvm/tools/llvm-config/llvm-config.cpp

b/llvm/tools/llvm-config/llvm-config.cpp

Quoted 10 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +2 -2
-index 7ef7c46a262..a4f7ed82c7b 100644
+index bec89fef98c..91b4d6e4c43 100644
 --- a/llvm/tools/llvm-config/llvm-config.cpp
 +++ b/llvm/tools/llvm-config/llvm-config.cpp
-@@ -225,6 +225,13 @@ Typical components:\n\
+@@ -226,6 +226,13 @@ Typical components:\n\
 
  /// Compute the path to the main executable.
  std::string GetExecutablePath(const char *Argv0) {

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644 · line 45

Quoted 8 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +5 -0
@@ -35,3 +38,78 @@ index 7ef7c46a262..a4f7ed82c7b 100644
    // This just needs to be some symbol in the binary; C++ doesn't
    // allow taking the address of ::main however.
    void *P = (void *)(intptr_t)GetExecutablePath;
+@@ -284,7 +291,7 @@ int main(int argc, char **argv) {
+   // bin dir).
+   sys::fs::make_absolute(CurrentPath);
+   CurrentExecPrefix =
+-

sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 46

Quoted 1 line
(quoted diff) +1 -0
++

sys::path::parent_path(sys::path::parent_path(sys::path::parent_path(CurrentPath))).str();

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 48

Quoted 2 lines
(quoted diff) +2 -0
+
+   // Check to see if we are inside a development tree by comparing to

possible

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 7 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +7 -0
+   // locations (prefix style or CMake style).
+@@ -293,7 +300,7 @@ int main(int argc, char **argv) {
+     DevelopmentTreeLayout = CMakeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+   } else if (sys::fs::equivalent(CurrentExecPrefix,
+-                                 Twine(LLVM_OBJ_ROOT) + "/bin")) {
++                                 Twine(LLVM_OBJ_ROOT) +

"/bin/llvm9.0.1")) {

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 5 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +5 -0
+     IsInDevelopmentTree = true;
+     DevelopmentTreeLayout = CMakeBuildModeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+@@ -307,37 +314,45 @@ int main(int argc, char **argv) {
+   std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir,

ActiveLibDir,

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 3 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +3 -0
+               ActiveCMakeDir;
+   std::string ActiveIncludeOption;
++  // Hack for Yocto: we need to override the multilib path when we are

using

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 65

Quoted 2 lines
(quoted diff) +2 -0
++  // llvm-config from within a target sysroot.
++  std::string Multilibdir =

std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 7 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +7 -0
++  if (Multilibdir.empty()) {
++    Multilibdir = "/lib/llvm9.0.1" LLVM_LIBDIR_SUFFIX;
++  }
++
+   if (IsInDevelopmentTree) {
+-    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
++    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) +

"/include/llvm9.0.1";

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 3 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +3 -0
+     ActivePrefix = CurrentExecPrefix;
+
+     // CMake organizes the products differently than a normal prefix

style

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 8 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +8 -0
+     // layout.
++
+     switch (DevelopmentTreeLayout) {
+     case CMakeStyle:
+-      ActiveBinDir = ActiveObjRoot + "/bin";
+-      ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1";
++      ActiveLibDir = ActiveObjRoot + "/lib/llvm9.0.1" +

LLVM_LIBDIR_SUFFIX;

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 8 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +8 -0
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     case CMakeBuildModeStyle:
+       ActivePrefix = ActiveObjRoot;
+-      ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1/" + build_mode;
+       ActiveLibDir =
+-          ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" +

build_mode;

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 92

Quoted 1 line
(quoted diff) +1 -0
++          ActiveObjRoot + "/lib/llvm9.0.1" + LLVM_LIBDIR_SUFFIX + "/"

+ build_mode;

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 7 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +7 -0
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     }
+
+     // We need to include files from both the source and object trees.
+     ActiveIncludeOption =
+-        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot +

"/include");

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 100

Quoted 1 line
(quoted diff) +1 -0
++        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot +

"/include/llvm9.0.1");

Quoted 21 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +15 -1
+   } else {
+     ActivePrefix = CurrentExecPrefix;
+-    ActiveIncludeDir = ActivePrefix + "/include";
++    ActiveIncludeDir = ActivePrefix + "/include/llvm9.0.1";
+     SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+     sys::fs::make_absolute(ActivePrefix, path);
+     ActiveBinDir = path.str();
+-    ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
++    ActiveLibDir = ActivePrefix + Multilibdir;
+     ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+     ActiveIncludeOption = "-I" + ActiveIncludeDir;
+   }
+--
+2.20.1
+
--

2.28.0

Signature · 2 lines
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech
#3 lore raw

does something like this not work fully ?

https://github.com/kraj/meta-clang/blob/master/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 165 lines · Yann Dirson

Oh right that one is targeting dunfell and I did not check, will reroll

Quoted 146 lines · Khem Raj

in master we have llvm 10 but the patch seems to be accessing llvm9.0.1 dir, that seems incorrect to me.

Quoted 141 lines · Yann Dirson

From: Yann Dirson <[email protected]>

Newer llvm versions have changed the logic for finding libraries, which prevents Mesa from building with PACKAGECONFIG[gallium-llvm]:

See https://bugzilla.yoctoproject.org/show_bug.cgi?id=13937

This patch comes from meta-amd, which exhibits one such situation.

---
 ...-llvm-allow-env-override-of-exe-path.patch | 96 +++++++++++++++++--
 1 file changed, 87 insertions(+), 9 deletions(-)

Note that I took the updated patch from meta-amd without a change, and I'm dubious about the [OE-Specific] tag in patch metadata.

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +85 -9
index b01b8647c9..417eaf0aa1 100644
@@ -1,27 +1,30 @@
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
-
-From 61b00e1e051e367f5483d7b5253b6c85a9e8a90f Mon Sep 17 00:00:00 2001
+From 0570fe02c07244a8724c1e6c0437f893c8aa8e93 Mon Sep 17 00:00:00 2001
 From: Martin Kelly <[email protected]>
 Date: Fri, 19 May 2017 00:22:57 -0700
-Subject: [PATCH] llvm: allow env override of exe path
+Subject: [PATCH 2/2] llvm: allow env override of exe path
 
 When using a native llvm-config from inside a sysroot, we need llvm-config to
 return the libraries, include directories, etc. from inside the sysroot rather
 than from the native sysroot. Thus provide an env override for calling
 llvm-config from a target sysroot.
 
+To let it work in multilib environment, we need to provide a knob to supply
+multilib dirname as well
+
+Upstream-Status: Inappropriate [OE-Specific]
+
 Signed-off-by: Martin Kelly <[email protected]>
 Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Arsalan H. Awan <[email protected]>
 ---
- llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++
- 1 file changed, 7 insertions(+)
+ llvm/tools/llvm-config/llvm-config.cpp | 35 ++++++++++++++++++++++---------
+ 1 file changed, 25 insertions(+), 10 deletions(-)
 
 diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
-index 7ef7c46a262..a4f7ed82c7b 100644
+index bec89fef98c..91b4d6e4c43 100644
 --- a/llvm/tools/llvm-config/llvm-config.cpp
 +++ b/llvm/tools/llvm-config/llvm-config.cpp
-@@ -225,6 +225,13 @@ Typical components:\n\
+@@ -226,6 +226,13 @@ Typical components:\n\
 
  /// Compute the path to the main executable.
  std::string GetExecutablePath(const char *Argv0) {
@@ -35,3 +38,78 @@ index 7ef7c46a262..a4f7ed82c7b 100644
    // This just needs to be some symbol in the binary; C++ doesn't
    // allow taking the address of ::main however.
    void *P = (void *)(intptr_t)GetExecutablePath;
+@@ -284,7 +291,7 @@ int main(int argc, char **argv) {
+   // bin dir).
+   sys::fs::make_absolute(CurrentPath);
+   CurrentExecPrefix =
+-      sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();
++      sys::path::parent_path(sys::path::parent_path(sys::path::parent_path(CurrentPath))).str();
+
+   // Check to see if we are inside a development tree by comparing to possible
+   // locations (prefix style or CMake style).
+@@ -293,7 +300,7 @@ int main(int argc, char **argv) {
+     DevelopmentTreeLayout = CMakeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+   } else if (sys::fs::equivalent(CurrentExecPrefix,
+-                                 Twine(LLVM_OBJ_ROOT) + "/bin")) {
++                                 Twine(LLVM_OBJ_ROOT) + "/bin/llvm9.0.1")) {
+     IsInDevelopmentTree = true;
+     DevelopmentTreeLayout = CMakeBuildModeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+@@ -307,37 +314,45 @@ int main(int argc, char **argv) {
+   std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
+               ActiveCMakeDir;
+   std::string ActiveIncludeOption;
++  // Hack for Yocto: we need to override the multilib path when we are using
++  // llvm-config from within a target sysroot.
++  std::string Multilibdir = std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");
++  if (Multilibdir.empty()) {
++    Multilibdir = "/lib/llvm9.0.1" LLVM_LIBDIR_SUFFIX;
++  }
++
+   if (IsInDevelopmentTree) {
+-    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
++    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include/llvm9.0.1";
+     ActivePrefix = CurrentExecPrefix;
+
+     // CMake organizes the products differently than a normal prefix style
+     // layout.
++
+     switch (DevelopmentTreeLayout) {
+     case CMakeStyle:
+-      ActiveBinDir = ActiveObjRoot + "/bin";
+-      ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1";
++      ActiveLibDir = ActiveObjRoot + "/lib/llvm9.0.1" + LLVM_LIBDIR_SUFFIX;
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     case CMakeBuildModeStyle:
+       ActivePrefix = ActiveObjRoot;
+-      ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1/" + build_mode;
+       ActiveLibDir =
+-          ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
++          ActiveObjRoot + "/lib/llvm9.0.1" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     }
+
+     // We need to include files from both the source and object trees.
+     ActiveIncludeOption =
+-        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
++        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include/llvm9.0.1");
+   } else {
+     ActivePrefix = CurrentExecPrefix;
+-    ActiveIncludeDir = ActivePrefix + "/include";
++    ActiveIncludeDir = ActivePrefix + "/include/llvm9.0.1";
+     SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+     sys::fs::make_absolute(ActivePrefix, path);
+     ActiveBinDir = path.str();
+-    ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
++    ActiveLibDir = ActivePrefix + Multilibdir;
+     ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+     ActiveIncludeOption = "-I" + ActiveIncludeDir;
+   }
+--
Quoted 8 lines
Quoted 8 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +2 -1
+2.20.1
+
--

2.28.0

--
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech

#4 lore raw

No, it doesn't. That's the one we have already in poky.

Just reproduced with this in local.conf:

PACKAGECONFIG_append_pn-mesa += " gallium-llvm"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"

meta-amd does not have a patch for mesa10, I'm updating this

Quoted 202 lines · Khem Raj

does something like this not work fully ?

https://github.com/kraj/meta-clang/blob/master/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 9 lines · Yann Dirson

Oh right that one is targeting dunfell and I did not check, will reroll

Quoted 5 lines · Khem Raj

in master we have llvm 10 but the patch seems to be accessing llvm9.0.1 dir, that seems incorrect to me.

On Tue, Oct 6, 2020 at 3:41 AM Yann Dirson <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines

From: Yann Dirson <[email protected]>

Newer llvm versions have changed the logic for finding libraries, which prevents Mesa from building with PACKAGECONFIG[gallium-llvm]:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

See https://bugzilla.yoctoproject.org/show_bug.cgi?id=13937

This patch comes from meta-amd, which exhibits one such situation.

---
 ...-llvm-allow-env-override-of-exe-path.patch | 96

+++++++++++++++++--

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
 1 file changed, 87 insertions(+), 9 deletions(-)

Note that I took the updated patch from meta-amd without a change, and I'm dubious about the [OE-Specific] tag in patch metadata.

diff --git

a/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch b/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

index b01b8647c9..417eaf0aa1 100644
---

a/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 1 line
Quoted 1 line
Quoted 1 line

+++

b/meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 5 lines
Quoted 5 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch line 4

Quoted 5 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +0 -4
@@ -1,27 +1,30 @@
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
-
-From 61b00e1e051e367f5483d7b5253b6c85a9e8a90f Mon Sep 17 00:00:00

2001

Quoted 1 line
Quoted 1 line

Review line 1

Quoted 1 line
(quoted diff) +1 -0
+From 0570fe02c07244a8724c1e6c0437f893c8aa8e93 Mon Sep 17 00:00:00

2001

Quoted 6 lines
Quoted 6 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 6 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +1 -1
 From: Martin Kelly <[email protected]>
 Date: Fri, 19 May 2017 00:22:57 -0700
-Subject: [PATCH] llvm: allow env override of exe path
+Subject: [PATCH 2/2] llvm: allow env override of exe path
 
 When using a native llvm-config from inside a sysroot, we need

llvm-config to

Quoted 1 line
Quoted 1 line

Review line 7

Quoted 1 line
(quoted diff) +0 -0
 return the libraries, include directories, etc. from inside the

sysroot rather

Quoted 1 line
Quoted 1 line

Review line 8

Quoted 1 line
(quoted diff) +0 -0
 than from the native sysroot. Thus provide an env override for

calling

Quoted 3 lines
Quoted 3 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 3 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +1 -0
 llvm-config from a target sysroot.
 
+To let it work in multilib environment, we need to provide a knob to

supply

Quoted 11 lines
Quoted 11 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 11 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +6 -2
+multilib dirname as well
+
+Upstream-Status: Inappropriate [OE-Specific]
+
 Signed-off-by: Martin Kelly <[email protected]>
 Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Arsalan H. Awan <[email protected]>
 ---
- llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++
- 1 file changed, 7 insertions(+)
+ llvm/tools/llvm-config/llvm-config.cpp | 35

++++++++++++++++++++++---------

Quoted 3 lines
Quoted 3 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch

Quoted 3 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +1 -0
+ 1 file changed, 25 insertions(+), 10 deletions(-)
 
 diff --git a/llvm/tools/llvm-config/llvm-config.cpp

b/llvm/tools/llvm-config/llvm-config.cpp

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +2 -2
-index 7ef7c46a262..a4f7ed82c7b 100644
+index bec89fef98c..91b4d6e4c43 100644
 --- a/llvm/tools/llvm-config/llvm-config.cpp
 +++ b/llvm/tools/llvm-config/llvm-config.cpp
-@@ -225,6 +225,13 @@ Typical components:\n\
+@@ -226,6 +226,13 @@ Typical components:\n\
 
Quoted 11 lines
Quoted 11 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644 · line 45

Quoted 11 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +5 -0
  /// Compute the path to the main executable.
  std::string GetExecutablePath(const char *Argv0) {
@@ -35,3 +38,78 @@ index 7ef7c46a262..a4f7ed82c7b 100644
    // This just needs to be some symbol in the binary; C++ doesn't
    // allow taking the address of ::main however.
    void *P = (void *)(intptr_t)GetExecutablePath;
+@@ -284,7 +291,7 @@ int main(int argc, char **argv) {
+   // bin dir).
+   sys::fs::make_absolute(CurrentPath);
+   CurrentExecPrefix =
+-

sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();

Quoted 1 line
Quoted 1 line

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 46

Quoted 1 line
(quoted diff) +1 -0
++

sys::path::parent_path(sys::path::parent_path(sys::path::parent_path(CurrentPath))).str();

Quoted 2 lines
Quoted 2 lines

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 48

Quoted 2 lines
(quoted diff) +2 -0
+
+   // Check to see if we are inside a development tree by comparing

to possible

Quoted 7 lines
Quoted 7 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 7 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +7 -0
+   // locations (prefix style or CMake style).
+@@ -293,7 +300,7 @@ int main(int argc, char **argv) {
+     DevelopmentTreeLayout = CMakeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+   } else if (sys::fs::equivalent(CurrentExecPrefix,
+-                                 Twine(LLVM_OBJ_ROOT) + "/bin")) {
++                                 Twine(LLVM_OBJ_ROOT) +

"/bin/llvm9.0.1")) {

Quoted 5 lines
Quoted 5 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 5 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +5 -0
+     IsInDevelopmentTree = true;
+     DevelopmentTreeLayout = CMakeBuildModeStyle;
+     ActiveObjRoot = LLVM_OBJ_ROOT;
+@@ -307,37 +314,45 @@ int main(int argc, char **argv) {
+   std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir,

ActiveLibDir,

Quoted 3 lines
Quoted 3 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 3 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +3 -0
+               ActiveCMakeDir;
+   std::string ActiveIncludeOption;
++  // Hack for Yocto: we need to override the multilib path when we

are using

Quoted 2 lines
Quoted 2 lines

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 65

Quoted 2 lines
(quoted diff) +2 -0
++  // llvm-config from within a target sysroot.
++  std::string Multilibdir =

std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");

Quoted 7 lines
Quoted 7 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 7 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +7 -0
++  if (Multilibdir.empty()) {
++    Multilibdir = "/lib/llvm9.0.1" LLVM_LIBDIR_SUFFIX;
++  }
++
+   if (IsInDevelopmentTree) {
+-    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
++    ActiveIncludeDir = std::string(LLVM_SRC_ROOT) +

"/include/llvm9.0.1";

Quoted 3 lines
Quoted 3 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 3 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +3 -0
+     ActivePrefix = CurrentExecPrefix;
+
+     // CMake organizes the products differently than a normal

prefix style

Quoted 8 lines
Quoted 8 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 8 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +8 -0
+     // layout.
++
+     switch (DevelopmentTreeLayout) {
+     case CMakeStyle:
+-      ActiveBinDir = ActiveObjRoot + "/bin";
+-      ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1";
++      ActiveLibDir = ActiveObjRoot + "/lib/llvm9.0.1" +

LLVM_LIBDIR_SUFFIX;

Quoted 8 lines
Quoted 8 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 8 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +8 -0
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     case CMakeBuildModeStyle:
+       ActivePrefix = ActiveObjRoot;
+-      ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
++      ActiveBinDir = ActiveObjRoot + "/bin/llvm9.0.1/" + build_mode;
+       ActiveLibDir =
+-          ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" +

build_mode;

Quoted 1 line
Quoted 1 line

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 92

Quoted 1 line
(quoted diff) +1 -0
++          ActiveObjRoot + "/lib/llvm9.0.1" + LLVM_LIBDIR_SUFFIX +

"/" + build_mode;

Quoted 5 lines
Quoted 5 lines

meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch index 7ef7c46a262..a4f7ed82c7b 100644

Quoted 5 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +5 -0
+       ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+       break;
+     }
+
+     // We need to include files from both the source and object

trees.

Quoted 2 lines
Quoted 2 lines

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 99

Quoted 2 lines
(quoted diff) +2 -0
+     ActiveIncludeOption =
+-        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot +

"/include");

Quoted 1 line
Quoted 1 line

Review index 7ef7c46a262..a4f7ed82c7b 100644 · line 100

Quoted 1 line
(quoted diff) +1 -0
++        ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot +

"/include/llvm9.0.1");

Quoted 28 lines
Quoted 13 lines
Quoted 13 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +13 -0
+   } else {
+     ActivePrefix = CurrentExecPrefix;
+-    ActiveIncludeDir = ActivePrefix + "/include";
++    ActiveIncludeDir = ActivePrefix + "/include/llvm9.0.1";
+     SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+     sys::fs::make_absolute(ActivePrefix, path);
+     ActiveBinDir = path.str();
+-    ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
++    ActiveLibDir = ActivePrefix + Multilibdir;
+     ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+     ActiveIncludeOption = "-I" + ActiveIncludeDir;
+   }
+--
Quoted 8 lines
Quoted 8 lines
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch +2 -1
+2.20.1
+
--

2.28.0

--
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech

Signature · 2 lines
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech