summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-05 13:29:09 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-08 15:44:20 +0100
commit1ab2fd2d036e93bff84a78a85acc04a240ee5d07 (patch)
treed1028fc5349bf566507396b6f6717e93ee5d0117 /meta
parent1c8444bd380d8caff4f09a02af2c15be928f5ae6 (diff)
downloadpoky-1ab2fd2d036e93bff84a78a85acc04a240ee5d07.tar.gz
cargo_common: Handle build SYS as well as HOST/TARGET
Improve the common class to handle BUILD_SYS as well as host and target, removing the need to a workaround in the rust recipe. (From OE-Core rev: 0dc9635c28c269f782ad4ed6ea06b4e4de1beb8e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/cargo_common.bbclass9
-rw-r--r--meta/recipes-devtools/rust/rust.inc3
2 files changed, 9 insertions, 3 deletions
diff --git a/meta/classes/cargo_common.bbclass b/meta/classes/cargo_common.bbclass
index dcd0afd980..4a419cdd0a 100644
--- a/meta/classes/cargo_common.bbclass
+++ b/meta/classes/cargo_common.bbclass
@@ -82,6 +82,15 @@ cargo_common_do_configure () {
82 EOF 82 EOF
83 fi 83 fi
84 84
85 if [ "${RUST_TARGET_SYS}" != "${RUST_BUILD_SYS}" -a "${RUST_TARGET_SYS}" != "${RUST_HOST_SYS}"]; then
86 cat <<- EOF >> ${CARGO_HOME}/config
87
88 # TARGET_SYS
89 [target.${RUST_TARGET_SYS}]
90 linker = "${RUST_TARGET_CCLD}"
91 EOF
92 fi
93
85 # Put build output in build directory preferred by bitbake instead of 94 # Put build output in build directory preferred by bitbake instead of
86 # inside source directory unless they are the same 95 # inside source directory unless they are the same
87 if [ "${B}" != "${S}" ]; then 96 if [ "${B}" != "${S}" ]; then
diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc
index 5730887411..12c86e02c4 100644
--- a/meta/recipes-devtools/rust/rust.inc
+++ b/meta/recipes-devtools/rust/rust.inc
@@ -29,9 +29,6 @@ setup_cargo_environment () {
29 # x86_64-unknown-linux-gnu. 29 # x86_64-unknown-linux-gnu.
30 # Later stages are build for the native target (i.e. target.x86_64-linux) 30 # Later stages are build for the native target (i.e. target.x86_64-linux)
31 cargo_common_do_configure 31 cargo_common_do_configure
32
33 printf '[target.%s]\n' "${RUST_BUILD_SYS}" >> ${CARGO_HOME}/config
34 printf "linker = '%s'\n" "${RUST_BUILD_CCLD}" >> ${CARGO_HOME}/config
35} 32}
36 33
37inherit rust-target-config 34inherit rust-target-config