summaryrefslogtreecommitdiff
path: root/scripts/Makefile.context-analysis
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2025-12-19 16:40:14 +0100
committerPeter Zijlstra <peterz@infradead.org>2026-01-05 16:43:33 +0100
commitc237f1ceeef56fa101c2b599a00307b3d690801a (patch)
tree701129d971cfdff17d35b2e90158b7554459c0a2 /scripts/Makefile.context-analysis
parente4588c25c9d122b5847b88e18b184404b6959160 (diff)
compiler-context-analysis: Introduce header suppressions
While we can opt in individual subsystems which add the required annotations, such subsystems inevitably include headers from other subsystems which may not yet have the right annotations, which then result in false positive warnings. Making compatible by adding annotations across all common headers currently requires an excessive number of __no_context_analysis annotations, or carefully analyzing non-trivial cases to add the correct annotations. While this is desirable long-term, providing an incremental path causes less churn and headaches for maintainers not yet interested in dealing with such warnings. Rather than clutter headers unnecessary and mandate all subsystem maintainers to keep their headers working with context analysis, suppress all -Wthread-safety warnings in headers. Explicitly opt in headers with context-enabled primitives. With this in place, we can start enabling the analysis on more complex subsystems in subsequent changes. Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20251219154418.3592607-26-elver@google.com
Diffstat (limited to 'scripts/Makefile.context-analysis')
-rw-r--r--scripts/Makefile.context-analysis4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/Makefile.context-analysis b/scripts/Makefile.context-analysis
index 70549f7fae1a..cd3bb49d3f09 100644
--- a/scripts/Makefile.context-analysis
+++ b/scripts/Makefile.context-analysis
@@ -4,4 +4,8 @@ context-analysis-cflags := -DWARN_CONTEXT_ANALYSIS \
-fexperimental-late-parse-attributes -Wthread-safety \
-Wthread-safety-pointer -Wthread-safety-beta
+ifndef CONFIG_WARN_CONTEXT_ANALYSIS_ALL
+context-analysis-cflags += --warning-suppression-mappings=$(srctree)/scripts/context-analysis-suppression.txt
+endif
+
export CFLAGS_CONTEXT_ANALYSIS := $(context-analysis-cflags)