diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2022-02-28 17:39:47 +0300 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2022-03-01 06:39:20 +0300 |
commit | 1d89bf8e0e5964e223b9605444e151360f93bcdf (patch) | |
tree | 4050eed0c9393dcebec1121b152df52de4167862 /poky | |
parent | ecdf5f13a20426dbfb0830b4b1b72d922225a615 (diff) | |
download | openbmc-1d89bf8e0e5964e223b9605444e151360f93bcdf.tar.xz |
rust: Introduce RUST_BUILD_ARCH
RUST_BUILD_ARCH contains the arch_to_rust_arch()-translated value of
BUILD_ARCH. This is necessary to acquire the correct snapshot artifacts
under Linux where `uname -m` reports "ppc64le" rather than
"powerpc64le".
(cherry picked from commit a6be6aa40f81cffe155ea7dafc891ee8db615455)
Change-Id: I6aec23aced8e1c6f0bfc46fe52531b0c16bcf687
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'poky')
-rw-r--r-- | poky/meta/classes/rust-common.bbclass | 4 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/rust/rust-snapshot.inc | 12 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/rust/rust.inc | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/poky/meta/classes/rust-common.bbclass b/poky/meta/classes/rust-common.bbclass index 8cfe864ca3..65ad677499 100644 --- a/poky/meta/classes/rust-common.bbclass +++ b/poky/meta/classes/rust-common.bbclass @@ -89,6 +89,10 @@ def rust_base_triple(d, thing): libc = bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hf', '', d) return arch + vendor + '-' + os + libc + +# In some cases uname and the toolchain differ on their idea of the arch name +RUST_BUILD_ARCH = "${@oe.rust.arch_to_rust_arch(d.getVar('BUILD_ARCH'))}" + # Naming explanation # Yocto # - BUILD_SYS - Yocto triple of the build environment diff --git a/poky/meta/recipes-devtools/rust/rust-snapshot.inc b/poky/meta/recipes-devtools/rust/rust-snapshot.inc index 74b558262f..173648c889 100644 --- a/poky/meta/recipes-devtools/rust/rust-snapshot.inc +++ b/poky/meta/recipes-devtools/rust/rust-snapshot.inc @@ -15,11 +15,11 @@ SRC_URI[rustc-snapshot-aarch64.sha256sum] = "f26811e48d03c56c125de03d389e1ae7c6d SRC_URI[cargo-snapshot-aarch64.sha256sum] = "6d11cd94618d80cda273eeeae7285980445f61a49ebacc616777b482a41cbf3f" SRC_URI += " \ - https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ - https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ - https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \ " -RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" -RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" -CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" +RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" +RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" +CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" diff --git a/poky/meta/recipes-devtools/rust/rust.inc b/poky/meta/recipes-devtools/rust/rust.inc index 1d6f99afad..f39228e3c0 100644 --- a/poky/meta/recipes-devtools/rust/rust.inc +++ b/poky/meta/recipes-devtools/rust/rust.inc @@ -27,7 +27,7 @@ CARGO_DISABLE_BITBAKE_VENDORING = "1" # We can't use RUST_BUILD_SYS here because that may be "musl" if # TCLIBC="musl". Snapshots are always -unknown-linux-gnu -SNAPSHOT_BUILD_SYS = "${BUILD_ARCH}-unknown-linux-gnu" +SNAPSHOT_BUILD_SYS = "${RUST_BUILD_ARCH}-unknown-linux-gnu" setup_cargo_environment () { # The first step is to build bootstrap and some early stage tools, # these are build for the same target as the snapshot, e.g. |