summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2026-02-20 13:15:58 -0800
committerKees Cook <kees@kernel.org>2026-02-21 01:01:14 -0800
commitd39a1d7486d98668dd34aaa6732aad7977c45f5a (patch)
treee3d0917dd485ceaca58f9c557550933a9acb2ab9 /init
parentd79526b89571ae447c1a5cfd3d627efa07098348 (diff)
compiler_types: Disable __builtin_counted_by_ref for Clang
Unfortunately, there is a corner case of __builtin_counted_by_ref() usage that crashes[1] Clang since support was introduced in Clang 19. Disable it prior to Clang 22. Found while tested kmalloc_obj treewide refactoring (via kmalloc_flex() usage). Link: https://github.com/llvm/llvm-project/issues/182575 [1] Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig5
1 files changed, 5 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig
index e95d43457851..c25869cf59c1 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -150,6 +150,11 @@ config CC_HAS_COUNTED_BY_PTR
# supported since gcc 16.0.0
default y if CC_IS_GCC && GCC_VERSION >= 160000
+config CC_HAS_BROKEN_COUNTED_BY_REF
+ bool
+ # https://github.com/llvm/llvm-project/issues/182575
+ default y if CC_IS_CLANG && CLANG_VERSION < 220000
+
config CC_HAS_MULTIDIMENSIONAL_NONSTRING
def_bool $(success,echo 'char tag[][4] __attribute__((__nonstring__)) = { };' | $(CC) $(CLANG_FLAGS) -x c - -c -o /dev/null -Werror)