From 102e4c029e30aba78e4045ae06115096870f036f Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Tue, 1 Mar 2022 01:09:46 +1030 Subject: 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" } ``` Change-Id: Ief0c01189185d7d4da31d307270bec4e1de674ca (From OE-Core rev: 9ab61e3cfef0157393cb870d606c2f362e190889) Signed-off-by: Andrew Jeffery Signed-off-by: Richard Purdie --- meta/classes/base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'meta/classes/base.bbclass') diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 966eadad67..b7869da3b3 100644 --- a/meta/classes/base.bbclass +++ b/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 ??= "" -- cgit v1.2.3-54-g00ecf