]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
rust-cross/rust-common: Merge arm target handling code to fix cross-canadian
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 23 Jul 2022 11:03:43 +0000 (12:03 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 28 Jul 2022 10:07:11 +0000 (11:07 +0100)
rust-cross had special handling for armv7 targets but we also need this
for cross-canadian. Merge the code into the main function so everything is
consistent.

Also then fix the arm definition to be arm-eabi since ABI is correctly
being looked up.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/rust/rust-common.inc
meta/recipes-devtools/rust/rust-cross.inc

index 37abd2cd26da9bb8ae91d0f4ba5f25f1a6017ce9..82ff03b90896d752fe140f9db5ed4d68e0844a8d 100644 (file)
@@ -297,6 +297,12 @@ def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""):
     sys = sys_for(d, thing)
     prefix = prefix_for(d, thing)
 
+    if thing == "TARGET":
+        abi = d.getVar('ABIEXTENSION')
+        # arm and armv7 have different targets in llvm
+        if arch == "arm" and target_is_armv7(d):
+            arch = 'armv7'
+
     rust_arch = oe.rust.arch_to_rust_arch(arch)
 
     if abi:
index f6babfeedaaf3be2b4b1901810ca69dd768488ea..4c026b1f3883cabe349d7cac4f1d84acff0a32fe 100644 (file)
@@ -8,15 +8,10 @@ python do_rust_gen_targets () {
         features = ""
         cpu = "generic"
         arch = d.getVar('{}_ARCH'.format(thing))
-        abi = ""
         if thing is "TARGET":
-            abi = d.getVar('ABIEXTENSION')
-            # arm and armv7 have different targets in llvm
-            if arch == "arm" and target_is_armv7(d):
-                arch = 'armv7'
             features = d.getVar('TARGET_LLVM_FEATURES') or ""
             cpu = d.getVar('TARGET_LLVM_CPU')
-        rust_gen_target(d, thing, wd, features, cpu, arch, abi)
+        rust_gen_target(d, thing, wd, features, cpu, arch)
 }
 
 # Otherwise we'll depend on what we provide