I'm trying to compile zfs on my raspberry pi4, running CentOS 7.7 (64bit). I followed the instructions provided here: https://github.com/zfsonlinux/zfs/wiki/Building-ZFS but can't get past the following error:

checking kernel source version... 4.19.86-v8+
checking kernel file name for module symbols... Module.symvers
checking whether modules can be built... no
configure: error: 
    *** Unable to build an empty module.

Here is the link to the entire config.log - I couldn't really make sense of it: https://pastebin.com/Whmg6hFw

And here's some background information on my system:

# uname -a
Linux localhost 4.19.86-v8+ #1 SMP PREEMPT Sat Dec 7 12:40:40 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux

# rpm -qa | grep kernel

# cat /etc/system-release
CentOS Linux release 7.7.1908 (AltArch)

I compiled the kernel and their rpms myself from the official GitHub repo; no issues or whatsoever with those (just in case that's part of the error - although I don't think so). https://github.com/raspberrypi/linux

Any help appreciated - thanks in advance😉!

  • Maybe using a more recent gcc would help; 4.85 is very old (circa 2015). – ajgringo619 Dec 9 '19 at 23:37
  • Thanks - tested both gcc9.2 and 8.3; same result – mpbaum Dec 10 '19 at 22:56

Thanks to the folks over at https://github.com/zfsonlinux/ I managed to resolve the issue.

Looks like the kernel-devel package contained scripts that were compiled for x86 instead of arm64:

# file /usr/src/kernels/4.19.86-v8+/basic/fixdep
basic/fixdep: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), BuildID[sha1]=f96cf37e4ab3abdfa90880655b262c4ae72c937a, for GNU/Linux 3.2.0, not stripped

The result for the other files in the srcipts directory was very similar.

Running make scripts in the kernel-source directory resolved the issue:

# cd /usr/src/kernels/4.19.86-v8+/
# make scripts
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.