aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/qemu/compiler.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index df9ec08f8a..d620a841e4 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -233,4 +233,15 @@ extern void QEMU_NORETURN QEMU_ERROR("code path is reachable")
# define QEMU_FALLTHROUGH do {} while (0) /* fallthrough */
#endif
+#ifdef CONFIG_CFI
+/*
+ * If CFI is enabled, use an attribute to disable cfi-icall on the following
+ * function
+ */
+#define QEMU_DISABLE_CFI __attribute__((no_sanitize("cfi-icall")))
+#else
+/* If CFI is not enabled, use an empty define to not change the behavior */
+#define QEMU_DISABLE_CFI
+#endif
+
#endif /* COMPILER_H */