* [PATCH 1/2] scripts/Kconfig.toolchain: Drop compiler symbols from dependencies
2026-10-07 15:22 [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain Nathan Chancellor
@ 2026-10-07 15:22 ` Nathan Chancellor
2026-10-09 6:54 ` Kees Cook
2026-10-07 15:22 ` [PATCH 2/2] kconfig: Improve ergonomics around disabling warnings with cc-option Nathan Chancellor
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Nathan Chancellor @ 2026-10-07 15:22 UTC (permalink / raw)
To: Nathan Chancellor, Nicolas Schier, Julian Braha
Cc: Lorenzo Stoakes, Kees Cook, linux-kbuild, linux-kernel
Commit 454e00cf8ee5 ("kbuild: avoid re-running compiler and linker
probes") moved many cc-option calls from the main Makefile into Kconfig.
In the process, code such as
ifdef CONFIG_CC_IS_GCC
KBUILD_CFLAGS += $(call cc-option,-foo)
endif
was converted into Kconfig as
config CC_OPT_FOO
def_string "$(cc-option-str,-foo)" if CC_IS_GCC
The 'if CC_IS_GCC' is generally unnecessary because it does not prevent
the cc-option-str call from running (which is the primary reason the
ifdef guards exists in the Makefile), as cc-option-str and the like are
run before Kconfig even parses the dependency. It only impacts the
symbol's visibility, which does not really matter in the general case,
so remove these dependencies.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
scripts/Kconfig.toolchain | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/Kconfig.toolchain b/scripts/Kconfig.toolchain
index d708a175fe48..c9a1692e6149 100644
--- a/scripts/Kconfig.toolchain
+++ b/scripts/Kconfig.toolchain
@@ -161,10 +161,10 @@ config CC_OPT_STRICT_FLEX_ARRAYS
# gcc-10 renamed --param=allow-store-data-races=0 to -fno-allow-store-data-races
config CC_OPT_ALLOW_STORE_DATA_RACES_PARAM
- def_string "$(cc-option-str,--param=allow-store-data-races=0)" if CC_IS_GCC
+ def_string "$(cc-option-str,--param=allow-store-data-races=0)"
config CC_OPT_NO_ALLOW_STORE_DATA_RACES
- def_string "$(cc-option-str,-fno-allow-store-data-races)" if CC_IS_GCC
+ def_string "$(cc-option-str,-fno-allow-store-data-races)"
config CC_HAS_MNOP_MCOUNT
def_bool $(cc-option,-mnop-mcount)
@@ -183,13 +183,13 @@ config CC_OPT_WNO_ADDRESS_OF_PACKED_MEMBER
def_string "-Wno-address-of-packed-member" if $(cc-option,-Waddress-of-packed-member)
config CC_OPT_WNO_FORMAT_OVERFLOW_NON_KPRINTF
- def_string "-Wno-format-overflow-non-kprintf" if CC_IS_CLANG && $(cc-option,-Wformat-overflow-non-kprintf)
+ def_string "-Wno-format-overflow-non-kprintf" if $(cc-option,-Wformat-overflow-non-kprintf)
config CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF
- def_string "-Wno-format-truncation-non-kprintf" if CC_IS_CLANG && $(cc-option,-Wformat-truncation-non-kprintf)
+ def_string "-Wno-format-truncation-non-kprintf" if $(cc-option,-Wformat-truncation-non-kprintf)
config CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE
- def_string "-Wno-default-const-init-unsafe" if CC_IS_CLANG && $(cc-option,-Wdefault-const-init-unsafe)
+ def_string "-Wno-default-const-init-unsafe" if $(cc-option,-Wdefault-const-init-unsafe)
config CC_OPT_WNO_DANGLING_POINTER
def_string "-Wno-dangling-pointer" if $(cc-option,-Wdangling-pointer)
--
2.56.0
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/2] scripts/Kconfig.toolchain: Drop compiler symbols from dependencies
2026-10-07 15:22 ` [PATCH 1/2] scripts/Kconfig.toolchain: Drop compiler symbols from dependencies Nathan Chancellor
@ 2026-10-09 6:54 ` Kees Cook
2026-10-09 8:41 ` Nicolas Schier
0 siblings, 1 reply; 12+ messages in thread
From: Kees Cook @ 2026-10-09 6:54 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Nicolas Schier, Julian Braha, Lorenzo Stoakes, linux-kbuild,
linux-kernel
On Wed, Oct 07, 2026 at 05:22:21PM +0200, Nathan Chancellor wrote:
> Commit 454e00cf8ee5 ("kbuild: avoid re-running compiler and linker
> probes") moved many cc-option calls from the main Makefile into Kconfig.
> In the process, code such as
>
> ifdef CONFIG_CC_IS_GCC
> KBUILD_CFLAGS += $(call cc-option,-foo)
> endif
>
> was converted into Kconfig as
>
> config CC_OPT_FOO
> def_string "$(cc-option-str,-foo)" if CC_IS_GCC
>
> The 'if CC_IS_GCC' is generally unnecessary because it does not prevent
> the cc-option-str call from running (which is the primary reason the
> ifdef guards exists in the Makefile), as cc-option-str and the like are
> run before Kconfig even parses the dependency. It only impacts the
> symbol's visibility, which does not really matter in the general case,
> so remove these dependencies.
Hm, does this mean we're running more probes at start-up now compared to
before (since the Makefile idef would have suppressed them)?
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Regardless:
Reviewed-by: Kees Cook <kees@kernel.org>
--
Kees Cook
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/2] scripts/Kconfig.toolchain: Drop compiler symbols from dependencies
2026-10-09 6:54 ` Kees Cook
@ 2026-10-09 8:41 ` Nicolas Schier
2026-10-09 19:22 ` Nathan Chancellor
0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Schier @ 2026-10-09 8:41 UTC (permalink / raw)
To: Kees Cook
Cc: Nathan Chancellor, Julian Braha, Lorenzo Stoakes, linux-kbuild,
linux-kernel
On Thu, Oct 08, 2026 at 11:54:30PM -0700, Kees Cook wrote:
> On Wed, Oct 07, 2026 at 05:22:21PM +0200, Nathan Chancellor wrote:
> > Commit 454e00cf8ee5 ("kbuild: avoid re-running compiler and linker
> > probes") moved many cc-option calls from the main Makefile into Kconfig.
> > In the process, code such as
> >
> > ifdef CONFIG_CC_IS_GCC
> > KBUILD_CFLAGS += $(call cc-option,-foo)
> > endif
> >
> > was converted into Kconfig as
> >
> > config CC_OPT_FOO
> > def_string "$(cc-option-str,-foo)" if CC_IS_GCC
> >
> > The 'if CC_IS_GCC' is generally unnecessary because it does not prevent
> > the cc-option-str call from running (which is the primary reason the
> > ifdef guards exists in the Makefile), as cc-option-str and the like are
> > run before Kconfig even parses the dependency. It only impacts the
> > symbol's visibility, which does not really matter in the general case,
> > so remove these dependencies.
>
> Hm, does this mean we're running more probes at start-up now compared to
> before (since the Makefile idef would have suppressed them)?
Yes, probing compiler flags via Kconfig results in more
useless probing calls. That's unfortunate, but the move to Kconfig look
still reasonable to me due.
--
Nicolas
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/2] scripts/Kconfig.toolchain: Drop compiler symbols from dependencies
2026-10-09 8:41 ` Nicolas Schier
@ 2026-10-09 19:22 ` Nathan Chancellor
0 siblings, 0 replies; 12+ messages in thread
From: Nathan Chancellor @ 2026-10-09 19:22 UTC (permalink / raw)
To: Nicolas Schier, Kees Cook, Julian Braha, Lorenzo Stoakes,
linux-kbuild, linux-kernel
On Fri, Oct 09, 2026 at 10:41:17AM +0200, Nicolas Schier wrote:
> On Thu, Oct 08, 2026 at 11:54:30PM -0700, Kees Cook wrote:
> > Hm, does this mean we're running more probes at start-up now compared to
> > before (since the Makefile idef would have suppressed them)?
>
> Yes, probing compiler flags via Kconfig results in more
> useless probing calls. That's unfortunate, but the move to Kconfig look
> still reasonable to me due.
Right, we probe in more cases when we have to but the trade off is that
we shouldn't have to in the common case of incremental compiles with the
same toolchain.
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] kconfig: Improve ergonomics around disabling warnings with cc-option
2026-10-07 15:22 [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain Nathan Chancellor
2026-10-07 15:22 ` [PATCH 1/2] scripts/Kconfig.toolchain: Drop compiler symbols from dependencies Nathan Chancellor
@ 2026-10-07 15:22 ` Nathan Chancellor
2026-10-09 6:54 ` Kees Cook
2026-10-07 16:48 ` [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain Nicolas Schier
2026-10-09 20:27 ` Nathan Chancellor
3 siblings, 1 reply; 12+ messages in thread
From: Nathan Chancellor @ 2026-10-07 15:22 UTC (permalink / raw)
To: Nathan Chancellor, Nicolas Schier, Julian Braha
Cc: Lorenzo Stoakes, Kees Cook, linux-kbuild, linux-kernel
This is essentially a port of commit 550ccb178de2 ("Make 'cc-option'
work correctly for the -Wno-xyzzy pattern") to scripts/Kconfig.include,
which simplifies the definition of many of the newly added CC_OPT_WNO_
symbols in scripts/Kconfig.toolchain and matches cc-option's behavior in
Kbuild.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
scripts/Kconfig.include | 2 +-
scripts/Kconfig.toolchain | 18 +++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
index 622d21e6953f..a7d9201acfcc 100644
--- a/scripts/Kconfig.include
+++ b/scripts/Kconfig.include
@@ -26,7 +26,7 @@ failure = $(if-success,$(1),n,y)
# $(cc-probe,<flag>)
# The command $(cc-option) and $(cc-option-str) test <flag> with. Not meant
# to be called directly; use one of those two instead.
-cc-probe = trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$/tmp.o
+cc-probe = trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(CC) -Werror $(CLANG_FLAGS) $(shell,echo $(1) | sed "s;^-Wno-;-W;") -c -x c /dev/null -o .tmp_$$/tmp.o
# $(cc-option,<flag>)
# Return y if the compiler supports <flag>, n otherwise
diff --git a/scripts/Kconfig.toolchain b/scripts/Kconfig.toolchain
index c9a1692e6149..254393d4f98a 100644
--- a/scripts/Kconfig.toolchain
+++ b/scripts/Kconfig.toolchain
@@ -180,19 +180,19 @@ config LD_OPT_NO_WARN_RWX_SEGMENTS
def_string "$(ld-option-str,--no-warn-rwx-segments)"
config CC_OPT_WNO_ADDRESS_OF_PACKED_MEMBER
- def_string "-Wno-address-of-packed-member" if $(cc-option,-Waddress-of-packed-member)
+ def_string "$(cc-option-str,-Wno-address-of-packed-member)"
config CC_OPT_WNO_FORMAT_OVERFLOW_NON_KPRINTF
- def_string "-Wno-format-overflow-non-kprintf" if $(cc-option,-Wformat-overflow-non-kprintf)
+ def_string "$(cc-option-str,-Wno-format-overflow-non-kprintf)"
config CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF
- def_string "-Wno-format-truncation-non-kprintf" if $(cc-option,-Wformat-truncation-non-kprintf)
+ def_string "$(cc-option-str,-Wno-format-truncation-non-kprintf)"
config CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE
- def_string "-Wno-default-const-init-unsafe" if $(cc-option,-Wdefault-const-init-unsafe)
+ def_string "$(cc-option-str,-Wno-default-const-init-unsafe)"
config CC_OPT_WNO_DANGLING_POINTER
- def_string "-Wno-dangling-pointer" if $(cc-option,-Wdangling-pointer)
+ def_string "$(cc-option-str,-Wno-dangling-pointer)"
config CC_OPT_WVLA_LARGER_THAN
def_string "$(cc-option-str,-Wvla-larger-than=1)"
@@ -201,7 +201,7 @@ config CC_HAS_WSTRINGOP_OVERFLOW
def_bool $(cc-option,-Wstringop-overflow)
config CC_OPT_WNO_UNTERMINATED_STRING_INITIALIZATION
- def_string "-Wno-unterminated-string-initialization" if $(cc-option,-Wunterminated-string-initialization)
+ def_string "$(cc-option-str,-Wno-unterminated-string-initialization)"
config CC_OPT_WERROR_DESIGNATED_INIT
def_string "$(cc-option-str,-Werror=designated-init)"
@@ -210,13 +210,13 @@ config CC_OPT_WENUM_CONVERSION
def_string "$(cc-option-str,-Wenum-conversion)"
config CC_OPT_WNO_PACKED_NOT_ALIGNED
- def_string "-Wno-packed-not-aligned" if $(cc-option,-Wpacked-not-aligned)
+ def_string "$(cc-option-str,-Wno-packed-not-aligned)"
config CC_OPT_WNO_FORMAT_OVERFLOW
- def_string "-Wno-format-overflow" if $(cc-option,-Wformat-overflow)
+ def_string "$(cc-option-str,-Wno-format-overflow)"
config CC_OPT_WNO_STRINGOP_TRUNCATION
- def_string "-Wno-stringop-truncation" if $(cc-option,-Wstringop-truncation)
+ def_string "$(cc-option-str,-Wno-stringop-truncation)"
config CC_HAS_COUNTED_BY
bool
--
2.56.0
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 2/2] kconfig: Improve ergonomics around disabling warnings with cc-option
2026-10-07 15:22 ` [PATCH 2/2] kconfig: Improve ergonomics around disabling warnings with cc-option Nathan Chancellor
@ 2026-10-09 6:54 ` Kees Cook
0 siblings, 0 replies; 12+ messages in thread
From: Kees Cook @ 2026-10-09 6:54 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Nicolas Schier, Julian Braha, Lorenzo Stoakes, linux-kbuild,
linux-kernel
On Wed, Oct 07, 2026 at 05:22:22PM +0200, Nathan Chancellor wrote:
> This is essentially a port of commit 550ccb178de2 ("Make 'cc-option'
> work correctly for the -Wno-xyzzy pattern") to scripts/Kconfig.include,
> which simplifies the definition of many of the newly added CC_OPT_WNO_
> symbols in scripts/Kconfig.toolchain and matches cc-option's behavior in
> Kbuild.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> scripts/Kconfig.include | 2 +-
> scripts/Kconfig.toolchain | 18 +++++++++---------
> 2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
> index 622d21e6953f..a7d9201acfcc 100644
> --- a/scripts/Kconfig.include
> +++ b/scripts/Kconfig.include
> @@ -26,7 +26,7 @@ failure = $(if-success,$(1),n,y)
> # $(cc-probe,<flag>)
> # The command $(cc-option) and $(cc-option-str) test <flag> with. Not meant
> # to be called directly; use one of those two instead.
> -cc-probe = trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$/tmp.o
> +cc-probe = trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(CC) -Werror $(CLANG_FLAGS) $(shell,echo $(1) | sed "s;^-Wno-;-W;") -c -x c /dev/null -o .tmp_$$/tmp.o
Nice! Yeah, good cleanup.
Reviewed-by: Kees Cook <kees@kernel.org>
--
Kees Cook
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain
2026-10-07 15:22 [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain Nathan Chancellor
2026-10-07 15:22 ` [PATCH 1/2] scripts/Kconfig.toolchain: Drop compiler symbols from dependencies Nathan Chancellor
2026-10-07 15:22 ` [PATCH 2/2] kconfig: Improve ergonomics around disabling warnings with cc-option Nathan Chancellor
@ 2026-10-07 16:48 ` Nicolas Schier
2026-10-09 6:56 ` Kees Cook
2026-10-09 20:27 ` Nathan Chancellor
3 siblings, 1 reply; 12+ messages in thread
From: Nicolas Schier @ 2026-10-07 16:48 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Nicolas Schier, Julian Braha, Lorenzo Stoakes, Kees Cook,
linux-kbuild, linux-kernel
> Hi all,
>
> This series includes a cleanup to scripts/Kconfig.toolchain around
> dependencies (the first patch) and improves the ergonomics of using
> cc-option and cc-option-str in Kconfig to disable warnings, making
> Kconfig and Kbuild more unified in their behavior (the second patch).
>
> ---
> Nathan Chancellor (2):
> scripts/Kconfig.toolchain: Drop compiler symbols from dependencies
> kconfig: Improve ergonomics around disabling warnings with cc-option
>
> scripts/Kconfig.include | 2 +-
> scripts/Kconfig.toolchain | 22 +++++++++++-----------
> 2 files changed, 12 insertions(+), 12 deletions(-)
Thanks, straight-forward!
When I look into the resulting .config, I'd wish, these empty string
kconfig symbols could be unset, e.g.
# CONFIG_CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF is not set
# CONFIG_CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE is not set
CONFIG_CC_OPT_WNO_DANGLING_POINTER="-Wno-dangling-pointer"
CONFIG_CC_OPT_WVLA_LARGER_THAN="-Wvla-larger-than=1"
CONFIG_CC_HAS_WSTRINGOP_OVERFLOW=y
instead of the current:
CONFIG_CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF=""
CONFIG_CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE=""
CONFIG_CC_OPT_WNO_DANGLING_POINTER="-Wno-dangling-pointer"
CONFIG_CC_OPT_WVLA_LARGER_THAN="-Wvla-larger-than=1"
CONFIG_CC_HAS_WSTRINGOP_OVERFLOW=y
but that would make things unneccessary more complicated, right now.
Reviewed-by: Nicolas Schier <nsc@kernel.org>
--
Nicolas
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain
2026-10-07 16:48 ` [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain Nicolas Schier
@ 2026-10-09 6:56 ` Kees Cook
2026-10-09 19:14 ` Nathan Chancellor
0 siblings, 1 reply; 12+ messages in thread
From: Kees Cook @ 2026-10-09 6:56 UTC (permalink / raw)
To: Nicolas Schier
Cc: Nathan Chancellor, Julian Braha, Lorenzo Stoakes, linux-kbuild,
linux-kernel
On Wed, Oct 07, 2026 at 06:48:40PM +0200, Nicolas Schier wrote:
> When I look into the resulting .config, I'd wish, these empty string
> kconfig symbols could be unset, e.g.
>
> # CONFIG_CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF is not set
> # CONFIG_CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE is not set
> CONFIG_CC_OPT_WNO_DANGLING_POINTER="-Wno-dangling-pointer"
> CONFIG_CC_OPT_WVLA_LARGER_THAN="-Wvla-larger-than=1"
> CONFIG_CC_HAS_WSTRINGOP_OVERFLOW=y
>
> instead of the current:
>
> CONFIG_CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF=""
> CONFIG_CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE=""
> CONFIG_CC_OPT_WNO_DANGLING_POINTER="-Wno-dangling-pointer"
> CONFIG_CC_OPT_WVLA_LARGER_THAN="-Wvla-larger-than=1"
> CONFIG_CC_HAS_WSTRINGOP_OVERFLOW=y
>
> but that would make things unneccessary more complicated, right now.
Yeah, it may be worth documenting somewhere that "CONFIG_CC_OPT_..."
will have empty strings, and if someone wants to test _availability_ of
a feature, they need to still create and use CONFIG_CC_HAS_... ?
--
Kees Cook
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain
2026-10-09 6:56 ` Kees Cook
@ 2026-10-09 19:14 ` Nathan Chancellor
2026-10-09 19:43 ` Nicolas Schier
0 siblings, 1 reply; 12+ messages in thread
From: Nathan Chancellor @ 2026-10-09 19:14 UTC (permalink / raw)
To: Kees Cook
Cc: Nicolas Schier, Julian Braha, Lorenzo Stoakes, linux-kbuild,
linux-kernel
On Thu, Oct 08, 2026 at 11:56:13PM -0700, Kees Cook wrote:
> On Wed, Oct 07, 2026 at 06:48:40PM +0200, Nicolas Schier wrote:
> > When I look into the resulting .config, I'd wish, these empty string
> > kconfig symbols could be unset, e.g.
> >
> > # CONFIG_CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF is not set
> > # CONFIG_CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE is not set
> > CONFIG_CC_OPT_WNO_DANGLING_POINTER="-Wno-dangling-pointer"
> > CONFIG_CC_OPT_WVLA_LARGER_THAN="-Wvla-larger-than=1"
> > CONFIG_CC_HAS_WSTRINGOP_OVERFLOW=y
> >
> > instead of the current:
> >
> > CONFIG_CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF=""
> > CONFIG_CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE=""
> > CONFIG_CC_OPT_WNO_DANGLING_POINTER="-Wno-dangling-pointer"
> > CONFIG_CC_OPT_WVLA_LARGER_THAN="-Wvla-larger-than=1"
> > CONFIG_CC_HAS_WSTRINGOP_OVERFLOW=y
> >
> > but that would make things unneccessary more complicated, right now.
>
> Yeah, it may be worth documenting somewhere that "CONFIG_CC_OPT_..."
> will have empty strings, and if someone wants to test _availability_ of
> a feature, they need to still create and use CONFIG_CC_HAS_... ?
I don't mind writing something up but where would be the best place to
stick that? In scripts/Kconfig.toolchain or somewhere else?
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain
2026-10-09 19:14 ` Nathan Chancellor
@ 2026-10-09 19:43 ` Nicolas Schier
0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Schier @ 2026-10-09 19:43 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Kees Cook, Julian Braha, Lorenzo Stoakes, linux-kbuild, linux-kernel
On Fri, Oct 09, 2026 at 09:14:02PM +0200, Nathan Chancellor wrote:
> On Thu, Oct 08, 2026 at 11:56:13PM -0700, Kees Cook wrote:
> > On Wed, Oct 07, 2026 at 06:48:40PM +0200, Nicolas Schier wrote:
> > > When I look into the resulting .config, I'd wish, these empty string
> > > kconfig symbols could be unset, e.g.
> > >
> > > # CONFIG_CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF is not set
> > > # CONFIG_CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE is not set
> > > CONFIG_CC_OPT_WNO_DANGLING_POINTER="-Wno-dangling-pointer"
> > > CONFIG_CC_OPT_WVLA_LARGER_THAN="-Wvla-larger-than=1"
> > > CONFIG_CC_HAS_WSTRINGOP_OVERFLOW=y
> > >
> > > instead of the current:
> > >
> > > CONFIG_CC_OPT_WNO_FORMAT_TRUNCATION_NON_KPRINTF=""
> > > CONFIG_CC_OPT_WNO_DEFAULT_CONST_INIT_UNSAFE=""
> > > CONFIG_CC_OPT_WNO_DANGLING_POINTER="-Wno-dangling-pointer"
> > > CONFIG_CC_OPT_WVLA_LARGER_THAN="-Wvla-larger-than=1"
> > > CONFIG_CC_HAS_WSTRINGOP_OVERFLOW=y
> > >
> > > but that would make things unneccessary more complicated, right now.
> >
> > Yeah, it may be worth documenting somewhere that "CONFIG_CC_OPT_..."
> > will have empty strings, and if someone wants to test _availability_ of
> > a feature, they need to still create and use CONFIG_CC_HAS_... ?
>
> I don't mind writing something up but where would be the best place to
> stick that? In scripts/Kconfig.toolchain or somewhere else?
Yes, I think scripts/Kconfig.toolchain is a good location (at least for
a pointer); but Documentation/kbuild/kconfig-language.rst should
probably also mention the new default way for compiler flag probing.
--
Nicolas
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain
2026-10-07 15:22 [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain Nathan Chancellor
` (2 preceding siblings ...)
2026-10-07 16:48 ` [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain Nicolas Schier
@ 2026-10-09 20:27 ` Nathan Chancellor
3 siblings, 0 replies; 12+ messages in thread
From: Nathan Chancellor @ 2026-10-09 20:27 UTC (permalink / raw)
To: Nicolas Schier, Julian Braha, Nathan Chancellor
Cc: Lorenzo Stoakes, Kees Cook, linux-kbuild, linux-kernel
On Wed, 07 Oct 2026 17:22:20 +0200, Nathan Chancellor wrote:
> Initial ergonomic improvements to scripts/Kconfig.toolchain
>
> Hi all,
>
> This series includes a cleanup to scripts/Kconfig.toolchain around
> dependencies (the first patch) and improves the ergonomics of using
> cc-option and cc-option-str in Kconfig to disable warnings, making
> Kconfig and Kbuild more unified in their behavior (the second patch).
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-next-speedups
Thanks!
[1/2] scripts/Kconfig.toolchain: Drop compiler symbols from dependencies
https://git.kernel.org/kbuild/c/c4c24fd63a8d5
[2/2] kconfig: Improve ergonomics around disabling warnings with cc-option
https://git.kernel.org/kbuild/c/7202c08793a24
Please look out for regression or issue reports or other follow up
comments, as they may result in the patch/series getting dropped or
reverted. Patches applied to an "unstable" branch are accepted pending
wider testing in -next and any post-commit review; they will generally
be moved to the main branch in a week if no issues are found.
Best regards,
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 12+ messages in thread