Skip to content

Commit

Permalink
Fix CONFIG_MODULES=no Linux kernel config
Browse files Browse the repository at this point in the history
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
  • Loading branch information
behlendorf authored and tonyhutter committed Apr 22, 2020
1 parent 7fd85dd commit f562576
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions config/kernel.m4
Original file line number Diff line number Diff line change
Expand Up @@ -811,11 +811,20 @@ dnl # $2 - source
dnl # $3 - run on success (valid .ko generated)
dnl # $4 - run on failure (unable to compile)
dnl #
dnl # When configuring as builtin (--enable-linux-builtin) for kernels
dnl # without loadable module support (CONFIG_MODULES=n) only the object
dnl # file is created. See ZFS_LINUX_TEST_COMPILE_ALL for details.
dnl #
AC_DEFUN([ZFS_LINUX_TRY_COMPILE], [
ZFS_LINUX_COMPILE_IFELSE(
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
[test -f build/conftest/conftest.ko],
[$3], [$4])
AS_IF([test "x$enable_linux_builtin" = "xyes"], [
ZFS_LINUX_COMPILE_IFELSE(
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
[test -f build/conftest/conftest.o], [$3], [$4])
], [
ZFS_LINUX_COMPILE_IFELSE(
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
[test -f build/conftest/conftest.ko], [$3], [$4])
])
])

dnl #
Expand Down

0 comments on commit f562576

Please sign in to comment.