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

Nathan Chancellor <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux,org.kernel.vger.linux-kbuild,org.kernel.vger.stable
Message-ID <20260817181212.GA1249844@ax162>
On Sun, Aug 16, 2026 at 03:32:33PM +0200, Miguel Ojeda wrote:
> Another possible alternative that Gary suggested is to turn the flags on
> globally for C, whether only when inline helpers are enabled or in all
> cases, but it may be intended that in C we expect not to generate the
> `unreachable`s.

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.

-- 
Cheers,
Nathan
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.