Re: [PATCH] kbuild: rust: disable function merging unconditionally

From: Gary Guo

Date: Wed Nov 18 2026 - 08:16:03 EST


On Wed Nov 18, 2026 at 1:09 PM GMT, Alice Ryhl wrote:
> Function merging causes various different issues:
>
> * For CONFIG_CFI there's an LLVM bug causing functions with different
> CFI hashes to get merged. This can lead to crashes at runtime.
> * For gendwarfksyms it causes functions with different CRCs to get
> merged. This leads to broken MODVERSIONS information if the function
> changes in the future so that it can no longer be merged.
> * Wrong backtraces when a crash occurs in a merged function.
> * Possibly also issues with pahole/BTF as the merged function's debug
> info is lost.
>
> These issues are new to Rust because in clang, function merging is off
> by default, so these things have never come up before. Because of this,
> turn this option off for all configurations.
>
> Link: https://lore.kernel.org/all/avy_9SPRaPSKD8b4@xxxxxxxxxx/
> Fixes: ac61506bf2d1 ("rust: Use gendwarfksyms + extended modversions for CONFIG_MODVERSIONS")
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)