summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-05 15:27:18 +0100
committerSteve Sakoman <steve@sakoman.com>2023-12-12 04:20:35 -1000
commit079e50aba036cd0155767c3f44134d0130fff05b (patch)
tree9e680d39735818c72056ebbb73311a9b9d8fc8db
parent26ffdb7a3085b6d7230bd56424e82c7a3b51b4f9 (diff)
downloadpoky-079e50aba036cd0155767c3f44134d0130fff05b.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: 0adada8111c17e8e5a7c32cef86bdb8e7dfd79d3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ff3c3dbbd2bf1bb7bb70b55cca203e9eedcf14a8) Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-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 ac00fd3d43..3252827818 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