Skip to content

Commit 53cae84

Browse files
behlendorftonyhutter
authored andcommitted
Fix CONFIG_MODULES=no Linux kernel config
When configuring as builtin (--enable-linux-builtin) for kernels without loadable module support (CONFIG_MODULES=n) only the object file is created. Never a loadable kmod. Update ZFS_LINUX_TRY_COMPILE to handle this in a manor similar to the ZFS_LINUX_TEST_COMPILE_ALL macro. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#9887 Closes openzfs#10063
1 parent b1c3326 commit 53cae84

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

config/kernel.m4

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,11 +811,20 @@ dnl # $2 - source
811811
dnl # $3 - run on success (valid .ko generated)
812812
dnl # $4 - run on failure (unable to compile)
813813
dnl #
814+
dnl # When configuring as builtin (--enable-linux-builtin) for kernels
815+
dnl # without loadable module support (CONFIG_MODULES=n) only the object
816+
dnl # file is created. See ZFS_LINUX_TEST_COMPILE_ALL for details.
817+
dnl #
814818
AC_DEFUN([ZFS_LINUX_TRY_COMPILE], [
815-
ZFS_LINUX_COMPILE_IFELSE(
816-
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
817-
[test -f build/conftest/conftest.ko],
818-
[$3], [$4])
819+
AS_IF([test "x$enable_linux_builtin" = "xyes"], [
820+
ZFS_LINUX_COMPILE_IFELSE(
821+
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
822+
[test -f build/conftest/conftest.o], [$3], [$4])
823+
], [
824+
ZFS_LINUX_COMPILE_IFELSE(
825+
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
826+
[test -f build/conftest/conftest.ko], [$3], [$4])
827+
])
819828
])
820829

821830
dnl #

0 commit comments

Comments
 (0)