From: Nathan Chancellor <nathan@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>,
Julian Braha <julianbraha@gmail.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, Kees Cook <kees@kernel.org>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] scripts/Kconfig.toolchain: Drop compiler symbols from dependencies
Date: Wed, 07 Oct 2026 17:22:21 +0200 [thread overview]
Message-ID: <20261007-scripts-kconfig-toolchain-improvements-v1-1-1e524178da11@kernel.org> (raw)
In-Reply-To: <20261007-scripts-kconfig-toolchain-improvements-v1-0-1e524178da11@kernel.org>
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
next prev parent reply other threads:[~2026-10-07 15:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 15:22 [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain Nathan Chancellor
2026-10-07 15:22 ` Nathan Chancellor [this message]
2026-10-07 15:22 ` [PATCH 2/2] kconfig: Improve ergonomics around disabling warnings with cc-option Nathan Chancellor
2026-10-07 16:48 ` [PATCH 0/2] Initial ergonomic improvements to scripts/Kconfig.toolchain Nicolas Schier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261007-scripts-kconfig-toolchain-improvements-v1-1-1e524178da11@kernel.org \
--to=nathan@kernel.org \
--cc=julianbraha@gmail.com \
--cc=kees@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=nsc@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®