Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Chuck Wolber <chuck@wolber.net>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Julian Braha <julianbraha@gmail.com>,
	linux-kbuild@vger.kernel.org, Marco Elver <elver@google.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@kernel.org>
Subject: [PATCH v3 17/19] kconfig: add CC_HAS_CONDITION_COVERAGE for MC/DC support detection
Date: Tue, 24 Nov 2026 21:06:01 -0500	[thread overview]
Message-ID: <20261125020603.3934222-18-sashal@kernel.org> (raw)
In-Reply-To: <20261125020603.3934222-1-sashal@kernel.org>

Add a Kconfig symbol to detect compiler support for -fcondition-coverage,
which enables MC/DC (Modified Condition/Decision Coverage) instrumentation.
This flag is available since GCC 14.

Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 scripts/Kconfig.toolchain | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/Kconfig.toolchain b/scripts/Kconfig.toolchain
index 8571cd16a2edd..661db9e7a89ee 100644
--- a/scripts/Kconfig.toolchain
+++ b/scripts/Kconfig.toolchain
@@ -193,6 +193,11 @@ config CC_OPT_WNO_PGO_COVERAGE
 	# gcc: not supported
 	def_string "$(cc-option-str,-Wno-pgo-coverage)"
 
+config CC_HAS_CONDITION_COVERAGE
+	# gcc-14: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=08a52331803f66a4aaeaedd278436ca8eac57b50
+	# clang: not supported
+	def_bool $(cc-option,-fcondition-coverage)
+
 config LD_OPT_FORCE_GROUP_ALLOCATION
 	def_string "$(ld-option-str,--force-group-allocation)"
 
-- 
2.53.0


  parent reply	other threads:[~2026-11-25  2:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  2:05 [PATCH v3 00/19] Unify code coverage and add Clang source-based coverage with MC/DC Sasha Levin
2026-11-25  2:05 ` [PATCH v3 02/19] kbuild: unify static coverage instrumentation as COVERAGE_PROFILE Sasha Levin
2026-11-25  2:05 ` [PATCH v3 13/19] coverage: add Clang's source-based code coverage Sasha Levin
2026-11-25  2:05 ` [PATCH v3 15/19] coverage: add MC/DC measurement Sasha Levin
2026-11-25  2:06 ` Sasha Levin [this message]
2026-11-25  2:06 ` [PATCH v3 18/19] gcov: add MC/DC condition coverage support Sasha Levin

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=20261125020603.3934222-18-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=chuck@wolber.net \
    --cc=elver@google.com \
    --cc=jpoimboe@kernel.org \
    --cc=julianbraha@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@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