Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

compiler-context-analysis: Add infrastructure for Context Analysis with Clang

Context Analysis is a language extension, which enables statically
checking that required contexts are active (or inactive), by acquiring
and releasing user-definable "context locks". An obvious application is
lock-safety checking for the kernel's various synchronization primitives
(each of which represents a "context lock"), and checking that locking
rules are not violated.

Clang originally called the feature "Thread Safety Analysis" [1]. This
was later changed and the feature became more flexible, gaining the
ability to define custom "capabilities". Its foundations can be found in
"Capability Systems" [2], used to specify the permissibility of
operations to depend on some "capability" being held (or not held).

Because the feature is not just able to express "capabilities" related
to synchronization primitives, and "capability" is already overloaded in
the kernel, the naming chosen for the kernel departs from Clang's
"Thread Safety" and "capability" nomenclature; we refer to the feature
as "Context Analysis" to avoid confusion. The internal implementation
still makes references to Clang's terminology in a few places, such as
`-Wthread-safety` being the warning option that also still appears in
diagnostic messages.

[1] https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
[2] https://www.cs.cornell.edu/talc/papers/capabilities.pdf

See more details in the kernel-doc documentation added in this and
subsequent changes.

Clang version 22+ is required.

[peterz: disable the thing for __CHECKER__ builds]
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251219154418.3592607-3-elver@google.com

authored by

Marco Elver and committed by
Peter Zijlstra
3269701c de15feca

+505 -7
+1
Makefile
··· 1118 1118 include-$(CONFIG_KSTACK_ERASE) += scripts/Makefile.kstack_erase 1119 1119 include-$(CONFIG_AUTOFDO_CLANG) += scripts/Makefile.autofdo 1120 1120 include-$(CONFIG_PROPELLER_CLANG) += scripts/Makefile.propeller 1121 + include-$(CONFIG_WARN_CONTEXT_ANALYSIS) += scripts/Makefile.context-analysis 1121 1122 include-$(CONFIG_GCC_PLUGINS) += scripts/Makefile.gcc-plugins 1122 1123 1123 1124 include $(addprefix $(srctree)/, $(include-y))
+457 -7
include/linux/compiler-context-analysis.h
··· 6 6 #ifndef _LINUX_COMPILER_CONTEXT_ANALYSIS_H 7 7 #define _LINUX_COMPILER_CONTEXT_ANALYSIS_H 8 8 9 + #if defined(WARN_CONTEXT_ANALYSIS) && !defined(__CHECKER__) 10 + 11 + /* 12 + * These attributes define new context lock (Clang: capability) types. 13 + * Internal only. 14 + */ 15 + # define __ctx_lock_type(name) __attribute__((capability(#name))) 16 + # define __reentrant_ctx_lock __attribute__((reentrant_capability)) 17 + # define __acquires_ctx_lock(...) __attribute__((acquire_capability(__VA_ARGS__))) 18 + # define __acquires_shared_ctx_lock(...) __attribute__((acquire_shared_capability(__VA_ARGS__))) 19 + # define __try_acquires_ctx_lock(ret, var) __attribute__((try_acquire_capability(ret, var))) 20 + # define __try_acquires_shared_ctx_lock(ret, var) __attribute__((try_acquire_shared_capability(ret, var))) 21 + # define __releases_ctx_lock(...) __attribute__((release_capability(__VA_ARGS__))) 22 + # define __releases_shared_ctx_lock(...) __attribute__((release_shared_capability(__VA_ARGS__))) 23 + # define __returns_ctx_lock(var) __attribute__((lock_returned(var))) 24 + 25 + /* 26 + * The below are used to annotate code being checked. Internal only. 27 + */ 28 + # define __excludes_ctx_lock(...) __attribute__((locks_excluded(__VA_ARGS__))) 29 + # define __requires_ctx_lock(...) __attribute__((requires_capability(__VA_ARGS__))) 30 + # define __requires_shared_ctx_lock(...) __attribute__((requires_shared_capability(__VA_ARGS__))) 31 + 32 + /* 33 + * The "assert_capability" attribute is a bit confusingly named. It does not 34 + * generate a check. Instead, it tells the analysis to *assume* the capability 35 + * is held. This is used for: 36 + * 37 + * 1. Augmenting runtime assertions, that can then help with patterns beyond the 38 + * compiler's static reasoning abilities. 39 + * 40 + * 2. Initialization of context locks, so we can access guarded variables right 41 + * after initialization (nothing else should access the same object yet). 42 + */ 43 + # define __assumes_ctx_lock(...) __attribute__((assert_capability(__VA_ARGS__))) 44 + # define __assumes_shared_ctx_lock(...) __attribute__((assert_shared_capability(__VA_ARGS__))) 45 + 46 + /** 47 + * __guarded_by - struct member and globals attribute, declares variable 48 + * only accessible within active context 49 + * 50 + * Declares that the struct member or global variable is only accessible within 51 + * the context entered by the given context lock. Read operations on the data 52 + * require shared access, while write operations require exclusive access. 53 + * 54 + * .. code-block:: c 55 + * 56 + * struct some_state { 57 + * spinlock_t lock; 58 + * long counter __guarded_by(&lock); 59 + * }; 60 + */ 61 + # define __guarded_by(...) __attribute__((guarded_by(__VA_ARGS__))) 62 + 63 + /** 64 + * __pt_guarded_by - struct member and globals attribute, declares pointed-to 65 + * data only accessible within active context 66 + * 67 + * Declares that the data pointed to by the struct member pointer or global 68 + * pointer is only accessible within the context entered by the given context 69 + * lock. Read operations on the data require shared access, while write 70 + * operations require exclusive access. 71 + * 72 + * .. code-block:: c 73 + * 74 + * struct some_state { 75 + * spinlock_t lock; 76 + * long *counter __pt_guarded_by(&lock); 77 + * }; 78 + */ 79 + # define __pt_guarded_by(...) __attribute__((pt_guarded_by(__VA_ARGS__))) 80 + 81 + /** 82 + * context_lock_struct() - declare or define a context lock struct 83 + * @name: struct name 84 + * 85 + * Helper to declare or define a struct type that is also a context lock. 86 + * 87 + * .. code-block:: c 88 + * 89 + * context_lock_struct(my_handle) { 90 + * int foo; 91 + * long bar; 92 + * }; 93 + * 94 + * struct some_state { 95 + * ... 96 + * }; 97 + * // ... declared elsewhere ... 98 + * context_lock_struct(some_state); 99 + * 100 + * Note: The implementation defines several helper functions that can acquire 101 + * and release the context lock. 102 + */ 103 + # define context_lock_struct(name, ...) \ 104 + struct __ctx_lock_type(name) __VA_ARGS__ name; \ 105 + static __always_inline void __acquire_ctx_lock(const struct name *var) \ 106 + __attribute__((overloadable)) __no_context_analysis __acquires_ctx_lock(var) { } \ 107 + static __always_inline void __acquire_shared_ctx_lock(const struct name *var) \ 108 + __attribute__((overloadable)) __no_context_analysis __acquires_shared_ctx_lock(var) { } \ 109 + static __always_inline bool __try_acquire_ctx_lock(const struct name *var, bool ret) \ 110 + __attribute__((overloadable)) __no_context_analysis __try_acquires_ctx_lock(1, var) \ 111 + { return ret; } \ 112 + static __always_inline bool __try_acquire_shared_ctx_lock(const struct name *var, bool ret) \ 113 + __attribute__((overloadable)) __no_context_analysis __try_acquires_shared_ctx_lock(1, var) \ 114 + { return ret; } \ 115 + static __always_inline void __release_ctx_lock(const struct name *var) \ 116 + __attribute__((overloadable)) __no_context_analysis __releases_ctx_lock(var) { } \ 117 + static __always_inline void __release_shared_ctx_lock(const struct name *var) \ 118 + __attribute__((overloadable)) __no_context_analysis __releases_shared_ctx_lock(var) { } \ 119 + static __always_inline void __assume_ctx_lock(const struct name *var) \ 120 + __attribute__((overloadable)) __assumes_ctx_lock(var) { } \ 121 + static __always_inline void __assume_shared_ctx_lock(const struct name *var) \ 122 + __attribute__((overloadable)) __assumes_shared_ctx_lock(var) { } \ 123 + struct name 124 + 125 + /** 126 + * disable_context_analysis() - disables context analysis 127 + * 128 + * Disables context analysis. Must be paired with a later 129 + * enable_context_analysis(). 130 + */ 131 + # define disable_context_analysis() \ 132 + __diag_push(); \ 133 + __diag_ignore_all("-Wunknown-warning-option", "") \ 134 + __diag_ignore_all("-Wthread-safety", "") \ 135 + __diag_ignore_all("-Wthread-safety-pointer", "") 136 + 137 + /** 138 + * enable_context_analysis() - re-enables context analysis 139 + * 140 + * Re-enables context analysis. Must be paired with a prior 141 + * disable_context_analysis(). 142 + */ 143 + # define enable_context_analysis() __diag_pop() 144 + 145 + /** 146 + * __no_context_analysis - function attribute, disables context analysis 147 + * 148 + * Function attribute denoting that context analysis is disabled for the 149 + * whole function. Prefer use of `context_unsafe()` where possible. 150 + */ 151 + # define __no_context_analysis __attribute__((no_thread_safety_analysis)) 152 + 153 + #else /* !WARN_CONTEXT_ANALYSIS */ 154 + 155 + # define __ctx_lock_type(name) 156 + # define __reentrant_ctx_lock 157 + # define __acquires_ctx_lock(...) 158 + # define __acquires_shared_ctx_lock(...) 159 + # define __try_acquires_ctx_lock(ret, var) 160 + # define __try_acquires_shared_ctx_lock(ret, var) 161 + # define __releases_ctx_lock(...) 162 + # define __releases_shared_ctx_lock(...) 163 + # define __assumes_ctx_lock(...) 164 + # define __assumes_shared_ctx_lock(...) 165 + # define __returns_ctx_lock(var) 166 + # define __guarded_by(...) 167 + # define __pt_guarded_by(...) 168 + # define __excludes_ctx_lock(...) 169 + # define __requires_ctx_lock(...) 170 + # define __requires_shared_ctx_lock(...) 171 + # define __acquire_ctx_lock(var) do { } while (0) 172 + # define __acquire_shared_ctx_lock(var) do { } while (0) 173 + # define __try_acquire_ctx_lock(var, ret) (ret) 174 + # define __try_acquire_shared_ctx_lock(var, ret) (ret) 175 + # define __release_ctx_lock(var) do { } while (0) 176 + # define __release_shared_ctx_lock(var) do { } while (0) 177 + # define __assume_ctx_lock(var) do { (void)(var); } while (0) 178 + # define __assume_shared_ctx_lock(var) do { (void)(var); } while (0) 179 + # define context_lock_struct(name, ...) struct __VA_ARGS__ name 180 + # define disable_context_analysis() 181 + # define enable_context_analysis() 182 + # define __no_context_analysis 183 + 184 + #endif /* WARN_CONTEXT_ANALYSIS */ 185 + 186 + /** 187 + * context_unsafe() - disable context checking for contained code 188 + * 189 + * Disables context checking for contained statements or expression. 190 + * 191 + * .. code-block:: c 192 + * 193 + * struct some_data { 194 + * spinlock_t lock; 195 + * int counter __guarded_by(&lock); 196 + * }; 197 + * 198 + * int foo(struct some_data *d) 199 + * { 200 + * // ... 201 + * // other code that is still checked ... 202 + * // ... 203 + * return context_unsafe(d->counter); 204 + * } 205 + */ 206 + #define context_unsafe(...) \ 207 + ({ \ 208 + disable_context_analysis(); \ 209 + __VA_ARGS__; \ 210 + enable_context_analysis() \ 211 + }) 212 + 213 + /** 214 + * __context_unsafe() - function attribute, disable context checking 215 + * @comment: comment explaining why opt-out is safe 216 + * 217 + * Function attribute denoting that context analysis is disabled for the 218 + * whole function. Forces adding an inline comment as argument. 219 + */ 220 + #define __context_unsafe(comment) __no_context_analysis 221 + 222 + /** 223 + * context_unsafe_alias() - helper to insert a context lock "alias barrier" 224 + * @p: pointer aliasing a context lock or object containing context locks 225 + * 226 + * No-op function that acts as a "context lock alias barrier", where the 227 + * analysis rightfully detects that we're switching aliases, but the switch is 228 + * considered safe but beyond the analysis reasoning abilities. 229 + * 230 + * This should be inserted before the first use of such an alias. 231 + * 232 + * Implementation Note: The compiler ignores aliases that may be reassigned but 233 + * their value cannot be determined (e.g. when passing a non-const pointer to an 234 + * alias as a function argument). 235 + */ 236 + #define context_unsafe_alias(p) _context_unsafe_alias((void **)&(p)) 237 + static inline void _context_unsafe_alias(void **p) { } 238 + 239 + /** 240 + * token_context_lock() - declare an abstract global context lock instance 241 + * @name: token context lock name 242 + * 243 + * Helper that declares an abstract global context lock instance @name, but not 244 + * backed by a real data structure (linker error if accidentally referenced). 245 + * The type name is `__ctx_lock_@name`. 246 + */ 247 + #define token_context_lock(name, ...) \ 248 + context_lock_struct(__ctx_lock_##name, ##__VA_ARGS__) {}; \ 249 + extern const struct __ctx_lock_##name *name 250 + 251 + /** 252 + * token_context_lock_instance() - declare another instance of a global context lock 253 + * @ctx: token context lock previously declared with token_context_lock() 254 + * @name: name of additional global context lock instance 255 + * 256 + * Helper that declares an additional instance @name of the same token context 257 + * lock class @ctx. This is helpful where multiple related token contexts are 258 + * declared, to allow using the same underlying type (`__ctx_lock_@ctx`) as 259 + * function arguments. 260 + */ 261 + #define token_context_lock_instance(ctx, name) \ 262 + extern const struct __ctx_lock_##ctx *name 263 + 264 + /* 265 + * Common keywords for static context analysis. Both Clang's "capability 266 + * analysis" and Sparse's "context tracking" are currently supported. 267 + */ 9 268 #ifdef __CHECKER__ 10 269 11 270 /* Sparse context/lock checking support. */ 12 271 # define __must_hold(x) __attribute__((context(x,1,1))) 272 + # define __must_not_hold(x) 13 273 # define __acquires(x) __attribute__((context(x,0,1))) 14 274 # define __cond_acquires(x) __attribute__((context(x,0,-1))) 15 275 # define __releases(x) __attribute__((context(x,1,0))) 16 276 # define __acquire(x) __context__(x,1) 17 277 # define __release(x) __context__(x,-1) 18 278 # define __cond_lock(x, c) ((c) ? ({ __acquire(x); 1; }) : 0) 279 + /* For Sparse, there's no distinction between exclusive and shared locks. */ 280 + # define __must_hold_shared __must_hold 281 + # define __acquires_shared __acquires 282 + # define __cond_acquires_shared __cond_acquires 283 + # define __releases_shared __releases 284 + # define __acquire_shared __acquire 285 + # define __release_shared __release 286 + # define __cond_lock_shared __cond_acquire 19 287 20 288 #else /* !__CHECKER__ */ 21 289 22 - # define __must_hold(x) 23 - # define __acquires(x) 24 - # define __cond_acquires(x) 25 - # define __releases(x) 26 - # define __acquire(x) (void)0 27 - # define __release(x) (void)0 28 - # define __cond_lock(x, c) (c) 290 + /** 291 + * __must_hold() - function attribute, caller must hold exclusive context lock 292 + * @x: context lock instance pointer 293 + * 294 + * Function attribute declaring that the caller must hold the given context 295 + * lock instance @x exclusively. 296 + */ 297 + # define __must_hold(x) __requires_ctx_lock(x) 298 + 299 + /** 300 + * __must_not_hold() - function attribute, caller must not hold context lock 301 + * @x: context lock instance pointer 302 + * 303 + * Function attribute declaring that the caller must not hold the given context 304 + * lock instance @x. 305 + */ 306 + # define __must_not_hold(x) __excludes_ctx_lock(x) 307 + 308 + /** 309 + * __acquires() - function attribute, function acquires context lock exclusively 310 + * @x: context lock instance pointer 311 + * 312 + * Function attribute declaring that the function acquires the given context 313 + * lock instance @x exclusively, but does not release it. 314 + */ 315 + # define __acquires(x) __acquires_ctx_lock(x) 316 + 317 + /** 318 + * __cond_acquires() - function attribute, function conditionally 319 + * acquires a context lock exclusively 320 + * @x: context lock instance pointer 321 + * 322 + * Function attribute declaring that the function conditionally acquires the 323 + * given context lock instance @x exclusively, but does not release it. 324 + */ 325 + # define __cond_acquires(x) __try_acquires_ctx_lock(1, x) 326 + 327 + /** 328 + * __releases() - function attribute, function releases a context lock exclusively 329 + * @x: context lock instance pointer 330 + * 331 + * Function attribute declaring that the function releases the given context 332 + * lock instance @x exclusively. The associated context must be active on 333 + * entry. 334 + */ 335 + # define __releases(x) __releases_ctx_lock(x) 336 + 337 + /** 338 + * __acquire() - function to acquire context lock exclusively 339 + * @x: context lock instance pointer 340 + * 341 + * No-op function that acquires the given context lock instance @x exclusively. 342 + */ 343 + # define __acquire(x) __acquire_ctx_lock(x) 344 + 345 + /** 346 + * __release() - function to release context lock exclusively 347 + * @x: context lock instance pointer 348 + * 349 + * No-op function that releases the given context lock instance @x. 350 + */ 351 + # define __release(x) __release_ctx_lock(x) 352 + 353 + /** 354 + * __cond_lock() - function that conditionally acquires a context lock 355 + * exclusively 356 + * @x: context lock instance pinter 357 + * @c: boolean expression 358 + * 359 + * Return: result of @c 360 + * 361 + * No-op function that conditionally acquires context lock instance @x 362 + * exclusively, if the boolean expression @c is true. The result of @c is the 363 + * return value; for example: 364 + * 365 + * .. code-block:: c 366 + * 367 + * #define spin_trylock(l) __cond_lock(&lock, _spin_trylock(&lock)) 368 + */ 369 + # define __cond_lock(x, c) __try_acquire_ctx_lock(x, c) 370 + 371 + /** 372 + * __must_hold_shared() - function attribute, caller must hold shared context lock 373 + * @x: context lock instance pointer 374 + * 375 + * Function attribute declaring that the caller must hold the given context 376 + * lock instance @x with shared access. 377 + */ 378 + # define __must_hold_shared(x) __requires_shared_ctx_lock(x) 379 + 380 + /** 381 + * __acquires_shared() - function attribute, function acquires context lock shared 382 + * @x: context lock instance pointer 383 + * 384 + * Function attribute declaring that the function acquires the given 385 + * context lock instance @x with shared access, but does not release it. 386 + */ 387 + # define __acquires_shared(x) __acquires_shared_ctx_lock(x) 388 + 389 + /** 390 + * __cond_acquires_shared() - function attribute, function conditionally 391 + * acquires a context lock shared 392 + * @x: context lock instance pointer 393 + * 394 + * Function attribute declaring that the function conditionally acquires the 395 + * given context lock instance @x with shared access, but does not release it. 396 + */ 397 + # define __cond_acquires_shared(x) __try_acquires_shared_ctx_lock(1, x) 398 + 399 + /** 400 + * __releases_shared() - function attribute, function releases a 401 + * context lock shared 402 + * @x: context lock instance pointer 403 + * 404 + * Function attribute declaring that the function releases the given context 405 + * lock instance @x with shared access. The associated context must be active 406 + * on entry. 407 + */ 408 + # define __releases_shared(x) __releases_shared_ctx_lock(x) 409 + 410 + /** 411 + * __acquire_shared() - function to acquire context lock shared 412 + * @x: context lock instance pointer 413 + * 414 + * No-op function that acquires the given context lock instance @x with shared 415 + * access. 416 + */ 417 + # define __acquire_shared(x) __acquire_shared_ctx_lock(x) 418 + 419 + /** 420 + * __release_shared() - function to release context lock shared 421 + * @x: context lock instance pointer 422 + * 423 + * No-op function that releases the given context lock instance @x with shared 424 + * access. 425 + */ 426 + # define __release_shared(x) __release_shared_ctx_lock(x) 427 + 428 + /** 429 + * __cond_lock_shared() - function that conditionally acquires a context lock shared 430 + * @x: context lock instance pinter 431 + * @c: boolean expression 432 + * 433 + * Return: result of @c 434 + * 435 + * No-op function that conditionally acquires context lock instance @x with 436 + * shared access, if the boolean expression @c is true. The result of @c is the 437 + * return value. 438 + */ 439 + # define __cond_lock_shared(x, c) __try_acquire_shared_ctx_lock(x, c) 29 440 30 441 #endif /* __CHECKER__ */ 442 + 443 + /** 444 + * __acquire_ret() - helper to acquire context lock of return value 445 + * @call: call expression 446 + * @ret_expr: acquire expression that uses __ret 447 + */ 448 + #define __acquire_ret(call, ret_expr) \ 449 + ({ \ 450 + __auto_type __ret = call; \ 451 + __acquire(ret_expr); \ 452 + __ret; \ 453 + }) 454 + 455 + /** 456 + * __acquire_shared_ret() - helper to acquire context lock shared of return value 457 + * @call: call expression 458 + * @ret_expr: acquire shared expression that uses __ret 459 + */ 460 + #define __acquire_shared_ret(call, ret_expr) \ 461 + ({ \ 462 + __auto_type __ret = call; \ 463 + __acquire_shared(ret_expr); \ 464 + __ret; \ 465 + }) 466 + 467 + /* 468 + * Attributes to mark functions returning acquired context locks. 469 + * 470 + * This is purely cosmetic to help readability, and should be used with the 471 + * above macros as follows: 472 + * 473 + * struct foo { spinlock_t lock; ... }; 474 + * ... 475 + * #define myfunc(...) __acquire_ret(_myfunc(__VA_ARGS__), &__ret->lock) 476 + * struct foo *_myfunc(int bar) __acquires_ret; 477 + * ... 478 + */ 479 + #define __acquires_ret __no_context_analysis 480 + #define __acquires_shared_ret __no_context_analysis 31 481 32 482 #endif /* _LINUX_COMPILER_CONTEXT_ANALYSIS_H */
+30
lib/Kconfig.debug
··· 621 621 To ensure that generic code follows the above rules, this 622 622 option forces all percpu variables to be defined as weak. 623 623 624 + config WARN_CONTEXT_ANALYSIS 625 + bool "Compiler context-analysis warnings" 626 + depends on CC_IS_CLANG && CLANG_VERSION >= 220000 627 + # Branch profiling re-defines "if", which messes with the compiler's 628 + # ability to analyze __cond_acquires(..), resulting in false positives. 629 + depends on !TRACE_BRANCH_PROFILING 630 + default y 631 + help 632 + Context Analysis is a language extension, which enables statically 633 + checking that required contexts are active (or inactive) by acquiring 634 + and releasing user-definable "context locks". 635 + 636 + Clang's name of the feature is "Thread Safety Analysis". Requires 637 + Clang 22 or later. 638 + 639 + Produces warnings by default. Select CONFIG_WERROR if you wish to 640 + turn these warnings into errors. 641 + 642 + For more details, see Documentation/dev-tools/context-analysis.rst. 643 + 644 + config WARN_CONTEXT_ANALYSIS_ALL 645 + bool "Enable context analysis for all source files" 646 + depends on WARN_CONTEXT_ANALYSIS 647 + depends on EXPERT && !COMPILE_TEST 648 + help 649 + Enable tree-wide context analysis. This is likely to produce a 650 + large number of false positives - enable at your own risk. 651 + 652 + If unsure, say N. 653 + 624 654 endmenu # "Compiler options" 625 655 626 656 menu "Generic Kernel Debugging Instruments"
+7
scripts/Makefile.context-analysis
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + 3 + context-analysis-cflags := -DWARN_CONTEXT_ANALYSIS \ 4 + -fexperimental-late-parse-attributes -Wthread-safety \ 5 + -Wthread-safety-pointer -Wthread-safety-beta 6 + 7 + export CFLAGS_CONTEXT_ANALYSIS := $(context-analysis-cflags)
+10
scripts/Makefile.lib
··· 106 106 endif 107 107 108 108 # 109 + # Enable context analysis flags only where explicitly opted in. 110 + # (depends on variables CONTEXT_ANALYSIS_obj.o, CONTEXT_ANALYSIS) 111 + # 112 + ifeq ($(CONFIG_WARN_CONTEXT_ANALYSIS),y) 113 + _c_flags += $(if $(patsubst n%,, \ 114 + $(CONTEXT_ANALYSIS_$(target-stem).o)$(CONTEXT_ANALYSIS)$(if $(is-kernel-object),$(CONFIG_WARN_CONTEXT_ANALYSIS_ALL))), \ 115 + $(CFLAGS_CONTEXT_ANALYSIS)) 116 + endif 117 + 118 + # 109 119 # Enable AutoFDO build flags except some files or directories we don't want to 110 120 # enable (depends on variables AUTOFDO_PROFILE_obj.o and AUTOFDO_PROFILE). 111 121 #