summaryrefslogtreecommitdiff
path: root/tools/include/linux/compiler.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2024-03-22 16:49:36 +0300
committerAndrii Nakryiko <andrii@kernel.org>2024-03-22 20:01:17 +0300
commitaf8d27bf15c8d68c60d830552055fcdba5b5f045 (patch)
tree1cf13aac3cf073e16278b5a97614019bca93123e /tools/include/linux/compiler.h
parent1684d6eb99e480ff653af60e20ff5e7e55e69ccd (diff)
downloadlinux-af8d27bf15c8d68c60d830552055fcdba5b5f045.tar.xz
selftests/bpf: Mark uprobe trigger functions with nocf_check attribute
Some distros seem to enable the -fcf-protection=branch by default, which breaks our setup on first instruction of uprobe trigger functions and place there endbr64 instruction. Marking them with nocf_check attribute to skip that. Ignoring unknown attribute warning in gcc for bench objects, because nocf_check can be used only when -fcf-protection=branch is enabled, otherwise we get a warning and break compilation. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20240322134936.1075395-1-jolsa@kernel.org
Diffstat (limited to 'tools/include/linux/compiler.h')
-rw-r--r--tools/include/linux/compiler.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 7b65566f3e42..8a63a9913495 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -58,6 +58,10 @@
#define noinline
#endif
+#ifndef __nocf_check
+#define __nocf_check __attribute__((nocf_check))
+#endif
+
/* Are two types/vars the same type (ignoring qualifiers)? */
#ifndef __same_type
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))