mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:24:47 +01:00
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>
This commit is contained in:
parent
d79526b895
commit
d39a1d7486
2 changed files with 7 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue