[RFC,2/8] rust: Rename arch_to_rust_target_arch() for generality

Message ID 20220222035234.463162-3-andrew@aj.id.au
State New
Headers show
Series rust: Fix powerpc64le support | expand

Commit Message

Andrew Jeffery Feb. 22, 2022, 3:52 a.m. UTC
It's not just for translating TARGET names, but any of BUILD, HOST or
TARGET.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 meta/classes/rust-common.bbclass           | 2 +-
 meta/recipes-devtools/rust/rust-common.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass
index 2f2a31867ad0..e50d606ce26f 100644
--- a/meta/classes/rust-common.bbclass
+++ b/meta/classes/rust-common.bbclass
@@ -2,7 +2,7 @@  inherit python3native
 
 # Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something
 # rust's internals won't choke on.
-def arch_to_rust_target_arch(arch):
+def arch_to_rust_arch(arch):
     if arch == "i586" or arch == "i686":
         return "x86"
     elif arch == "mipsel":
diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc
index 742933f1bd22..c36d836fcf41 100644
--- a/meta/recipes-devtools/rust/rust-common.inc
+++ b/meta/recipes-devtools/rust/rust-common.inc
@@ -313,7 +313,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_arch(arch)
     tspec['os'] = "linux"
     if "musl" in tspec['llvm-target']:
         tspec['env'] = "musl"