From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Miguel Ojeda" <ojeda@kernel.org>
Cc: "Yury Norov" <yury.norov@gmail.com>,
rust-for-linux@vger.kernel.org, "Boqun Feng" <boqun@kernel.org>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Onur Özkan" <work@onurozkan.dev>,
"Antoni Boucher" <bouanto@zoho.com>
Subject: Re: [PATCH] rust: bitfield: always inline test conversions
Date: Sun, 09 Aug 2026 11:11:55 +0900 [thread overview]
Message-ID: <DKK1RS15UWJ7.1E99K1GA470LL@nvidia.com> (raw)
In-Reply-To: <20260807175012.142083-1-ojeda@kernel.org>
On Sat Aug 8, 2026 at 2:50 AM JST, Miguel Ojeda wrote:
> From: Antoni Boucher <bouanto@zoho.com>
>
> When using the Rust GCC backend (i.e. `rustc_codegen_gcc`), GCC does not
> inline enough these `Bounded::from_expr` calls:
>
> /usr/bin/x86_64-linux-gnu-ld.bfd: rust/kernel.o: in function `<kernel::num::bounded::Bounded<u16, 2> as core::convert::From<kernel::bitfield::tests::Priority>>::from':
> fake.c:(.text.unlikely+0x7be): undefined reference to `rust_build_error'
>
> /usr/bin/x86_64-linux-gnu-ld.bfd: rust/kernel.o: in function `<kernel::num::bounded::Bounded<u64, 4> as core::convert::From<kernel::bitfield::tests::MemoryType>>::from':
> fake.c:(.text.unlikely+0x90d): undefined reference to `rust_build_error'
>
> Thus, similar to commit bc197e24a3ac ("rust: num: bounded: Always inline
> fits_within and from_expr"), mark them as `#[inline(always)]`.
>
> Assisted-by: Claude:claude-opus-4-8
> Signed-off-by: Antoni Boucher <bouanto@zoho.com>
> [ Reworded to add the error and to follow our usual style and sent on
> behalf of Antoni, who found this during his work to support Rust for
> Linux with the GCC backend, i.e. with `rustc_codegen_gcc`.- Miguel ]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
There always are a couple of these going through the cracks, aren't
there. :)
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
next prev parent reply other threads:[~2026-08-09 2:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 17:50 [PATCH] rust: bitfield: always inline test conversions Miguel Ojeda
2026-08-07 18:11 ` Danilo Krummrich
2026-08-07 19:14 ` Gary Guo
2026-08-09 2:11 ` Alexandre Courbot [this message]
2026-08-10 5:01 ` Miguel Ojeda
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=DKK1RS15UWJ7.1E99K1GA470LL@nvidia.com \
--to=acourbot@nvidia.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=bouanto@zoho.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
--cc=yury.norov@gmail.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