[PATCH v2] state/staging: Fix directory not deleted for race


Pgowda
 

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.cve@...>
---
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

Join {openembedded-core@lists.openembedded.org to automatically receive all group messages.