poky/meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch
Randy MacLeod 61e1570c6a rust: initial merge of most of meta-rust
In the meta-rust repo at commit:
   448047c Upgrade to 1.54.0 (#359)

Make the required directories:
  mkdir ../oe-core/meta/recipes-devtools/rust
  mkdir ../oe-core/meta/recipes-devtools/cargo
  mkdir ../oe-core/meta/recipes-example
and then:
  cp recipes-devtools/rust/* ../oe-core/meta/recipes-devtools/rust
  cp recipes-devtools/cargo/* ../oe-core/meta/recipes-devtools/cargo
  cp lib/crate.py ../oe-core/meta/lib
  cp recipes-example/* ../oe-core/meta/recipes-example
  cp conf/distro/include/rust_* ../oe-core/meta/conf/distro/include/
  cp classes/* ../oe-core/meta/classes/
  cp recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb ../oe-core/meta/recipes-core/packagegroups

(From OE-Core rev: 3ed57578cca93ff1ba4e0bf3f25566e10659a2f9)

Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-26 22:09:43 +01:00

33 lines
1.3 KiB
Diff

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 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.
Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++
1 file changed, 7 insertions(+)
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -226,6 +226,13 @@ Typical components:\n\
/// 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.
+ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH");
+ if (Sysroot != nullptr) {
+ return Sysroot;
+ }
+
// 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;