From patchwork Tue Feb 3 11:09:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: c.schlegel@televic.com X-Patchwork-Id: 80345 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66695E6E80E for ; Tue, 3 Feb 2026 11:09:35 +0000 (UTC) Subject: [meta-lts-mixins][scarthgap/rust][PATCH] To: yocto-patches@lists.yoctoproject.org From: c.schlegel@televic.com X-Originating-Location: Sint-Martens-Latem, Flanders, BE (84.199.255.188) X-Originating-Platform: Linux Firefox 147 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 03 Feb 2026 03:09:30 -0800 Message-ID: List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 03 Feb 2026 11:09:35 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3174 Hi, We are using meta-lts-mixins for Rust support in our Yocto image and SDK. Our devices use arm hf. When looking at the resulted toolchain json, we get cat ./x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/rustlib/armv7-poky-linux-gnueabihf.json { "llvm-target": "armv7-poky-linux-gnueabihf", "data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", "max-atomic-width": 64, "target-pointer-width": "32", "target-c-int-width": 32, "target-endian": "little", "arch": "arm", "os": "linux", "env": "gnu", "vendor": "unknown", "target-family": "unix", "linker": "arm-poky-linux-gnueabi-gcc", "cpu": "generic", "features": "+vfp2,+neon,+v7,+thumb2,+thumb-mode,+a9", "llvm-floatabi": "hard", "dynamic-linking": true, "executables": true, "linker-is-gnu": true, "linker-flavor": "gcc", "has-rpath": true, "has-thread-local": true, "position-independent-executables": true, "panic-strategy": "unwind" } With this it builds, but when running on target there is a linkage issue and resulting in a file not found error when running. After investigating, we think that the gcc flag -mfloat-abi=hard is missing. root@tracs-a9:/tmp# ./test_app -sh: ./test_app: No such file or directory root@tracs-a9:/tmp# ldd test_app linux-vdso.so.1 (0xbeca9000) libc.so.6 => /lib/libc.so.6 (0xb6de0000) /lib/ld-linux.so.3 => /lib/ld-linux-armhf.so.3 (0xb6f5a000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6db0000) When adding this, things are fine. ... "llvm-floatabi": "hard", "pre-link-args": { "gcc": [ "-mfloat-abi=hard" ] }, "dynamic-linking": true, ... root@tracs-a9:/tmp# ./test_app Guess the number! Please input your guess. 0 You guessed: 0 Too small! Please input your guess. ^C root@tracs-a9:/tmp# ldd ./test_app linux-vdso.so.1 (0xbed96000) libc.so.6 => /lib/libc.so.6 (0xb6d80000) /lib/ld-linux-armhf.so.3 (0xb6ef8000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6d50000) root@tracs-a9:/tmp# Attached you find a patch for including this flag in the rust-target-config.bbclass if armhf is detected. Patch ids identical for both Kirkstone/Scarthgap Let me know your thoughts! First time I submit a patch here, so if anything I should do different let me know! Kind regards, Clemens Schlegel From eaa96e20a509a350685dc89448c1ee9617a41edd Mon Sep 17 00:00:00 2001 From: Clemens Schlegel Date: Wed, 7 Jan 2026 14:03:23 +0100 Subject: [PATCH] rust-target-config.bbclass: set gcc compile flag in case hf is needed --- classes-recipe/rust-target-config.bbclass | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes-recipe/rust-target-config.bbclass b/classes-recipe/rust-target-config.bbclass index 0f1e2e1..9f2aa59 100644 --- a/classes-recipe/rust-target-config.bbclass +++ b/classes-recipe/rust-target-config.bbclass @@ -401,6 +401,10 @@ def rust_gen_target(d, thing, wd, arch): tspec['llvm-floatabi'] = "soft" elif fpu == "hard": tspec['llvm-floatabi'] = "hard" + if "arm" in tspec['llvm-target']: + tspec['pre-link-args'] = { + "gcc": ["-mfloat-abi=hard"] + } tspec['default-uwtable'] = True tspec['dynamic-linking'] = True tspec['executables'] = True -- 2.47.3