Re: [PATCH] rust: cfi: disable function merging if CFI is enabled
From: Alice Ryhl
Date: Tue Nov 17 2026 - 15:58:36 EST
On Fri, Aug 21, 2026 at 11:20:18AM +0200, Miguel Ojeda wrote:
> On Fri, Aug 21, 2026 at 1:43 AM Sami Tolvanen <samitolvanen@xxxxxxxxxx> wrote:
> >
> > 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.
>
> I will link it in the commit message when I pick it up soon -- already
> did in https://github.com/Rust-for-Linux/linux/issues/1132.
>
> I also added the `-Z` flag to https://github.com/Rust-for-Linux/linux/issues/2.
>
> The `-Zmerge-functions` flag is internal but has been there since Rust
> 1.34.0 in upstream commit:
>
> b91d211b4030 ("Add a target option "merge-functions" taking values
> in ("disabled", "trampolines", or "aliases (the default)) to allow
> targets to opt out of the MergeFunctions LLVM pass. Also add a
> corresponding -Z option with the same name and values.")
>
> so that should be fine, but I will ping upstream Rust so that they are
> aware we are using it.
>
> And, yeah, agreed, we probably should remove the flag conditionally
> later on, to confirm the bug is gone etc.
Function merging should also be disabled with gendwarfksyms. It causes
faux::Registration::as_raw() and Page::as_ptr() to get merged, which
incorrectly causes the former to get the CRC of the latter.
Alice