Re: [PATCH 2/2] kbuild: rust: keep Rust objects out of Clang LTO with inline helpers

Miguel Ojeda <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux,org.kernel.vger.linux-kbuild,org.kernel.vger.stable
Message-ID <CANiq72mAy93vnGZJ+wfwh2epJqSpOhF6XBK7K9XWC6mVEcPT8g@mail.gmail.com>
On Mon, Aug 17, 2026 at 8:12 PM Nathan Chancellor <[email protected]> wrote:
>
> I am not sure we can use '-mllvm -trap-unreachable' for C code, as that
> would mess with manually inserted calls to __builtin_unreachable(). It
> has come up before:
>
>   https://lore.kernel.org/CAHk-=wgPCbZv0JgqoNWMOO+p=N772YW16xYk_pmb1GU7aeuPFA@mail.gmail.com/
>
> It is possible the '-no-trap-after-noreturn' avoids that particular
> issue but I still think the "compiler inserted" vs. "user inserted"
> distinction that Linus comments on is likely still potentially relevant.

Thanks Nathan -- yeah, that is the kind of "intended" thing I was
wondering about in my note above... It would be nice if there could be
a distinction between the developer-provided ones and the ones that
get inserted for other reasons.

Ok, I picked these up to fix the immediate issue, since they only
affect the experimental mode and only the Rust side. If there is a
better approach available in the future, then great.

Cheers,
Miguel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.