diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-05 15:27:16 +0100 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-12-12 04:20:35 -1000 |
| commit | 1110f16718920c49980fa28e11954a7b435a84aa (patch) | |
| tree | 5a6127e6b6ff688f19bcee85ff748f12db562fac /meta | |
| parent | 8b75148d8793810e404c8453271ddae7372b5b33 (diff) | |
| download | poky-1110f16718920c49980fa28e11954a7b435a84aa.tar.gz | |
rust-common: Set llvm-target correctly for cross SDK targets
When a 'BUILD' target is requested we shouldn't be looking at TARGET_SYS but
at BUILD_SYS. Due to the way rust mangles triplets, we need the HOST_SYS triplet
to work with existing code - fixing that issue is a separate patch.
Also drop the arch_abi argument, it doens't make any sense to a getVar() call
and was a copy and paste error.
Based on a patch from Otavio Salvador <otavio@ossystems.com.br> but separated out
and tweaked.
Fixes: bd36593ba3 ("rust-common: Drop LLVM_TARGET and simplify")
(From OE-Core rev: cccbb8358be830b83a43fe1ff8a88932dee1c228)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d554161a045d12411f288394e253c54aa4c1257c)
Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-devtools/rust/rust-common.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc index db0bd8fc1b..ac00fd3d43 100644 --- a/meta/recipes-devtools/rust/rust-common.inc +++ b/meta/recipes-devtools/rust/rust-common.inc | |||
| @@ -307,9 +307,13 @@ def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""): | |||
| 307 | features = features or d.getVarFlag('FEATURES', arch_abi) or "" | 307 | features = features or d.getVarFlag('FEATURES', arch_abi) or "" |
| 308 | features = features.strip() | 308 | features = features.strip() |
| 309 | 309 | ||
| 310 | llvm_target = d.getVar('RUST_TARGET_SYS') | ||
| 311 | if thing == "BUILD": | ||
| 312 | llvm_target = d.getVar('RUST_HOST_SYS') | ||
| 313 | |||
| 310 | # build tspec | 314 | # build tspec |
| 311 | tspec = {} | 315 | tspec = {} |
| 312 | tspec['llvm-target'] = d.getVar('RUST_TARGET_SYS', arch_abi) | 316 | tspec['llvm-target'] = llvm_target |
| 313 | tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi) | 317 | tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi) |
| 314 | tspec['max-atomic-width'] = int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi)) | 318 | tspec['max-atomic-width'] = int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi)) |
| 315 | tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi) | 319 | tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi) |
