diff options
-rw-r--r-- | poky/meta/classes/base.bbclass | 2 | ||||
-rw-r--r-- | poky/meta/classes/rust-common.bbclass | 2 | ||||
-rw-r--r-- | poky/meta/lib/oe/rust.py | 5 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/rust/rust-common.inc | 8 |
4 files changed, 12 insertions, 5 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" diff --git a/poky/meta/lib/oe/rust.py b/poky/meta/lib/oe/rust.py new file mode 100644 index 0000000000..ec70b34805 --- /dev/null +++ b/poky/meta/lib/oe/rust.py @@ -0,0 +1,5 @@ +# Handle mismatches between `uname -m`-style output and Rust's arch names +def arch_to_rust_arch(arch): + if arch == "ppc64le": + return "powerpc64le" + return arch diff --git a/poky/meta/recipes-devtools/rust/rust-common.inc b/poky/meta/recipes-devtools/rust/rust-common.inc index ceeee97863..310aecef22 100644 --- a/poky/meta/recipes-devtools/rust/rust-common.inc +++ b/poky/meta/recipes-devtools/rust/rust-common.inc @@ -313,10 +313,12 @@ def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""): sys = sys_for(d, thing) prefix = prefix_for(d, thing) + rust_arch = oe.rust.arch_to_rust_arch(arch) + if abi: - arch_abi = "{}-{}".format(arch, abi) + arch_abi = "{}-{}".format(rust_arch, abi) else: - arch_abi = arch + arch_abi = rust_arch features = features or d.getVarFlag('FEATURES', arch_abi) or "" features = features.strip() @@ -329,7 +331,7 @@ def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""): tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi) tspec['target-c-int-width'] = d.getVarFlag('TARGET_C_INT_WIDTH', arch_abi) tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch_abi) - tspec['arch'] = arch_to_rust_target_arch(arch) + tspec['arch'] = arch_to_rust_target_arch(rust_arch) tspec['os'] = "linux" if "musl" in tspec['llvm-target']: tspec['env'] = "musl" |