From: Deepthi Hemraj <[email protected]>

[YOCTO #15061]
Rust multilib sdks broken because of the conflicts between attempted installs 
of rust-cross-canadian for 32 and 64 bit target architectures
32 and 64 bit target architectures are trying to install cargo.sh and rust.sh 
in the same path which resulted in the issue.

The current patch  checks for the 32 and 64 bit target architectures and 
modifies CARGO_ENV_SETUP_SH and RUST_ENV_SETUP_SH macros.
Hence, it creates different file names for the environment setup scripts and 
resolves the issue.

Signed-off-by: Deepthi Hemraj <[email protected]>
---
 meta/recipes-devtools/rust/rust-cross-canadian.inc | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc 
b/meta/recipes-devtools/rust/rust-cross-canadian.inc
index 7bfef6d175..7153a59a9d 100644
--- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
+++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
@@ -52,7 +52,12 @@ do_install () {
 
     ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
     mkdir "${ENV_SETUP_DIR}"
-    RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh"
+
+    if echo "${TARGET_ARCH}" | grep -q "64"; then
+        RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh"
+    else
+        RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust-32.sh"
+    fi
 
     RUST_TARGET_TRIPLE=`echo ${RUST_TARGET_SYS} | tr '[:lower:]' '[:upper:]' | 
sed 's/-/_/g'`
     RUST_HOST_TRIPLE=`echo ${RUST_HOST_SYS} | tr '[:lower:]' '[:upper:]' | sed 
's/-/_/g'`
@@ -66,7 +71,12 @@ do_install () {
 
     chown -R root.root ${D}
 
-    CARGO_ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh"
+    if echo "${TARGET_ARCH}" | grep -q "64"; then
+        CARGO_ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh"
+    else
+        CARGO_ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo-32.sh"
+    fi
+
     cat <<- EOF > "${CARGO_ENV_SETUP_SH}"
        export CARGO_HOME="\$OECORE_TARGET_SYSROOT/home/cargo"
        mkdir -p "\$CARGO_HOME"
-- 
2.42.0

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

Reply via email to