Re: [PATCH 12/23] kbuild: avoid re-running compiler and linker probes
From: Lorenzo Stoakes (ARM)
Date: Fri Sep 11 2026 - 06:35:13 EST
On Wed, Sep 09, 2026 at 09:19:12PM -0700, Nathan Chancellor wrote:
> > diff --git a/init/Kconfig b/init/Kconfig
> > index 8583d9f06c52..3c92c87254a3 100644
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -144,6 +144,44 @@ config CC_HAS_ASSUME
> > config CC_HAS_NO_PROFILE_FN_ATTR
> > def_bool $(success,echo '__attribute__((no_profile_instrument_function)) int x();' | $(CC) -x c - -c -o /dev/null -Werror)
> >
> > +config CC_HAS_ZERO_INIT_PADDING_BITS
> > + def_bool $(cc-option,-fzero-init-padding-bits=all)
> > +
> > +config CC_HAS_NO_STACK_CLASH_PROTECTION
> > + def_bool $(cc-option,-fno-stack-clash-protection)
> > +
> > +config CC_HAS_NO_ADDRSIG
> > + def_bool $(cc-option,-fno-addrsig)
>
> I am generally in favor of this proposal since I think these checks
> should be cached by Kconfig where possible to clear up running them
> twice. That said, I wonder if we should pick a better dumping ground for
> these checks other than init/Kconfig. Maybe init/Kconfig.tools or
> scripts/Kconfig.tools or something?
Yeah makes sense to separate them out so they're not all clumped with unrelated
stuff.
It feels like init is the right place, having actual substantive Kconfig entries
in scripts/ feels a bit weird.
I can add an extra patch to move existing entries over before adding these in in
the next patch?
>
> I also worry about backsliding and growing cc-option checks. Should we
> update the documentation to state that it is preferrable for these
> checks to live in Kconfig so that they can be properly cached?
Yeah makes sense. I can add a patch to update the docs too?
>
> --
> Cheers,
> Nathan
>
--
Cheers, Lorenzo