Modify the SYSROOT PATH to fix race around issue when rust-hello-world
is run for two libc one after the other.

Signed-off-by: Pgowda <pgowda....@gmail.com>
---
 meta/recipes-devtools/rust/rust-cross.inc | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/rust/rust-cross.inc 
b/meta/recipes-devtools/rust/rust-cross.inc
index bee7c9f12f..09d0078d17 100644
--- a/meta/recipes-devtools/rust/rust-cross.inc
+++ b/meta/recipes-devtools/rust/rust-cross.inc
@@ -32,7 +32,17 @@ DEPENDS += "virtual/${TARGET_PREFIX}gcc 
virtual/${TARGET_PREFIX}compilerlibs vir
 DEPENDS += "rust-native"
 
 PROVIDES = "virtual/${TARGET_PREFIX}rust"
-PN = "rust-cross-${TARGET_ARCH}"
+
+# Modify the sysroot PATH based on the libc used to fix race around issue.
+def get_libc(d):
+    tclibc = d.getVar('TCLIBC')
+    if tclibc == 'glibc':
+        pn = "rust-cross-${TARGET_ARCH}"
+    else:
+        pn = "rust-cross-${TARGET_ARCH}-${TCLIBC}"
+    return pn
+
+PN := "${@get_libc(d)}"
 
 # In the cross compilation case, rustc doesn't seem to get the rpath quite
 # right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't
-- 
2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156513): 
https://lists.openembedded.org/g/openembedded-core/message/156513
Mute This Topic: https://lists.openembedded.org/mt/85993368/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to