Building module on Mint on 5.4 kernels: fatal 'make' errors
Ilie Halip
ilie.halip at gmail.com
Fri Feb 7 14:19:01 CET 2020
My guess is you're installing the kernel from the Ubuntu PPA,
https://kernel.ubuntu.com/~kernel-ppa/mainline, is that right?
I can reproduce this build error with a fresh 5.4.6 kernel. Turns out, these
kernels are built with a newer GCC (9.2.1). As such, the kernel's generated
headers have CONFIG_CC_HAS_ASM_INLINE=1. But your GCC (probably 7.4.0? that's
what I have on Mint 19.3 machine) doesn't support this feature.
I installed GCC 9 from a PPA and was able to build the module manually:
$ KERNELRELEASE=5.4.6-050406-generic
KERNELDIR=/home/ihalip/Projects/wireguard/kernels/ubuntu/usr/src/linux-headers-5.4.6-050406-generic
make CC=gcc-9
[ ...snip... ]
MODPOST 1 modules
CC [M] /home/ihalip/Projects/wireguard/wireguard-linux-compat/src/wireguard.mod.o
LD [M] /home/ihalip/Projects/wireguard/wireguard-linux-compat/src/wireguard.ko
I imagine you'd see the same issue building any out-of-tree kernel module.
I.H.
More information about the WireGuard
mailing list