Zfs: building zfs against 5.3 fails on module build "No rule to make target 'module/Module.symvers'"

Created on 7 Aug 2019  路  13Comments  路  Source: openzfs/zfs

Building zfs (today's tip, head commit c81f1790e28a547769ce9d8e2d25391cf4317cc0) against 5.3-rc3 I'm hitting module build failures

System information


Type | Version/Name
--- | ---
Distribution Name | Ubuntu Eoan
Distribution Version | 19.10 (Development)
Linux Kernel | 5.3-rc3
Architecture | x86-64 (amd64)
ZFS Version | zfs-0.8.1 (head c81f1790e28a547769ce9d8e2d25391cf4317cc0)
SPL Version | spl-0.8.1 (head c81f1790e28a547769ce9d8e2d25391cf4317cc0)

Clean build of today's ZFS tip against linux 5.3-rc3 I'm hitting the following build failure:

[lots of build messages ....]
mkdir -p api core spi io os algs algs/aes algs/edonr algs/modes algs/sha1 algs/sha2 algs/skein asm-x86_64 asm-x86_64/aes asm-x86_64/modes asm-x86_64/sha1 asm-x86_64/sha2 asm-i386 asm-generic
make[3]: Leaving directory '/home/cking/zfs/zfs/module/icp'
make[3]: Entering directory '/home/cking/zfs/zfs/module/lua'
mkdir -p setjmp
make[3]: Leaving directory '/home/cking/zfs/zfs/module/lua'
make -C /usr/src/linux-headers-5.3.0-3-generic M=`pwd`  CONFIG_ZFS=m modules
make[3]: Entering directory '/usr/src/linux-headers-5.3.0-3-generic'
  Building modules, stage 2.
make[3]: Leaving directory '/usr/src/linux-headers-5.3.0-3-generic'
make[2]: Leaving directory '/home/cking/zfs/zfs/module'
make[2]: Entering directory '/home/cking/zfs/zfs'
make[2]: *** No rule to make target 'module/Module.symvers', needed by 'all-am'. Stop.
make[2]: Leaving directory '/home/cking/zfs/zfs'
make[1]: *** [Makefile:840: all-recursive] Error 1
make[1]: Leaving directory '/home/cking/zfs/zfs'
make: *** [Makefile:709: all] Error 2

To reproduce, I built using:

autoconf  -ivf; ./configure; make clean; make -j 8
Building

Most helpful comment

Maybe this will help:

Description: Use obj-m instead of subdir-m.
 Do not use subdir-m to visit module Makefile. According to upstream commit
 c07d8d47bca1b325102fa2be3a463075f7b051d9 ("kbuild: show hint if subdir-y/m is
 used to visit module Makefile"), modules are no longer built when this is used,
 and obj-y or obj-m should be used instead. Also, note the need for the trailing
 slash. This will make modules.order be generated correctly again, allowing
 modpost to process zfs modules again.
Author: Thadeu Lima de Souza Cascardo <[email protected]>
Last-Update: 2019-08-12
Index: zfs-linux-0.8.1/module/Makefile.in
===================================================================
--- zfs-linux-0.8.1.orig/module/Makefile.in
+++ zfs-linux-0.8.1/module/Makefile.in
@@ -1,11 +1,11 @@
-subdir-m += avl
-subdir-m += icp
-subdir-m += lua
-subdir-m += nvpair
-subdir-m += spl
-subdir-m += unicode
-subdir-m += zcommon
-subdir-m += zfs
+obj-y += avl/
+obj-y += icp/
+obj-y += lua/
+obj-y += nvpair/
+obj-y += spl/
+obj-y += unicode/
+obj-y += zcommon/
+obj-y += zfs/

 INSTALL_MOD_DIR ?= extra

@@ -60,12 +60,12 @@ modules_install:
 modules_uninstall:
        @# Uninstall the kernel modules
        kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
-       list='$(subdir-m)'; for subdir in $$list; do \
+       list='$(obj-y)'; for subdir in $$list; do \
                $(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
        done

 distdir:
-       list='$(subdir-m)'; for subdir in $$list; do \
+       list='$(obj-y)'; for subdir in $$list; do \
                (cd @top_srcdir@/module && find $$subdir -name '*.c' -o -name '*.h' -o -name '*.S' |\
                xargs cp --parents -t $$distdir); \
        done

All 13 comments

This may be due to the linux headers being incorrect, I will debug this a bit further.

Hitting the same thing on Manjaro with 5.3rc3.

Not made much progress on this, will report once I find some obvious difference.

Check if /usr/src/linux-headers-5.3.0-3-generic/Modules.symvers exists, please. It seems this is not a ZFS but a linux issue.

Edit: just ignore what I wrote about that linux patch... that should not do any harm. (I just had a very short look at it and misinterpreted it.)

Just for the sake of completeness,

$ pacman -Ql | grep -i symvers
linux53-headers /usr/lib/modules/5.3.0-1-MANJARO/build/Module.symvers

I was also getting odd an build error with 5.3rc2 (MODPOST built 0 modules) so I suspect kernel changes.

Reverting commit a721588d9475cbbf9e8b3ae1a69b1dea88d01653 seems to help. I built today's linux tip with the commit reverted, installed the kernel and can now build zfs tip against it without any issues.

Reverting commit a721588d9475cbbf9e8b3ae1a69b1dea88d01653 seems to help. I built today's linux tip with the commit reverted, installed the kernel and can now build zfs tip against it without any issues.

Ah, then my first guess was right after all

I've reported this issue to the author of the commit.

Might be fixed in this commit. We will see with 5.3-rc4 ...

v5.3-rc4 has been tagged, but build still fails.

...trimmed...
make -C /home/ek/src/linux M=`pwd`  CONFIG_ZFS=m modules
make[3]: Entering directory '/home/ek/src/linux'
scripts/Makefile.build:57: '/home/ek/src/zfs/module/icp/icp.ko' will not be built even though obj-m is specified.
scripts/Makefile.build:58: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
scripts/Makefile.build:57: '/home/ek/src/zfs/module/avl/zavl.ko' will not be built even though obj-m is specified.
scripts/Makefile.build:58: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
scripts/Makefile.build:57: '/home/ek/src/zfs/module/nvpair/znvpair.ko' will not be built even though obj-m is specified.
scripts/Makefile.build:57: '/home/ek/src/zfs/module/spl/spl.ko' will not be built even though obj-m is specified.
scripts/Makefile.build:58: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
scripts/Makefile.build:58: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
scripts/Makefile.build:57: '/home/ek/src/zfs/module/lua/zlua.ko' will not be built even though obj-m is specified.
scripts/Makefile.build:58: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
scripts/Makefile.build:57: '/home/ek/src/zfs/module/unicode/zunicode.ko' will not be built even though obj-m is specified.
scripts/Makefile.build:58: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
scripts/Makefile.build:57: '/home/ek/src/zfs/module/zcommon/zcommon.ko' will not be built even though obj-m is specified.
scripts/Makefile.build:58: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
scripts/Makefile.build:57: '/home/ek/src/zfs/module/zfs/zfs.ko' will not be built even though obj-m is specified.
scripts/Makefile.build:58: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
...trimmed...
make[3]: Leaving directory '/home/ek/src/linux'
make[2]: Leaving directory '/home/ek/src/zfs/module'
make[2]: Entering directory '/home/ek/src/zfs'
make[2]: *** No rule to make target 'module/Module.symvers', needed by 'all-am'.  Stop.
make[2]: Leaving directory '/home/ek/src/zfs'
make[1]: *** [Makefile:840: all-recursive] Error 1
make[1]: Leaving directory '/home/ek/src/zfs'
make: *** [Makefile:709: all] Error 2

Maybe this will help:

Description: Use obj-m instead of subdir-m.
 Do not use subdir-m to visit module Makefile. According to upstream commit
 c07d8d47bca1b325102fa2be3a463075f7b051d9 ("kbuild: show hint if subdir-y/m is
 used to visit module Makefile"), modules are no longer built when this is used,
 and obj-y or obj-m should be used instead. Also, note the need for the trailing
 slash. This will make modules.order be generated correctly again, allowing
 modpost to process zfs modules again.
Author: Thadeu Lima de Souza Cascardo <[email protected]>
Last-Update: 2019-08-12
Index: zfs-linux-0.8.1/module/Makefile.in
===================================================================
--- zfs-linux-0.8.1.orig/module/Makefile.in
+++ zfs-linux-0.8.1/module/Makefile.in
@@ -1,11 +1,11 @@
-subdir-m += avl
-subdir-m += icp
-subdir-m += lua
-subdir-m += nvpair
-subdir-m += spl
-subdir-m += unicode
-subdir-m += zcommon
-subdir-m += zfs
+obj-y += avl/
+obj-y += icp/
+obj-y += lua/
+obj-y += nvpair/
+obj-y += spl/
+obj-y += unicode/
+obj-y += zcommon/
+obj-y += zfs/

 INSTALL_MOD_DIR ?= extra

@@ -60,12 +60,12 @@ modules_install:
 modules_uninstall:
        @# Uninstall the kernel modules
        kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
-       list='$(subdir-m)'; for subdir in $$list; do \
+       list='$(obj-y)'; for subdir in $$list; do \
                $(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
        done

 distdir:
-       list='$(subdir-m)'; for subdir in $$list; do \
+       list='$(obj-y)'; for subdir in $$list; do \
                (cd @top_srcdir@/module && find $$subdir -name '*.c' -o -name '*.h' -o -name '*.S' |\
                xargs cp --parents -t $$distdir); \
        done

Works for me! :)

Resolved in master by commit ff4b68eedc307e6e9b7f3890b809cbb0e9d73856, this fix will be applied to 0.8.2 for linux 5.3 compatibility.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Greek64 picture Greek64  路  3Comments

Hubbitus picture Hubbitus  路  4Comments

schmurfy picture schmurfy  路  3Comments

tronder88 picture tronder88  路  3Comments

seonwoolee picture seonwoolee  路  3Comments