rust-native shouldn't depend on TARGET variables
Similar to 3b783652cc, this makes sure
rust-native does not depend on target variables. This allow one
rust-native to be shared between machines of different architectures
again.
For the record, the following guide was used to find out why
do_rust_gen_targets differed between different machines.
https://wiki.yoctoproject.org/wiki/TipsAndTricks/Understanding_what_changed_(diffsigs_etc)
This commit is contained in:
@@ -10,10 +10,14 @@ python do_rust_gen_targets () {
|
|||||||
bb.debug(1, "rust_gen_target for " + thing)
|
bb.debug(1, "rust_gen_target for " + thing)
|
||||||
features = ""
|
features = ""
|
||||||
cpu = "generic"
|
cpu = "generic"
|
||||||
|
arch = d.getVar('{}_ARCH'.format(thing))
|
||||||
if thing is "TARGET":
|
if thing is "TARGET":
|
||||||
|
# arm and armv7 have different targets in llvm
|
||||||
|
if arch == "arm" and target_is_armv7(d):
|
||||||
|
arch = 'armv7'
|
||||||
features = d.getVar('TARGET_LLVM_FEATURES') or ""
|
features = d.getVar('TARGET_LLVM_FEATURES') or ""
|
||||||
cpu = d.getVar('TARGET_LLVM_CPU')
|
cpu = d.getVar('TARGET_LLVM_CPU')
|
||||||
rust_gen_target(d, thing, wd, features, cpu)
|
rust_gen_target(d, thing, wd, features, cpu, arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Otherwise we'll depend on what we provide
|
# Otherwise we'll depend on what we provide
|
||||||
|
|||||||
@@ -252,12 +252,6 @@ TARGET_POINTER_WIDTH[riscv64] = "64"
|
|||||||
TARGET_C_INT_WIDTH[riscv64] = "64"
|
TARGET_C_INT_WIDTH[riscv64] = "64"
|
||||||
MAX_ATOMIC_WIDTH[riscv64] = "64"
|
MAX_ATOMIC_WIDTH[riscv64] = "64"
|
||||||
|
|
||||||
def arch_for(d, thing):
|
|
||||||
if thing == 'TARGET' and target_is_armv7(d):
|
|
||||||
return "armv7"
|
|
||||||
else:
|
|
||||||
return d.getVar('{}_ARCH'.format(thing))
|
|
||||||
|
|
||||||
def sys_for(d, thing):
|
def sys_for(d, thing):
|
||||||
return d.getVar('{}_SYS'.format(thing))
|
return d.getVar('{}_SYS'.format(thing))
|
||||||
|
|
||||||
@@ -316,10 +310,9 @@ TARGET_LLVM_FEATURES = "${@llvm_features(d)}"
|
|||||||
# (original) target.
|
# (original) target.
|
||||||
TARGET_LLVM_FEATURES_class-native = "${@','.join(llvm_features_from_cc_arch(d))}"
|
TARGET_LLVM_FEATURES_class-native = "${@','.join(llvm_features_from_cc_arch(d))}"
|
||||||
|
|
||||||
def rust_gen_target(d, thing, wd, features, cpu):
|
def rust_gen_target(d, thing, wd, features, cpu, arch):
|
||||||
import json
|
import json
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
arch = arch_for(d, thing)
|
|
||||||
sys = sys_for(d, thing)
|
sys = sys_for(d, thing)
|
||||||
prefix = prefix_for(d, thing)
|
prefix = prefix_for(d, thing)
|
||||||
|
|
||||||
@@ -373,7 +366,8 @@ def rust_gen_target(d, thing, wd, features, cpu):
|
|||||||
|
|
||||||
python do_rust_gen_targets () {
|
python do_rust_gen_targets () {
|
||||||
wd = d.getVar('WORKDIR') + '/targets/'
|
wd = d.getVar('WORKDIR') + '/targets/'
|
||||||
rust_gen_target(d, 'BUILD', wd, "", "generic")
|
build_arch = d.getVar('BUILD_ARCH')
|
||||||
|
rust_gen_target(d, 'BUILD', wd, "", "generic", build_arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
addtask rust_gen_targets after do_patch before do_compile
|
addtask rust_gen_targets after do_patch before do_compile
|
||||||
|
|||||||
Reference in New Issue
Block a user