summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-05 14:05:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-08 15:44:20 +0100
commit0b374dc724cae3c1979d5191a477cab5eb333ab1 (patch)
treef9c1e6cda298511e97eeed4d673bc609d066964a /meta/classes
parentd172b76c264fae888855f6dc6565fda7035fcbb2 (diff)
downloadpoky-0b374dc724cae3c1979d5191a477cab5eb333ab1.tar.gz
rust-target-config: Make target workaround generic
Ensure the 'target' data is set for both HOST and TARGET queries as appropriate to work correctly in cross configurations. (From OE-Core rev: ec15882fbf396de8d3a5921a3028850ba3fccc48) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/rust-target-config.bbclass8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/classes/rust-target-config.bbclass b/meta/classes/rust-target-config.bbclass
index bc6bd77abb..0f0797603e 100644
--- a/meta/classes/rust-target-config.bbclass
+++ b/meta/classes/rust-target-config.bbclass
@@ -290,6 +290,10 @@ llvm_cpu[vardepvalue] = "${@llvm_cpu(d)}"
290 290
291def rust_gen_target(d, thing, wd, arch): 291def rust_gen_target(d, thing, wd, arch):
292 import json 292 import json
293
294 build_sys = d.getVar('BUILD_SYS')
295 target_sys = d.getVar('TARGET_SYS')
296
293 sys = d.getVar('{}_SYS'.format(thing)) 297 sys = d.getVar('{}_SYS'.format(thing))
294 prefix = d.getVar('{}_PREFIX'.format(thing)) 298 prefix = d.getVar('{}_PREFIX'.format(thing))
295 rustsys = d.getVar('RUST_{}_SYS'.format(thing)) 299 rustsys = d.getVar('RUST_{}_SYS'.format(thing))
@@ -298,7 +302,9 @@ def rust_gen_target(d, thing, wd, arch):
298 cpu = "generic" 302 cpu = "generic"
299 features = "" 303 features = ""
300 304
301 if thing == "TARGET": 305 # Need to apply the target tuning consitently, only if the triplet applies to the target
306 # and not in the native case
307 if sys == target_sys and sys != build_sys:
302 abi = d.getVar('ABIEXTENSION') 308 abi = d.getVar('ABIEXTENSION')
303 cpu = llvm_cpu(d) 309 cpu = llvm_cpu(d)
304 if bb.data.inherits_class('native', d): 310 if bb.data.inherits_class('native', d):