2 dnl # Detect objtool functionality.
6 dnl # Kernel 5.10: linux/frame.h was renamed linux/objtool.h
8 AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL_HEADER], [
9 AC_MSG_CHECKING([whether objtool header is available])
10 ZFS_LINUX_TRY_COMPILE([
11 #include <linux/objtool.h>
14 AC_DEFINE(HAVE_KERNEL_OBJTOOL_HEADER, 1,
15 [kernel has linux/objtool.h])
16 AC_MSG_RESULT(linux/objtool.h)
18 AC_MSG_RESULT(linux/frame.h)
23 dnl # Check for objtool support.
25 AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [
27 dnl # 4.6 API for compile-time stack validation
28 ZFS_LINUX_TEST_SRC([objtool], [
30 #include <asm/ptrace.h>
31 #include <asm/frame.h>
33 #if !defined(FRAME_BEGIN)
34 #error "FRAME_BEGIN is not defined"
38 dnl # 4.6 API added STACK_FRAME_NON_STANDARD macro
39 ZFS_LINUX_TEST_SRC([stack_frame_non_standard], [
40 #ifdef HAVE_KERNEL_OBJTOOL_HEADER
41 #include <linux/objtool.h>
43 #include <linux/frame.h>
46 #if !defined(STACK_FRAME_NON_STANDARD)
47 #error "STACK_FRAME_NON_STANDARD is not defined."
52 AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL], [
54 [whether compile-time stack validation (objtool) is available])
55 ZFS_LINUX_TEST_RESULT([objtool], [
57 AC_DEFINE(HAVE_KERNEL_OBJTOOL, 1,
58 [kernel does stack verification])
60 AC_MSG_CHECKING([whether STACK_FRAME_NON_STANDARD is defined])
61 ZFS_LINUX_TEST_RESULT([stack_frame_non_standard], [
63 AC_DEFINE(HAVE_STACK_FRAME_NON_STANDARD, 1,
64 [STACK_FRAME_NON_STANDARD is defined])