[Yocto #14892]
This is a fix for YOCTO #14878 patch. When sheband is more than 128 characters 
the default shell /bin/sh is used instead of SDK shell, which causes problems 
with LD_LIBRARY_PATH.
With this patch shell usage is avoided.

Signed-off-by: Sundeep KOKKONDA <sundeep.kokko...@gmail.com>
---
 .../rust/files/target-rust-ccld.c             | 20 +++++++++++++++++++
 .../rust/rust-cross-canadian.inc              | 11 +++++-----
 2 files changed, 25 insertions(+), 6 deletions(-)
 create mode 100644 meta/recipes-devtools/rust/files/target-rust-ccld.c

diff --git a/meta/recipes-devtools/rust/files/target-rust-ccld.c 
b/meta/recipes-devtools/rust/files/target-rust-ccld.c
new file mode 100644
index 0000000000..5d903a0d1e
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/target-rust-ccld.c
@@ -0,0 +1,20 @@
+/*
+*
+* Copyright (C) 2022      Wind River Systems
+*
+* SPDX-License-Identifier: GPL-2.0-only
+*
+*/
+
+        #include <string.h>
+        #include <stdlib.h>
+        #include <unistd.h>
+
+        int main (int argc, char *argv[])
+        {
+        unsetenv("LD_LIBRARY_PATH");
+        execvp("x86_64-pokysdk-linux-gcc",argv);
+
+        return 0;
+       }
+
diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc 
b/meta/recipes-devtools/rust/rust-cross-canadian.inc
index 7bf75a4712..375c435bff 100644
--- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
+++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
@@ -7,16 +7,15 @@ LICENSE = "MIT"
 
 MODIFYTOS = "0"
 
+DEPENDS += "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+SRC_URI += "file://target-rust-ccld.c"
+
 # Need to use our SDK's sh here, see #14878
 create_sdk_wrapper () {
         file="$1"
         shift
-
-        cat <<- EOF > "${file}"
-               #!${base_prefix}/bin/sh
-               \$$1 \$@
-               EOF
-
+       ${CC} ${WORKDIR}/target-rust-ccld.c -o "${file}"
         chmod +x "$file"
 }
 
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170281): 
https://lists.openembedded.org/g/openembedded-core/message/170281
Mute This Topic: https://lists.openembedded.org/mt/93454488/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