summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-25 14:40:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-26 22:09:44 +0100
commitfe90461e2d79718e449172886df00c72d8e2f0e9 (patch)
tree6a162cd8710a3f7f243081f1b841ecd90bde9d79 /meta/recipes-devtools
parentc9de49fb8078e91c26f123eed3601941d5461326 (diff)
downloadpoky-fe90461e2d79718e449172886df00c72d8e2f0e9.tar.gz
rust: Avoid buildtools+uninative issues with glibc symbols mismatches
If we use an external buildtools tarball, that combined with uninative results in build failures with symbol mismatches. This was tracked down to the prebuilt rust binaries that are downloaded. The libc/loader used to load them is used to execute target binaries/libraries and therefore anything with built with a newer libc would fail. Add code to use patchelf to change the interpreter to our own uninative one if present which ensures the newer libc and loader are used, hence avoiding the issue. (From OE-Core rev: 099c761ffddcc828329d3083cc8f3d24b43e9277) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/rust/rust.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc
index 6045ab4d42..dc92cf5fd0 100644
--- a/meta/recipes-devtools/rust/rust.inc
+++ b/meta/recipes-devtools/rust/rust.inc
@@ -50,6 +50,14 @@ do_rust_setup_snapshot () {
50 # and fail without it there. 50 # and fail without it there.
51 mkdir -p ${RUSTSRC}/build/${BUILD_SYS} 51 mkdir -p ${RUSTSRC}/build/${BUILD_SYS}
52 ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${BUILD_SYS}/stage0 52 ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${BUILD_SYS}/stage0
53
54 # Need to use uninative's loader if enabled/present since the library paths
55 # are used internally by rust and result in symbol mismatches if we don't
56 if [ ! -z "${UNINATIVE_LOADER}" -a -e "${UNINATIVE_LOADER}" ]; then
57 for bin in cargo rustc rustdoc; do
58 patchelf-uninative ${WORKDIR}/rust-snapshot/bin/$bin --set-interpreter ${UNINATIVE_LOADER}
59 done
60 fi
53} 61}
54addtask rust_setup_snapshot after do_unpack before do_configure 62addtask rust_setup_snapshot after do_unpack before do_configure
55do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot" 63do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot"