Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ColinIanKing opened this issue Aug 7, 2019 · 13 comments
Labels
Type: Building Indicates an issue related to building binaries

Comments

@ColinIanKing
Copy link
Contributor

Building zfs (today's tip, head commit c81f179) 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 c81f179)
SPL Version spl-0.8.1 (head c81f179)

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
@ColinIanKing
Copy link
Contributor Author

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

@jonathonf
Copy link
Contributor

Hitting the same thing on Manjaro with 5.3rc3.

@ColinIanKing
Copy link
Contributor Author

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

@c0d3z3r0
Copy link
Contributor

c0d3z3r0 commented Aug 7, 2019

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.)

@jonathonf
Copy link
Contributor

jonathonf commented Aug 7, 2019

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.

@ColinIanKing
Copy link
Contributor Author

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.

@c0d3z3r0
Copy link
Contributor

c0d3z3r0 commented Aug 8, 2019

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

@ColinIanKing
Copy link
Contributor Author

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

@philmmanjaro
Copy link

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

@mikoim
Copy link

mikoim commented Aug 12, 2019

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

@ColinIanKing
Copy link
Contributor Author

ColinIanKing commented Aug 12, 2019

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 <cascardo@canonical.com>
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

@jonathonf
Copy link
Contributor

Works for me! :)

@behlendorf
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

No branches or pull requests

6 participants