Re: [PATCH 12/23] kbuild: avoid re-running compiler and linker probes
From: Nathan Chancellor
Date: Thu Sep 10 2026 - 00:24:24 EST
> 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?
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?
--
Cheers,
Nathan