rust: handle softfp fpu

With TARGET_FPU set to "softfp" stdlib-rs fails with:
error: Error loading target specification: ARM targets must specify their float ABI. Run `rustc --print target-list` for a list of built-in targets

This fpu type is set for example for arm in file
meta/conf/machine/include/arm/feature-arm-vfp.inc
when TUNE_FEATURES do not contain "callconvention-hard",
e.g. when using tune
DEFAULTTUNE = "cortexa8"

(From OE-Core rev: 4d50135cb902037380915966ecc97399d32e9f74)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Peter Marko
2025-08-21 14:26:55 +02:00
committed by Richard Purdie
parent d53b664bc2
commit 87a25268ba

View File

@@ -409,7 +409,7 @@ def rust_gen_target(d, thing, wd, arch):
if features != "":
tspec['features'] = features
fpu = d.getVar('TARGET_FPU')
if fpu == "soft":
if fpu in ["soft", "softfp"]:
tspec['llvm-floatabi'] = "soft"
elif fpu == "hard":
tspec['llvm-floatabi'] = "hard"