aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/kernel-stdarg.m432
-rw-r--r--config/kernel.m42
2 files changed, 34 insertions, 0 deletions
diff --git a/config/kernel-stdarg.m4 b/config/kernel-stdarg.m4
new file mode 100644
index 000000000..5bc8dd859
--- /dev/null
+++ b/config/kernel-stdarg.m4
@@ -0,0 +1,32 @@
+dnl #
+dnl # Linux 5.15 gets rid of -isystem and external <stdarg.h> inclusion
+dnl # and ships its own <linux/stdarg.h>. Check if this header file does
+dnl # exist and provide all necessary definitions for variable argument
+dnl # functions. Adjust the inclusion of <stdarg.h> according to the
+dnl # results.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG], [
+ ZFS_LINUX_TEST_SRC([has_standalone_linux_stdarg], [
+ #include <linux/stdarg.h>
+
+ #if !defined(va_start) || !defined(va_end) || \
+ !defined(va_arg) || !defined(va_copy)
+ #error "<linux/stdarg.h> is invalid"
+ #endif
+ ],[])
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG], [
+ dnl #
+ dnl # Linux 5.15 ships its own stdarg.h and doesn't allow to
+ dnl # include compiler headers.
+ dnl #
+ AC_MSG_CHECKING([whether standalone <linux/stdarg.h> exists])
+ ZFS_LINUX_TEST_RESULT([has_standalone_linux_stdarg], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_STANDALONE_LINUX_STDARG, 1,
+ [standalone <linux/stdarg.h> exists])
+ ],[
+ AC_MSG_RESULT([no])
+ ])
+])
diff --git a/config/kernel.m4 b/config/kernel.m4
index 5ea2286db..0b94f3bd9 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -133,6 +133,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
ZFS_AC_KERNEL_SRC_SIGINFO
ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
+ ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG
AC_MSG_CHECKING([for available kernel interfaces])
ZFS_LINUX_TEST_COMPILE_ALL([kabi])
@@ -239,6 +240,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
ZFS_AC_KERNEL_SIGINFO
ZFS_AC_KERNEL_SET_SPECIAL_STATE
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
+ ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG
])
dnl #