2017-03-07 20:59:31 +00:00
|
|
|
dnl #
|
2019-10-01 19:50:34 +00:00
|
|
|
dnl # Check for objtool support.
|
2017-03-07 20:59:31 +00:00
|
|
|
dnl #
|
2019-10-01 19:50:34 +00:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [
|
|
|
|
|
|
|
|
dnl # 4.6 API for compile-time stack validation
|
|
|
|
ZFS_LINUX_TEST_SRC([objtool], [
|
2017-03-07 20:59:31 +00:00
|
|
|
#undef __ASSEMBLY__
|
2020-09-28 23:40:50 +00:00
|
|
|
#include <asm/ptrace.h>
|
2017-03-07 20:59:31 +00:00
|
|
|
#include <asm/frame.h>
|
|
|
|
],[
|
|
|
|
#if !defined(FRAME_BEGIN)
|
2020-09-28 23:40:50 +00:00
|
|
|
#error "FRAME_BEGIN is not defined"
|
2017-03-07 20:59:31 +00:00
|
|
|
#endif
|
2017-12-07 18:28:50 +00:00
|
|
|
])
|
|
|
|
|
2019-10-01 19:50:34 +00:00
|
|
|
dnl # 4.6 API added STACK_FRAME_NON_STANDARD macro
|
|
|
|
ZFS_LINUX_TEST_SRC([stack_frame_non_standard], [
|
2017-12-07 18:28:50 +00:00
|
|
|
#include <linux/frame.h>
|
|
|
|
],[
|
|
|
|
#if !defined(STACK_FRAME_NON_STANDARD)
|
2020-09-28 23:40:50 +00:00
|
|
|
#error "STACK_FRAME_NON_STANDARD is not defined."
|
2017-12-07 18:28:50 +00:00
|
|
|
#endif
|
2019-10-01 19:50:34 +00:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL], [
|
|
|
|
AC_MSG_CHECKING(
|
|
|
|
[whether compile-time stack validation (objtool) is available])
|
|
|
|
ZFS_LINUX_TEST_RESULT([objtool], [
|
2017-12-07 18:28:50 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
2019-10-01 19:50:34 +00:00
|
|
|
AC_DEFINE(HAVE_KERNEL_OBJTOOL, 1,
|
|
|
|
[kernel does stack verification])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether STACK_FRAME_NON_STANDARD is defined])
|
|
|
|
ZFS_LINUX_TEST_RESULT([stack_frame_non_standard], [
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_STACK_FRAME_NON_STANDARD, 1,
|
|
|
|
[STACK_FRAME_NON_STANDARD is defined])
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
2017-03-07 20:59:31 +00:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
|
|
|
])
|