From 446d28d6e1ff196eec3a1b25eb70c6ea51701a68 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 9 Nov 2018 22:53:49 -0800 Subject: [PATCH] rust: Use llvm-rust-native and env variables to configure llvm-config Signed-off-by: Khem Raj --- recipes-devtools/rust/rust.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index d4981a9..b97e7e9 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -7,12 +7,16 @@ inherit rust inherit cargo_common DEPENDS += "file-native python-native" +DEPENDS_append_class-native = " rust-llvm-native" # We generate local targets, and need to be able to locate them export RUST_TARGET_PATH="${WORKDIR}/targets/" export FORCE_CRATE_HASH="${BB_TASKHASH}" +export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" +export YOCTO_ALTERNATE_MULTILIB_NAME = "/${BASELIB}" + # We can't use RUST_BUILD_SYS here because that may be "musl" if # TCLIBC="musl". Snapshots are always -unknown-linux-gnu SNAPSHOT_BUILD_SYS = "${BUILD_ARCH}-unknown-linux-gnu" @@ -345,7 +349,7 @@ python do_configure() { target_section = "target.{}".format(d.getVar('TARGET_SYS', True)) config.add_section(target_section) - llvm_config = d.expand("${STAGING_DIR_NATIVE}${libdir_native}/llvm-rust/bin/llvm-config") + llvm_config = d.expand("${YOCTO_ALTERNATE_EXE_PATH}") config.set(target_section, "llvm-config", e(llvm_config)) config.set(target_section, "cxx", e(d.expand("${RUST_TARGET_CXX}")))