From bfb747de9694c288f48d74795deb0aca2405e89c Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Fri, 8 Jan 2016 16:16:26 -0500 Subject: [PATCH] rustlib: libdir may be different between build and host With multilib, we may want to install under lib64 but the rust libraries get published in the build sysroot under the libdir for the build machine which is usually just lib. Support these being different. --- classes/rust-bin.bbclass | 6 +++++- recipes-devtools/rust/rustlib.bb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/rust-bin.bbclass b/classes/rust-bin.bbclass index a9195bf..743fae8 100644 --- a/classes/rust-bin.bbclass +++ b/classes/rust-bin.bbclass @@ -34,7 +34,11 @@ OVERLAP_DEPS = "${@get_overlap_deps(d)}" # See https://github.com/rust-lang/rust/issues/19680 RUSTC_FLAGS += "-C prefer-dynamic" -rustlib="${libdir}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" +rustlib_suffix="${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" +# Native sysroot standard library path +rustlib_src="${prefix}/lib/${rustlib_suffix}" +# Host sysroot standard library path +rustlib="${libdir}/${rustlib_suffix}" CRATE_NAME ?= "${@d.getVar('BPN', True).replace('-rs', '').replace('-', '_')}" BINNAME ?= "${BPN}" LIBNAME ?= "lib${CRATE_NAME}" diff --git a/recipes-devtools/rust/rustlib.bb b/recipes-devtools/rust/rustlib.bb index ae05dfd..9c8beda 100644 --- a/recipes-devtools/rust/rustlib.bb +++ b/recipes-devtools/rust/rustlib.bb @@ -9,7 +9,7 @@ DEPENDS += "virtual/${TARGET_PREFIX}rust" RUSTLIB_DEP = "" do_install () { - for f in ${STAGING_DIR_NATIVE}/${rustlib}/*.so; do + for f in ${STAGING_DIR_NATIVE}/${rustlib_src}/*.so; do echo Installing $f install -D -m 755 $f ${D}/${rustlib}/$(basename $f) done