diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2022-03-01 01:09:46 +1030 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-02 18:44:17 +0000 |
commit | 102e4c029e30aba78e4045ae06115096870f036f (patch) | |
tree | 459526dcbd1c11dd812af3a27664abd59a23f265 /meta/lib | |
parent | 39aec4ac7feb9475aa8143bd8854438f10532ab1 (diff) | |
download | poky-102e4c029e30aba78e4045ae06115096870f036f.tar.gz |
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 <andrew@aj.id.au>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/rust.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/lib/oe/rust.py b/meta/lib/oe/rust.py new file mode 100644 index 0000000000..ec70b34805 --- /dev/null +++ b/meta/lib/oe/rust.py | |||
@@ -0,0 +1,5 @@ | |||
1 | # Handle mismatches between `uname -m`-style output and Rust's arch names | ||
2 | def arch_to_rust_arch(arch): | ||
3 | if arch == "ppc64le": | ||
4 | return "powerpc64le" | ||
5 | return arch | ||