Building module on Mint on 5.4 kernels: fatal 'make' errors
Apologies if this has been covered somewhere before.
I have Mint 19.3 Cinnamon, which is based upon Ubuntu 18.04.3 LTS (Bionic Beaver). The last few weeks have seen multiple updates to Wireguard arrive for that system. However, a problem has persisted through those updates. To wit: the Wireguard module will not build on kernels >= 5.4. Rather, I get these errors (the following being a link to the make.log):
https://app.box.com/s/nnr5vpeookt4ea3b6mho0ktyptp5fa0p
With kernels < 5.4, everything works.
I have wireguard-dkms 0.0.20200121-wg2~18.04.
Yours
NJ
_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard
Seems to be a Mint DKMS problem maybe? Are they shipping clang but building kernels with gcc, or vice versa?
_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard
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.koI imagine you'd see the same issue building any out-of-tree kernel module.
I.H.
_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard
Quoted 1 line · Jason A. Donenfeld
Seems to be a Mint DKMS problem maybe? Are they shipping clang but building kernels with gcc, or vice versa?
I don't know. But I found a working solution, on the web
(https://github.com/xanmod/linux/issues/33), which was this:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo add-apt-repository ppa:savoury1/gcc-defaults-9 sudo apt-get update
sudo apt-get upgrade && sudo apt-get dist-upgrade
I notice also that - after I'd done that - Wireguard has been updated recently to build without a 'dev' package; perhaps that would fix the problem too.
Yours
Nicholas
PS: at present I do not read email from this list; I send this message to the list only because requested (via my private email address) so to do.
_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard