[RFC,3/8] rust: Handle Power arch variants in arch_to_rust_arch()

Message ID 20220222035234.463162-4-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
Modern Power ecosystems can be either BE or LE, so handle both. Further,
rust understands these as "powerpc64" and "powerpc64le" respectively.

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

Patch

diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass
index e50d606ce26f..3c7d133f0445 100644
--- a/meta/classes/rust-common.bbclass
+++ b/meta/classes/rust-common.bbclass
@@ -11,8 +11,10 @@  def arch_to_rust_arch(arch):
         return "mips64"
     elif arch == "armv7":
         return "arm"
-    elif arch == "powerpc64le":
+    elif arch == "ppc64":
         return "powerpc64"
+    elif arch == "ppc64le":
+        return "powerpc64le"
     else:
         return arch
 
diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc
index c36d836fcf41..4b758260d276 100644
--- a/meta/recipes-devtools/rust/rust-common.inc
+++ b/meta/recipes-devtools/rust/rust-common.inc
@@ -265,7 +265,8 @@  def llvm_cpu(d):
     trans['x86-64'] = "x86-64"
     trans['i686'] = "i686"
     trans['i586'] = "i586"
-    trans['powerpc'] = "powerpc"
+    trans['powerpc64'] = "powerpc"
+    trans['powerpc64le'] = "powerpc"
     trans['mips64'] = "mips64"
     trans['mips64el'] = "mips64"
     trans['riscv64'] = "generic-rv64"