xref: /freebsd/sys/contrib/openzfs/config/kernel-kasan-enabled.m4 (revision 546d3d08e5993cbe2d6141b256e8c2ebad5aa102)
1dnl #
2dnl # 6.18: some architectures and config option causes the kasan_ inline
3dnl #       functions to reference the GPL-only symbol 'kasan_flag_enabled',
4dnl #       breaking the build. Detect this and work
5dnl #       around it.
6AC_DEFUN([ZFS_AC_KERNEL_SRC_KASAN_ENABLED], [
7	ZFS_LINUX_TEST_SRC([kasan_enabled], [
8		#include <linux/kasan.h>
9	], [
10		kasan_enabled();
11	], [], [ZFS_META_LICENSE])
12])
13AC_DEFUN([ZFS_AC_KERNEL_KASAN_ENABLED], [
14	AC_MSG_CHECKING([whether kasan_enabled() is GPL-only])
15	ZFS_LINUX_TEST_RESULT([kasan_enabled_license], [
16		AC_MSG_RESULT(no)
17	], [
18		AC_MSG_RESULT(yes)
19		AC_DEFINE(HAVE_KASAN_ENABLED_GPL_ONLY, 1,
20		    [kasan_enabled() is GPL-only])
21	])
22])
23
24