rust-llvm: Update the sysroot patch to latest from meta-clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -1,31 +1,24 @@
|
||||
From aeccf16eaccdd80e4d5ecaa51673ce4b2bac1130 Mon Sep 17 00:00:00 2001
|
||||
From 7111770e8290082530d920e120995bf81431b0aa Mon Sep 17 00:00:00 2001
|
||||
From: Martin Kelly <mkelly@xevo.com>
|
||||
Date: Fri, 19 May 2017 00:22:57 -0700
|
||||
Subject: [PATCH 2/2] llvm: allow env override of exe path
|
||||
Subject: [PATCH 12/18] 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 <mkelly@xevo.com>
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
tools/llvm-config/llvm-config.cpp | 17 ++++++++++++++++-
|
||||
1 file changed, 16 insertions(+), 1 deletion(-)
|
||||
tools/llvm-config/llvm-config.cpp | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
Index: llvm/tools/llvm-config/llvm-config.cpp
|
||||
===================================================================
|
||||
--- llvm.orig/tools/llvm-config/llvm-config.cpp
|
||||
+++ llvm/tools/llvm-config/llvm-config.cpp
|
||||
@@ -225,6 +225,13 @@ Typical components:\n\
|
||||
--- a/tools/llvm-config/llvm-config.cpp
|
||||
+++ b/tools/llvm-config/llvm-config.cpp
|
||||
@@ -226,6 +226,13 @@ Typical components:\n\
|
||||
|
||||
/// \brief Compute the path to the main executable.
|
||||
/// Compute the path to the main executable.
|
||||
std::string GetExecutablePath(const char *Argv0) {
|
||||
+ // Hack for Yocto: we need to override the root path when we are using
|
||||
+ // llvm-config from within a target sysroot.
|
||||
@@ -37,34 +30,3 @@ Index: llvm/tools/llvm-config/llvm-config.cpp
|
||||
// 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;
|
||||
@@ -306,12 +313,21 @@ 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;
|
||||
+ if (std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME") != nullptr)
|
||||
+ Multilibdir = std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");
|
||||
+ else
|
||||
+ Multilibdir = "/lib" LLVM_LIBDIR_SUFFIX;
|
||||
+
|
||||
if (IsInDevelopmentTree) {
|
||||
ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
|
||||
ActivePrefix = CurrentExecPrefix;
|
||||
|
||||
// CMake organizes the products differently than a normal prefix style
|
||||
// layout.
|
||||
+
|
||||
switch (DevelopmentTreeLayout) {
|
||||
case CMakeStyle:
|
||||
ActiveBinDir = ActiveObjRoot + "/bin";
|
||||
@@ -336,7 +352,7 @@ int main(int argc, char **argv) {
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user