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:41:36 +0100
commitec15882fbf396de8d3a5921a3028850ba3fccc48 (patch)
tree8109cebc975cb4ca569e4f16ed87d1dbb1fd5784 /meta/classes
parentdc134c031171a55a35964ba801219552a516a0ca (diff)
downloadopenembedded-core-contrib-ec15882fbf396de8d3a5921a3028850ba3fccc48.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. 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)}"
def rust_gen_target(d, thing, wd, arch):
import json
+
+ build_sys = d.getVar('BUILD_SYS')
+ target_sys = d.getVar('TARGET_SYS')
+
sys = d.getVar('{}_SYS'.format(thing))
prefix = d.getVar('{}_PREFIX'.format(thing))
rustsys = d.getVar('RUST_{}_SYS'.format(thing))
@@ -298,7 +302,9 @@ def rust_gen_target(d, thing, wd, arch):
cpu = "generic"
features = ""
- if thing == "TARGET":
+ # Need to apply the target tuning consitently, only if the triplet applies to the target
+ # and not in the native case
+ if sys == target_sys and sys != build_sys:
abi = d.getVar('ABIEXTENSION')
cpu = llvm_cpu(d)
if bb.data.inherits_class('native', d):