summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-01-15 12:55:17 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-26 16:06:29 +0000
commitf697dc7bafb8e360cbd63417ed16d484d4dbc7db (patch)
treefa3fff0f93c26bfd0155739d89dee245ee09109c /meta/recipes-devtools/rust
parent5e9e7dab893254ea5ff43aac08ee157ccd233770 (diff)
downloadpoky-f697dc7bafb8e360cbd63417ed16d484d4dbc7db.tar.gz
rust: Re-write RPATHs in the copies llvm-config
Ensure that it can still access the native-sysroot for dependencies, use ORIGIN to indicate this relative its install location, this also helps in this not getting into the output of llvm-config which could otherwise provide incorrect library paths target rust recipe builds ( cross compile ) calls llvm-config from target sysroot which works ok as long as C++ runtime it needs is available on build host e.g. libstdc++ etc. which is commonly the case, however when using clang and llvm runtime this falters since it should be using libc++ from native sysroot and if this does not exist on build machine this fails to find libc++ shared object and llvm-config fails to run. This ensures that llvm-config version in use is correctly relocated and can use shared libraries from native sysroot correctly. Adding ORIGIN to sysroot will look for the .so in same dir as the binary and there is the libc++.so.1 copied in place Fixes rust build with clang compiler. | /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/rust/1.74.1/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-config: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or director y | thread 'main' panicked at llvm.rs:551:19: | command did not execute successfully: "/mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/rust/1.74.1/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-config" "--version" | expected success, got: exit status: 127 (From OE-Core rev: 178ad50bf36f244f96159bb2f94e0d8849487931) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rust')
-rw-r--r--meta/recipes-devtools/rust/rust_1.74.1.bb6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/recipes-devtools/rust/rust_1.74.1.bb b/meta/recipes-devtools/rust/rust_1.74.1.bb
index 30543ada7d..f8db186890 100644
--- a/meta/recipes-devtools/rust/rust_1.74.1.bb
+++ b/meta/recipes-devtools/rust/rust_1.74.1.bb
@@ -200,7 +200,11 @@ rust_runx () {
200 if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} -a ! -f ${RUST_ALTERNATE_EXE_PATH} ]; then 200 if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} -a ! -f ${RUST_ALTERNATE_EXE_PATH} ]; then
201 mkdir -p `dirname ${RUST_ALTERNATE_EXE_PATH}` 201 mkdir -p `dirname ${RUST_ALTERNATE_EXE_PATH}`
202 cp ${RUST_ALTERNATE_EXE_PATH_NATIVE} ${RUST_ALTERNATE_EXE_PATH} 202 cp ${RUST_ALTERNATE_EXE_PATH_NATIVE} ${RUST_ALTERNATE_EXE_PATH}
203 chrpath -d ${RUST_ALTERNATE_EXE_PATH} 203 if [ -e ${STAGING_LIBDIR_NATIVE}/libc++.so.1 ]; then
204 chrpath -r \$ORIGIN/../../../../../`basename ${STAGING_DIR_NATIVE}`${libdir_native} ${RUST_ALTERNATE_EXE_PATH}
205 else
206 chrpath -d ${RUST_ALTERNATE_EXE_PATH}
207 fi
204 fi 208 fi
205 209
206 oe_cargo_fix_env 210 oe_cargo_fix_env