Re: [PATCH 2/4] scripts/Kconfig.toolchain: Do not dynamically probe '-fno-addrsig'
From: Nick Desaulniers
Date: Wed Nov 11 2026 - 11:58:34 EST
On Tue, Nov 10, 2026 at 9:43 PM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> '-fno-addrsig' avoids generating the LLVM specific .llvm_addrsig
> section. This flag is supported by all supported versions of clang, so
> convert CONFIG_CC_OPT_NO_ADDRSIG into a simple string symbol that
> depends on CC_IS_CLANG to clean up a dynamic probe that is unnecessary.
>
> Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Jordan, I know you were playing with -Wl,--icf=all recently. Looks
like the kernel does not use it; AFAIK, no one has ever tried. Even
-Wl,--icf=safe. Worth a shot to see if it boots. If we did, we'd
have to update this kconfig check (the linker flag is only supported
by LLD). Even if the result doesn't boot, it's perhaps worth doing
builds with BOTH to see what kind of savings are possible at the
limit.
> ---
> scripts/Kconfig.toolchain | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/Kconfig.toolchain b/scripts/Kconfig.toolchain
> index 666d44cc6ba8..570c5a31016c 100644
> --- a/scripts/Kconfig.toolchain
> +++ b/scripts/Kconfig.toolchain
> @@ -164,7 +164,8 @@ config CC_OPT_ZERO_INIT_PADDING_BITS
> def_string "$(cc-option-str,-fzero-init-padding-bits=all)"
>
> config CC_OPT_NO_ADDRSIG
> - def_string "$(cc-option-str,-fno-addrsig)"
> + # supported in clang, not needed for gcc
> + def_string "-fno-addrsig" if CC_IS_CLANG
>
> config CC_OPT_DIAGNOSTICS_SHOW_CONTEXT
> def_string "$(cc-option-str,-fdiagnostics-show-context=2)"
>
> --
> 2.56.0
>
--
Thanks,
~Nick Desaulniers