aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-core/llvm/files/0001-llvm-config-allow-overriding-libdir-through-cmdline.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-core/llvm/files/0001-llvm-config-allow-overriding-libdir-through-cmdline.patch')
-rw-r--r--common/recipes-core/llvm/files/0001-llvm-config-allow-overriding-libdir-through-cmdline.patch101
1 files changed, 0 insertions, 101 deletions
diff --git a/common/recipes-core/llvm/files/0001-llvm-config-allow-overriding-libdir-through-cmdline.patch b/common/recipes-core/llvm/files/0001-llvm-config-allow-overriding-libdir-through-cmdline.patch
deleted file mode 100644
index 26bf42e5..00000000
--- a/common/recipes-core/llvm/files/0001-llvm-config-allow-overriding-libdir-through-cmdline.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 87b01c9e5cecd30f9cde1f717e1ae7094e1f62c1 Mon Sep 17 00:00:00 2001
-From: Awais Belal <awais_belal@mentor.com>
-Date: Wed, 13 Dec 2017 14:15:24 +0500
-Subject: [PATCH] llvm-config: allow overriding libdir through cmdline
-
-This is handy in cases such as the OE environment
-where llvm-config is used through the llvm-native
-package so the libdir it reports can be different
-what is required for the target sysroot and so if
-the baselib is different for target and host the
-llvm-config --libs command will fail complaining
-about not finding required libraries. This scenario
-can be reproduced through an LLVM enabled mesa build
-where host and target have different baselib. So
-after the patch the mesa build should pass the whole
-target libdir to the llvm-config command to use.
-
-Signed-off-by: Awais Belal <awais_belal@mentor.com>
----
- tools/llvm-config/llvm-config.cpp | 32 ++++++++++++++++++++++++++++----
- 1 file changed, 28 insertions(+), 4 deletions(-)
-
-diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 08b096afb05..8233d16dda0 100644
---- a/tools/llvm-config/llvm-config.cpp
-+++ b/tools/llvm-config/llvm-config.cpp
-@@ -301,6 +301,18 @@ int main(int argc, char **argv) {
- DevelopmentTreeLayout = CMakeStyle; // Initialized to avoid warnings.
- }
-
-+ // Check if we were given a special libdir to use
-+ // if so disregard all other libdir settings
-+ std::string TargetLibDir;
-+ for (int i = 1; i != argc; ++i) {
-+ if (strcmp(argv[i],"--tgtlibdir") == 0) {
-+ if (argc > i+1) {
-+ TargetLibDir.assign(argv[i+1]);
-+ break;
-+ }
-+ }
-+ }
-+
- // Compute various directory locations based on the derived location
- // information.
- std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
-@@ -315,13 +327,19 @@ int main(int argc, char **argv) {
- switch (DevelopmentTreeLayout) {
- case CMakeStyle:
- ActiveBinDir = ActiveObjRoot + "/bin";
-- ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
-+ if (!TargetLibDir.empty())
-+ ActiveLibDir = TargetLibDir;
-+ else
-+ ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
- break;
- case CMakeBuildModeStyle:
- ActivePrefix = ActiveObjRoot;
- ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
-- ActiveLibDir =
-+ if (!TargetLibDir.empty())
-+ ActiveLibDir = TargetLibDir;
-+ else
-+ ActiveLibDir =
- ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
- break;
-@@ -336,7 +354,10 @@ 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;
-+ if (!TargetLibDir.empty())
-+ ActiveLibDir = TargetLibDir;
-+ else
-+ ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
- ActiveIncludeOption = "-I" + ActiveIncludeDir;
- }
-@@ -468,7 +489,7 @@ int main(int argc, char **argv) {
- };
-
- raw_ostream &OS = outs();
-- for (int i = 1; i != argc; ++i) {
-+ for (int i = 1; i < argc; ++i) {
- StringRef Arg = argv[i];
-
- if (Arg.startswith("-")) {
-@@ -567,6 +588,9 @@ int main(int argc, char **argv) {
- LinkMode = LinkModeShared;
- } else if (Arg == "--link-static") {
- LinkMode = LinkModeStatic;
-+ } else if (Arg == "--tgtlibdir") {
-+ ++i;
-+ continue;
- } else {
- usage();
- }
---
-2.11.1
-