-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux 5.15 compat: standalone <linux/stdarg.h>
Kernel commits 39f75da7bcc8 ("isystem: trim/fixup stdarg.h and other headers") c0891ac15f04 ("isystem: ship and use stdarg.h") 564f963eabd1 ("isystem: delete global -isystem compile option") (for now can be found in linux-next.git tree, will land into the Linus' tree during the ongoing 5.15 cycle with one of akpm merges) removed the -isystem flag and disallowed the inclusion of any compiler header files. They also introduced a minimal <linux/stdarg.h> as a replacement for <stdarg.h>. include/os/linux/spl/sys/cmn_err.h in the ZFS source tree includes <stdarg.h> unconditionally. Introduce a test for <linux/stdarg.h> and include it instead of the compiler's one to prevent module build breakage. Reviewed-by: Tony Nguyen <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Lobakin <[email protected]> Closes #12531
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters