Re: [PATCH v2] PCI: rcar-host: Add OF Kconfig dependency to avoid objtool no-cfi warning

From: Peter Zijlstra

Date: Tue Oct 14 2025 - 15:47:35 EST


On Tue, Oct 14, 2025 at 02:13:30PM -0500, Bjorn Helgaas wrote:

> Ugh. This might be the best solution, but it's a bit problematic
> without a hint about why "depends on OF" is here. Theoretically there
> are stubs for everything to make COMPILE_TEST work, so I think we're
> about to drop all the dependencies on OF.

Its those stubs are exactly the problem.

> This dependency to avoid a no-cfi warning looks like the kind of thing
> that could someday go away if the tools get smarter. Maybe we can add
> a Kconfig comment here, but I don't really know enough to write one.
> Something like this?

Its not a CFI warning per-se, the compiler is hitting known UB
(unconditional NULL deref) and is currently emitting a NULL pointer
indirect call, but given how aggressive clang has been on encountering
UB it might just stop code-gen entirely and generate fall-through
warnings (been there done that).

Smarter compiler here is only going to make this worse.