This will allow us to use it elsewhere for architecture name
translation. This move is motivated by powerpc64le support.

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

diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass
index 98d65970e8c0..2f2a31867ad0 100644
--- a/meta/classes/rust-common.bbclass
+++ b/meta/classes/rust-common.bbclass
@@ -1,5 +1,21 @@
 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):
+    if arch == "i586" or arch == "i686":
+        return "x86"
+    elif arch == "mipsel":
+        return "mips"
+    elif arch == "mip64sel":
+        return "mips64"
+    elif arch == "armv7":
+        return "arm"
+    elif arch == "powerpc64le":
+        return "powerpc64"
+    else:
+        return arch
+
 # Common variables used by all Rust builds
 export rustlibdir = "${libdir}/rust"
 FILES:${PN} += "${rustlibdir}/*.so"
diff --git a/meta/recipes-devtools/rust/rust-common.inc 
b/meta/recipes-devtools/rust/rust-common.inc
index ceeee9786376..742933f1bd22 100644
--- a/meta/recipes-devtools/rust/rust-common.inc
+++ b/meta/recipes-devtools/rust/rust-common.inc
@@ -254,22 +254,6 @@ def sys_for(d, thing):
 def prefix_for(d, thing):
     return d.getVar('{}_PREFIX'.format(thing))
 
-# 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):
-    if arch == "i586" or arch == "i686":
-        return "x86"
-    elif arch == "mipsel":
-        return "mips"
-    elif arch == "mip64sel":
-        return "mips64"
-    elif arch == "armv7":
-        return "arm"
-    elif arch == "powerpc64le":
-        return "powerpc64"
-    else:
-        return arch
-
 # generates our target CPU value
 def llvm_cpu(d):
     cpu = d.getVar('PACKAGE_ARCH')
-- 
2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#162115): 
https://lists.openembedded.org/g/openembedded-core/message/162115
Mute This Topic: https://lists.openembedded.org/mt/89310355/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to