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>
diff --git a/poky/meta/classes/rust-common.bbclass b/poky/meta/classes/rust-common.bbclass
index 8cfe864..65ad677 100644
--- a/poky/meta/classes/rust-common.bbclass
+++ b/poky/meta/classes/rust-common.bbclass
@@ -89,6 +89,10 @@
         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