mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>, Nicolas Schier <nsc@kernel.org>
Cc: Julian Braha <julianbraha@gmail.com>,
	 Nick Desaulniers <ndesaulniers@google.com>,
	 Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	 Arnd Bergmann <arnd@arndb.de>, Kees Cook <kees@kernel.org>,
	 linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	 llvm@lists.linux.dev
Subject: [PATCH 3/4] scripts/Kconfig.toolchain: Clean up '-fno-allow-store-data-races' handling
Date: Tue, 10 Nov 2026 23:42:42 -0600	[thread overview]
Message-ID: <20261110-kconfig-toolchain-updates-v1-3-6d4fb636290e@kernel.org> (raw)
In-Reply-To: <20261110-kconfig-toolchain-updates-v1-0-6d4fb636290e@kernel.org>

Commit 454e00cf8ee5 ("kbuild: avoid re-running compiler and linker
probes") added two separate symbols for the "no allow store data races"
GCC flags. These flags serve the same purpose, so combine them using the
second argument of cc-option-str to handle the old value. To avoid
setting the second value of cc-option-str for clang, add a GCC
dependency to the symbol. This will eventually allow the cc-option-str
call to be eliminated when GCC 10 is the minimum version for the kernel.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 Makefile                  | 5 -----
 scripts/Kconfig.toolchain | 7 ++-----
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index d73f2bbd3b93..fb2490faa8d1 100644
--- a/Makefile
+++ b/Makefile
@@ -949,12 +949,7 @@ KBUILD_RUSTFLAGS += -Cdebug-assertions=$(if $(CONFIG_RUST_DEBUG_ASSERTIONS),y,n)
 KBUILD_RUSTFLAGS += -Coverflow-checks=$(if $(CONFIG_RUST_OVERFLOW_CHECKS),y,n)
 
 # Tell gcc to never replace conditional load with a non-conditional one
-ifdef CONFIG_CC_IS_GCC
-# gcc-10 renamed --param=allow-store-data-races=0 to
-# -fno-allow-store-data-races.
-KBUILD_CFLAGS	+= $(CONFIG_CC_OPT_ALLOW_STORE_DATA_RACES_PARAM)
 KBUILD_CFLAGS	+= $(CONFIG_CC_OPT_NO_ALLOW_STORE_DATA_RACES)
-endif
 
 ifdef CONFIG_READABLE_ASM
 # Disable optimizations that make assembler listings hard to read.
diff --git a/scripts/Kconfig.toolchain b/scripts/Kconfig.toolchain
index 570c5a31016c..26a62b15e9ab 100644
--- a/scripts/Kconfig.toolchain
+++ b/scripts/Kconfig.toolchain
@@ -176,12 +176,9 @@ config CC_OPT_DIAGNOSTICS_SHOW_INLINING_CHAIN
 config CC_OPT_STRICT_FLEX_ARRAYS
 	def_string "$(cc-option-str,-fstrict-flex-arrays=3)"
 
-# 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)"
-
 config CC_OPT_NO_ALLOW_STORE_DATA_RACES
-	def_string "$(cc-option-str,-fno-allow-store-data-races)"
+	# gcc-10 renamed --param=allow-store-data-races=0 to -fno-allow-store-data-races. not needed for clang
+	def_string "$(cc-option-str,-fno-allow-store-data-races,--param=allow-store-data-races=0)" if CC_IS_GCC
 
 config CC_HAS_MNOP_MCOUNT
 	def_bool $(cc-option,-mnop-mcount)

-- 
2.56.0


  parent reply	other threads:[~2026-11-11  5:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  5:42 [PATCH 0/4] scripts/Kconfig.toolchain: Document minimum supported versions for dynamic checks Nathan Chancellor
2026-11-11  5:42 ` [PATCH 1/4] scripts/Kconfig.toolchain: Remove CONFIG_CC_HAS_NO_PROFILE_FN_ATTR Nathan Chancellor
2026-11-11  5:42 ` [PATCH 2/4] scripts/Kconfig.toolchain: Do not dynamically probe '-fno-addrsig' Nathan Chancellor
2026-11-11  5:42 ` Nathan Chancellor [this message]
2026-11-11  5:42 ` [PATCH 4/4] scripts/Kconfig.toolchain: Document minimum supported versions for dynamic checks Nathan Chancellor

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=20261110-kconfig-toolchain-updates-v1-3-6d4fb636290e@kernel.org \
    --to=nathan@kernel.org \
    --cc=arnd@arndb.de \
    --cc=julianbraha@gmail.com \
    --cc=justinstitt@google.com \
    --cc=kees@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=ndesaulniers@google.com \
    --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®