summaryrefslogtreecommitdiff
path: root/poky/meta/classes
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2022-02-28 17:39:46 +0300
committerAndrew Jeffery <andrew@aj.id.au>2022-03-01 06:39:12 +0300
commitecdf5f13a20426dbfb0830b4b1b72d922225a615 (patch)
tree0d0fcc0efd9323a886e30c2ba5af2e60ca7b332f /poky/meta/classes
parented818137f8ea071077b45a43b65708b23b2670e1 (diff)
downloadopenbmc-ecdf5f13a20426dbfb0830b4b1b72d922225a615.tar.xz
rust: Introduce arch_to_rust_arch()
On modern Power systems `uname -m` yields 'ppc64le' while the toolchain knows the architecture as 'powerpc64le'. Provide a mapping from one to the other to integrate with the existing architecture configuration flags. arch_to_rust_arch() only exists to map the OE *_ARCH variables before any further processing, unlike arch_to_rust_target_arch() which is specific to the internal triple handling of rust. On Linux ppc64le systems the changes give the following config: ``` $ cat ./tmp/work/ppc64le-linux/rust-native/1.58.0-r0/targets/ppc64le-linux.json { "llvm-target": "powerpc64le-unknown-linux-gnu", "data-layout": "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512", "max-atomic-width": 64, "target-pointer-width": "64", "target-c-int-width": "64", "target-endian": "little", "arch": "powerpc64", "os": "linux", "env": "gnu", "vendor": "unknown", "target-family": "unix", "linker": "gcc", "cpu": "generic", "dynamic-linking": true, "executables": true, "linker-is-gnu": true, "linker-flavor": "gcc", "has-rpath": true, "has-elf-tls": true, "position-independent-executables": true, "panic-strategy": "unwind" } ``` (cherry picked from commit 28cbb0d6df7333ba0bf40b77d0c70f8621a8f7a7) Change-Id: Ief0c01189185d7d4da31d307270bec4e1de674ca Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'poky/meta/classes')
-rw-r--r--poky/meta/classes/base.bbclass2
-rw-r--r--poky/meta/classes/rust-common.bbclass2
2 files changed, 2 insertions, 2 deletions
diff --git a/poky/meta/classes/base.bbclass b/poky/meta/classes/base.bbclass
index 5f4956a1d3..9f1bfe8466 100644
--- a/poky/meta/classes/base.bbclass
+++ b/poky/meta/classes/base.bbclass
@@ -12,7 +12,7 @@ inherit logging
OE_EXTRA_IMPORTS ?= ""
-OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa oe.reproducible ${OE_EXTRA_IMPORTS}"
+OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa oe.reproducible oe.rust ${OE_EXTRA_IMPORTS}"
OE_IMPORTS[type] = "list"
PACKAGECONFIG_CONFARGS ??= ""
diff --git a/poky/meta/classes/rust-common.bbclass b/poky/meta/classes/rust-common.bbclass
index 98d65970e8..8cfe864ca3 100644
--- a/poky/meta/classes/rust-common.bbclass
+++ b/poky/meta/classes/rust-common.bbclass
@@ -65,7 +65,7 @@ def rust_base_triple(d, thing):
if thing == "TARGET" and target_is_armv7(d):
arch = "armv7"
else:
- arch = d.getVar('{}_ARCH'.format(thing))
+ arch = oe.rust.arch_to_rust_arch(d.getVar('{}_ARCH'.format(thing)))
# All the Yocto targets are Linux and are 'unknown'
vendor = "-unknown"