Re: [PATCH 12/23] kbuild: avoid re-running compiler and linker probes

From: David Laight

Date: Fri Sep 11 2026 - 17:02:02 EST


On Fri, 11 Sep 2026 19:24:50 +0100
"Lorenzo Stoakes (ARM)" <ljs@xxxxxxxxxx> wrote:

> On Fri, Sep 11, 2026 at 08:17:57PM +0200, Nicolas Schier wrote:
> > On Fri, Sep 11, 2026 at 06:33:33PM +0100, David Laight wrote:
> > > On Thu, 10 Sep 2026 17:42:35 +0200
> > > Nicolas Schier <n.schier@xxxxxxxxx> wrote:
> > >
> > > ...
> > > > Yes, skimming through the patch, I thought about that, too. Moving more
> > > > cc option checks to Kconfig will make building out-of-tree kmods with a
> > > > different compiler more dangerous. Maybe we will have to make the
> > > > warning in Makefile's prepare (external kmods) target a bit louder.
> > >
> > > One problem is that distributions have a nasty habit of shipping kernels
> > > that are compiled with a different compiler version to they actually
> > > ship as a compiler.
> > > In some cases the versions are clearly the same - but the version
> > > strings differ.
> >
> > yeah, I guess you hit the mark.
>
> I mean this is a problem that already exists for any flags already specified in
> Kconfig.
>
> Out-of-tree modules are historically something that we don't go to great lengths
> to support and haven't historically worried about breaking, either.
>
> I'm sure distros can find ways around this if a problem were to arise. But I
> don't think it's something to worry about all that much.
>
> I expect a _lot_ of these, in any case, would only require the compilers to be
> within a fair few major versions of one another anyway.

That is true at the moment when the version of the compiler being used
is checked.
For instance it doesn't matter if modules are compiled without 'asm goto
with output'.
But if you putting the options in Kconfig the compiler being used better
not be older - or it might not support the options.
It isn't too bad if the compile fails, but some are silent.

IIRC it is Ubuntu that has different version strings for the same compiler
version, and Oracle that ships kernels compiled with much newer compilers
that they install by default.

David

>
> >
> > --
> > Nicolas
>
> --
> Cheers, Lorenzo