Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Cc: buildroot@buildroot.org, Christopher Obbard <obbardc@gmail.com>
Subject: Re: [Buildroot] [PATCH v2 1/2] package/rustc: add BR2_PACKAGE_HOST_RUSTC_TARGET_HAS_ATOMIC_64
Date: Sat, 5 Sep 2026 15:56:40 +0200	[thread overview]
Message-ID: <apwfhGIFSbDc-Bn7@windsurf> (raw)
In-Reply-To: <20260831-wip-obbardc-package-dtui-fix-armv5-v2-1-42eceaa12f55@oss.qualcomm.com>

On Mon, Aug 31, 2026 at 04:49:57PM +0100, Christopher Obbard via buildroot wrote:
> Rust does not provide 64-bit atomics on every target Buildroot can
> generate. rustc sets max_atomic_width = 32 for three of the 25 targets
> listed in RUST_TARGETS in utils/update-rust, so
> core::sync::atomic::AtomicU64 and AtomicI64 simply do not exist there:
> 
>   $ rustc --print cfg --target <target> | grep target_has_atomic
>   armv5te-unknown-linux-gnueabi     "16" "32" "8" "ptr"
>   armv5te-unknown-linux-musleabi    "16" "32" "8" "ptr"
>   powerpc-unknown-linux-gnu         "16" "32" "8" "ptr"
> 
> Every other supported target, including armv6, armv7, aarch64, all the
> x86 variants, riscv64, s390x, sparc64 and both 64-bit powerpcs, has
> them, e.g.:
> 
>   arm-unknown-linux-gnueabi         "16" "32" "64" "8" "ptr"
>   armv7-unknown-linux-gnueabihf     "16" "32" "64" "8" "ptr"
> 
> A crate that uses 64-bit atomics without a cfg(target_has_atomic = "64")
> guard therefore fails to build on those three targets with:
> 
>   error[E0432]: unresolved import `std::sync::atomic::AtomicU64`
>      |
>      |         atomic::{AtomicU64, AtomicU8, AtomicUsize, Ordering},
>      |                  ^^^^^^^^^ no `AtomicU64` in `sync::atomic`
> 
> This has been hit at least twice already: by package/dust, worked around
> in commit 3abc3b97bad9 ("package/dust: bump to version 1.1.2") by moving
> to a release in which upstream had added the guard and by package/dtui,
> which has no such release available and had to open-code the affected
> architectures instead.
> 
> It is likely to keep recurring: infra.basetest.BASIC_TOOLCHAIN_CONFIG
> builds with BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV5_EABI_GLIBC_STABLE, so
> every runtime test that does not override the toolchain compiles for
> armv5te, one of the three affected targets. That is exactly how the two
> failures above were found.
> 
> Add a hidden symbol so packages can express this constraint once, rather
> than each open-coding BR2_ARM_CPU_ARMV5 and BR2_powerpc and needing to
> update whenever rust gains or changes a target.
> 
> Note that armv5te and 32-bit powerpc are only supported by rust for
> glibc and musl, so the uclibc variants of those architectures are
> already excluded by BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS.
> 
> Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>

Thanks, applied after renaming the option name, as suggested by
Romain.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-09-05 13:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 15:49 [Buildroot] [PATCH v2 0/2] package/dtui: fix build failure on targets without 64-bit atomics Christopher Obbard via buildroot
2026-08-31 15:49 ` [Buildroot] [PATCH v2 1/2] package/rustc: add BR2_PACKAGE_HOST_RUSTC_TARGET_HAS_ATOMIC_64 Christopher Obbard via buildroot
2026-09-02 21:24   ` Romain Naour via buildroot
2026-09-02 21:31     ` Romain Naour via buildroot
2026-09-05 13:56   ` Thomas Petazzoni via buildroot [this message]
2026-08-31 15:49 ` [Buildroot] [PATCH v2 2/2] package/dtui: require 64-bit atomic support Christopher Obbard via buildroot
2026-09-02 21:39   ` Romain Naour via buildroot
2026-09-05 13:58   ` Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=apwfhGIFSbDc-Bn7@windsurf \
    --to=buildroot@buildroot.org \
    --cc=chris.obbard@oss.qualcomm.com \
    --cc=obbardc@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox