diff options
author | Etienne Dechamps <[email protected]> | 2012-07-16 09:37:38 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-07-26 13:41:02 -0700 |
commit | fc88a6dda92a4fc00491a8afa24d144cc94063e4 (patch) | |
tree | b2498555a3e259a7bd1ffd1b0a1b37563a088540 /config | |
parent | 319a99a3d440480fe9c37f637cb9cac8e0f20ded (diff) |
Fake modpost stage for LINUX_COMPILE.
Currently, when building a test case, we're compiling an entire Linux
module from beginning to end. This includes the MODPOST stage, which
generates a "conftest.mod.c" file with some boilerplate module
declaration code.
This poses a problem when configuring for built-in on kernels which have
loadable module support disabled. In this case conftest.mod.c is
referencing disabled code, resulting in a compilation failure, thus
breaking the tests.
This patch fixes the issue by faking the modpost stage when the
--enable-linux-builtin option is provided. It does so by forcing the
modpost command to be /bin/true, and using an empty conftest.mod.c file.
The test module still compiles fine, although the result isn't loadable,
but we don't really care at this point.
Note it is important to preserve the modpost stage when building out of
tree. The ZFS_AC_KERNEL_BLK_END_REQUEST, ZFS_AC_KERNEL_BLK_QUEUE_FLUSH,
and ZFS_AC_KERNEL_BLK_RQ_BYTES configure checks all depend on it to
identify GPL-only symbols.
Signed-off-by: Prakash Surya <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #851
Diffstat (limited to 'config')
-rw-r--r-- | config/kernel.m4 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/config/kernel.m4 b/config/kernel.m4 index 2fb3fc91b..b9c9fb982 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -444,10 +444,12 @@ dnl # ZFS_LINUX_COMPILE_IFELSE / like AC_COMPILE_IFELSE dnl # AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [ m4_ifvaln([$1], [ZFS_LINUX_CONFTEST([$1])]) - rm -Rf build && mkdir -p build + rm -Rf build && mkdir -p build && touch build/conftest.mod.c echo "obj-m := conftest.o" >build/Makefile + modpost_flag='' + test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage AS_IF( - [AC_TRY_COMMAND(cp conftest.c build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], + [AC_TRY_COMMAND(cp conftest.c build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])], [$4], [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])] ) |