diff options
| author | Nathan Chancellor <[email protected]> | 2025-09-02 22:49:26 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-09-09 06:45:12 +0000 |
| commit | 3fac212fe489aa0dbe8d80a42a7809840ca7b0f9 (patch) | |
| tree | 1c9dc56165066d1599aab7e120d9ea1989e32f9d /fs/xfs/xfs_zone_alloc.c | |
| parent | mm/vmalloc, mm/kasan: respect gfp mask in kasan_populate_vmalloc() (diff) | |
| download | kernel-3fac212fe489aa0dbe8d80a42a7809840ca7b0f9.tar.gz kernel-3fac212fe489aa0dbe8d80a42a7809840ca7b0f9.zip | |
compiler-clang.h: define __SANITIZE_*__ macros only when undefined
Clang 22 recently added support for defining __SANITIZE__ macros similar
to GCC [1], which causes warnings (or errors with CONFIG_WERROR=y or W=e)
with the existing defines that the kernel creates to emulate this behavior
with existing clang versions.
In file included from <built-in>:3:
In file included from include/linux/compiler_types.h:171:
include/linux/compiler-clang.h:37:9: error: '__SANITIZE_THREAD__' macro redefined [-Werror,-Wmacro-redefined]
37 | #define __SANITIZE_THREAD__
| ^
<built-in>:352:9: note: previous definition is here
352 | #define __SANITIZE_THREAD__ 1
| ^
Refactor compiler-clang.h to only define the sanitizer macros when they
are undefined and adjust the rest of the code to use these macros for
checking if the sanitizers are enabled, clearing up the warnings and
allowing the kernel to easily drop these defines when the minimum
supported version of LLVM for building the kernel becomes 22.0.0 or newer.
Link: https://lkml.kernel.org/r/20250902-clang-update-sanitize-defines-v1-1-cf3702ca3d92@kernel.org
Link: https://github.com/llvm/llvm-project/commit/568c23bbd3303518c5056d7f03444dae4fdc8a9c [1]
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: Justin Stitt <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Dmitriy Vyukov <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_zone_alloc.c')
0 files changed, 0 insertions, 0 deletions
