[tip: locking/urgent] lib/Kconfig.debug: Require a release version of LLVM 22 for context analysis

From: tip-bot2 for Nathan Chancellor

Date: Wed Feb 25 2026 - 10:31:39 EST


The following commit has been merged into the locking/urgent branch of tip:

Commit-ID: ab6088e7a95943af3452b20e3b96caaaef3eeebd
Gitweb: https://git.kernel.org/tip/ab6088e7a95943af3452b20e3b96caaaef3eeebd
Author: Nathan Chancellor <nathan@xxxxxxxxxx>
AuthorDate: Tue, 24 Feb 2026 16:16:30 -07:00
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Wed, 25 Feb 2026 15:36:02 +01:00

lib/Kconfig.debug: Require a release version of LLVM 22 for context analysis

Using a prerelease version as a minimum supported version for
CONFIG_WARN_CONTEXT_ANALYSIS was reasonable to do while LLVM 22 was the
development version so that people could immediately build from main and
start testing and validating this in their own code. However, it can be
problematic when using prerelease versions of LLVM 22, such as Android
clang 22.0.1 (the current android mainline compiler) or when bisecting
LLVM between llvmorg-22-init and llvmorg-23-init, to build the kernel,
as all compiler fixes for the context analysis may not be present,
potentially resulting in warnings that can easily turn into errors.

Now that LLVM 22 is released as 22.1.0, upgrade the check to require at
least this version to ensure that a user's toolchain actually has all
the changes needed for a smooth experience with context analysis.

Fixes: 3269701cb256 ("compiler-context-analysis: Add infrastructure for Context Analysis with Clang")
Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Acked-by: Marco Elver <elver@xxxxxxxxxx>
Link: https://patch.msgid.link/20260224-bump-clang-ver-context-analysis-v1-1-16cc7a90a040@xxxxxxxxxx
---
lib/Kconfig.debug | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 4e2dfbb..8e2b858 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -630,7 +630,7 @@ config DEBUG_FORCE_WEAK_PER_CPU

config WARN_CONTEXT_ANALYSIS
bool "Compiler context-analysis warnings"
- depends on CC_IS_CLANG && CLANG_VERSION >= 220000
+ depends on CC_IS_CLANG && CLANG_VERSION >= 220100
# Branch profiling re-defines "if", which messes with the compiler's
# ability to analyze __cond_acquires(..), resulting in false positives.
depends on !TRACE_BRANCH_PROFILING
@@ -641,7 +641,7 @@ config WARN_CONTEXT_ANALYSIS
and releasing user-definable "context locks".

Clang's name of the feature is "Thread Safety Analysis". Requires
- Clang 22 or later.
+ Clang 22.1.0 or later.

Produces warnings by default. Select CONFIG_WERROR if you wish to
turn these warnings into errors.