On 05-05-2026 15:06, Richard Purdie wrote:
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

On Tue, 2026-05-05 at 01:16 -0700, Varatharajan, Deepesh via 
lists.openembedded.org wrote:
From: Deepesh Varatharajan <[email protected]>

Target LLVM tools are installed in the sysroot because they are needed
for llvm-lit to run tests. However, this leads Rust to pick up a target
llvm-config that cannot run on the host. Overwrite it with the native
llvm-config so Rust can execute it correctly.

Signed-off-by: Deepesh Varatharajan <[email protected]>
---
  meta/recipes-devtools/rust/rust_1.94.1.bb | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/rust/rust_1.94.1.bb 
b/meta/recipes-devtools/rust/rust_1.94.1.bb
index 3eb2a36406..e4a9f20e27 100644
--- a/meta/recipes-devtools/rust/rust_1.94.1.bb
+++ b/meta/recipes-devtools/rust/rust_1.94.1.bb
@@ -238,9 +238,10 @@ rust_runx () {

      # Copy the natively built llvm-config into the target so we can run it. 
Horrible,
      # but works!
-    if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} -a ! 
-f ${RUST_ALTERNATE_EXE_PATH} ]; then
+    if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} ]; 
then
          mkdir -p `dirname ${RUST_ALTERNATE_EXE_PATH}`
-        cp ${RUST_ALTERNATE_EXE_PATH_NATIVE} ${RUST_ALTERNATE_EXE_PATH}
+        rm -f ${RUST_ALTERNATE_EXE_PATH}
+        cp -f ${RUST_ALTERNATE_EXE_PATH_NATIVE} ${RUST_ALTERNATE_EXE_PATH}
          patchelf --remove-rpath ${RUST_ALTERNATE_EXE_PATH}
      fi
This appears to be a consequence of the new install in "clang: Enable
cmake flags for llvm, clang, lld tests". Perhaps we should just not
install llvm-config there if it is going to cause problems and need to
be overwritten?
Yes, this is due to the new installations. We now need the target llvm-config to run the Clang family test suite inside QEMU for the target. Previously, we didn’t install LLVM target tools, but running the Clang test suite for the target requires these tools to be present in bin so
that llvm-lit can use them.

Also, the existing check is somewhat odd. Even if llvm-config exists in ${RUST_ALTERNATE_EXE_PATH}, it can’t be used for building Rust because that version is built for the target. Therefore,
overriding it with the native llvm-config makes sense.

Regards,
Deepesh

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#236478): 
https://lists.openembedded.org/g/openembedded-core/message/236478
Mute This Topic: https://lists.openembedded.org/mt/119157533/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to