summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-23 12:03:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-28 11:07:33 +0100
commit1900f5b6078c7ca25c208d1c8230e3074c28425d (patch)
tree90a831cd24168759ccb2c44372414c92b86f6f05 /meta/recipes-devtools/rust
parent276c6ffe5f4d58b7c14eada8853edff906da0438 (diff)
downloadpoky-1900f5b6078c7ca25c208d1c8230e3074c28425d.tar.gz
rust-cross/rust-common: Merge arm target handling code to fix cross-canadian
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. (From OE-Core rev: ff3c3dbbd2bf1bb7bb70b55cca203e9eedcf14a8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rust')
-rw-r--r--meta/recipes-devtools/rust/rust-common.inc6
-rw-r--r--meta/recipes-devtools/rust/rust-cross.inc7
2 files changed, 7 insertions, 6 deletions
diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc
index 37abd2cd26..82ff03b908 100644
--- a/meta/recipes-devtools/rust/rust-common.inc
+++ b/meta/recipes-devtools/rust/rust-common.inc
@@ -297,6 +297,12 @@ def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""):
297 sys = sys_for(d, thing) 297 sys = sys_for(d, thing)
298 prefix = prefix_for(d, thing) 298 prefix = prefix_for(d, thing)
299 299
300 if thing == "TARGET":
301 abi = d.getVar('ABIEXTENSION')
302 # arm and armv7 have different targets in llvm
303 if arch == "arm" and target_is_armv7(d):
304 arch = 'armv7'
305
300 rust_arch = oe.rust.arch_to_rust_arch(arch) 306 rust_arch = oe.rust.arch_to_rust_arch(arch)
301 307
302 if abi: 308 if abi:
diff --git a/meta/recipes-devtools/rust/rust-cross.inc b/meta/recipes-devtools/rust/rust-cross.inc
index f6babfeeda..4c026b1f38 100644
--- a/meta/recipes-devtools/rust/rust-cross.inc
+++ b/meta/recipes-devtools/rust/rust-cross.inc
@@ -8,15 +8,10 @@ python do_rust_gen_targets () {
8 features = "" 8 features = ""
9 cpu = "generic" 9 cpu = "generic"
10 arch = d.getVar('{}_ARCH'.format(thing)) 10 arch = d.getVar('{}_ARCH'.format(thing))
11 abi = ""
12 if thing is "TARGET": 11 if thing is "TARGET":
13 abi = d.getVar('ABIEXTENSION')
14 # arm and armv7 have different targets in llvm
15 if arch == "arm" and target_is_armv7(d):
16 arch = 'armv7'
17 features = d.getVar('TARGET_LLVM_FEATURES') or "" 12 features = d.getVar('TARGET_LLVM_FEATURES') or ""
18 cpu = d.getVar('TARGET_LLVM_CPU') 13 cpu = d.getVar('TARGET_LLVM_CPU')
19 rust_gen_target(d, thing, wd, features, cpu, arch, abi) 14 rust_gen_target(d, thing, wd, features, cpu, arch)
20} 15}
21 16
22# Otherwise we'll depend on what we provide 17# Otherwise we'll depend on what we provide