summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust/rust-common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rust/rust-common.inc')
-rw-r--r--meta/recipes-devtools/rust/rust-common.inc29
1 files changed, 12 insertions, 17 deletions
diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc
index d00b380dbd..be9d1a301b 100644
--- a/meta/recipes-devtools/rust/rust-common.inc
+++ b/meta/recipes-devtools/rust/rust-common.inc
@@ -232,12 +232,6 @@ TARGET_POINTER_WIDTH[riscv64] = "64"
TARGET_C_INT_WIDTH[riscv64] = "64"
MAX_ATOMIC_WIDTH[riscv64] = "64"
-def sys_for(d, thing):
- return d.getVar('{}_SYS'.format(thing))
-
-def prefix_for(d, thing):
- return d.getVar('{}_PREFIX'.format(thing))
-
# Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something
# rust's internals won't choke on.
def arch_to_rust_target_arch(arch):
@@ -285,20 +279,21 @@ def llvm_cpu(d):
except:
return trans.get(target, "generic")
-TARGET_LLVM_CPU="${@llvm_cpu(d)}"
-TARGET_LLVM_FEATURES = "${@llvm_features(d)}"
-
-# class-native implies TARGET=HOST, and TUNE_FEATURES only describes the real
-# (original) target.
-TARGET_LLVM_FEATURES:class-native = "${@','.join(llvm_features_from_cc_arch(d))}"
-
-def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""):
+def rust_gen_target(d, thing, wd, arch):
import json
- sys = sys_for(d, thing)
- prefix = prefix_for(d, thing)
+ sys = d.getVar('{}_SYS'.format(thing))
+ prefix = d.getVar('{}_PREFIX'.format(thing))
+
+ cpu = "generic"
+ features = ""
if thing == "TARGET":
abi = d.getVar('ABIEXTENSION')
+ cpu = d.getVar('TARGET_LLVM_CPU')
+ if bb.data.inherits_class('native', d):
+ features = ','.join(llvm_features_from_cc_arch(d))
+ else:
+ features = d.getVar('TARGET_LLVM_FEATURES') or ""
# arm and armv7 have different targets in llvm
if arch == "arm" and target_is_armv7(d):
arch = 'armv7'
@@ -362,7 +357,7 @@ do_rust_gen_targets[vardeps] += "DATA_LAYOUT TARGET_ENDIAN TARGET_POINTER_WIDTH
python do_rust_gen_targets () {
wd = d.getVar('WORKDIR') + '/targets/'
build_arch = d.getVar('BUILD_ARCH')
- rust_gen_target(d, 'BUILD', wd, "", "generic", build_arch)
+ rust_gen_target(d, 'BUILD', wd, build_arch)
}
addtask rust_gen_targets after do_patch before do_compile