Re: [PATCH] rust: cfi: disable function merging if CFI is enabled

From: Sami Tolvanen

Date: Thu Aug 20 2026 - 19:43:45 EST


On Thu, Aug 20, 2026 at 9:06 AM Gary Guo <gary@xxxxxxxxxxx> wrote:
>
> On Thu Aug 20, 2026 at 2:57 PM BST, Gary Guo wrote:
> > From: Gary Guo <gary@xxxxxxxxxxx>
> >
> > In Rust doc tests, there is a dummy `__module_firmware_test_init` function
> > generated by the example in `module_firmware!`'s documentation, which just
> > returns zero. Many other documentation generates function that produces
> > zero. LKP test robot reports a `Flags::zeroed` instance; my local
> > reproduction has a `Bounded::new::<0>`.
> >
> > LLVM's MergeFunctionsPass incorrectly merge functions with the same KCFI
>
> This should read "with different KCFI type" (obviously).

Also the comment in the Makefile. With both instances fixed:

Reviewed-by: Sami Tolvanen <samitolvanen@xxxxxxxxxx>

The LLVM fix itself is trivial, and it looks like a pull request for
it already exists. I assume we'll want to drop this flag for fixed
LLVM versions when they're available.

Sami