Commit 038c7dc6 authored by Kees Cook's avatar Kees Cook Committed by Peter Zijlstra
Browse files

compiler_types.h: Move __nocfi out of compiler-specific header



Prepare for GCC KCFI support and move the __nocfi attribute from
compiler-clang.h to compiler_types.h. This was already gated by
CONFIG_CFI_CLANG, so this remains safe for non-KCFI GCC builds.

Signed-off-by: default avatarKees Cook <kees@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20250904034656.3670313-1-kees@kernel.org
parent 894af4a1
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -96,11 +96,6 @@
# define __noscs	__attribute__((__no_sanitize__("shadow-call-stack")))
#endif

#if __has_feature(kcfi)
/* Disable CFI checking inside a function. */
#define __nocfi		__attribute__((__no_sanitize__("kcfi")))
#endif

/*
 * Turn individual warnings and errors on and off locally, depending
 * on version.
+3 −1
Original line number Diff line number Diff line
@@ -432,7 +432,9 @@ struct ftrace_likely_data {
# define __noscs
#endif

#ifndef __nocfi
#if defined(CONFIG_CFI_CLANG)
# define __nocfi		__attribute__((__no_sanitize__("kcfi")))
#else
# define __nocfi
#endif