[BUG] wireguard-dkms fails with linux-rpi4

Hello,

wireguard-dkms fails to compile with linux-rpi4

  • What device are you using?

A Raspberry Pi 4B

  • What edition of Manjaro-ARM is installed? (eg minimal, server, etc.)

Minimal 19.08

  • When did you last run updates and reboot?

Fri 30 Aug 2019 11:51:40 AM UTC

  • What package contains the bug?

Most likely linux-rpi4-headers

  • Describe the bug the best you can. What where you doing when the bug happened?

Installing wireguard-dkms fails with

DKMS make.log for wireguard-0.0.20190702 for kernel 4.19.68-1-MANJARO-ARM (aarch64)
Fri 30 Aug 2019 01:41:33 PM CEST
make: Entering directory '/usr/lib/modules/4.19.68-1-MANJARO-ARM/build'
Makefile:614: arch/arm64/Makefile: No such file or directory
make: *** No rule to make target 'arch/arm64/Makefile'.  Stop.
make: Leaving directory '/usr/lib/modules/4.19.68-1-MANJARO-ARM/build'
  • Any workarounds or known fixes?

Adding wireguard directly into the kernel tree and recompiling the kernel I guess ?

Regards,
Philipp Richter

Is this when installing the wireguard-dkms package from the repo?

It's wireguard-dkms from the community repo, yes.

pacman -Qi wireguard-dkms

Name            : wireguard-dkms
Version         : 0.0.20190702-1
Description     : next generation secure network tunnel
Architecture    : aarch64
URL             : http://www.wireguard.com/
Licenses        : GPL
Groups          : None
Provides        : WIREGUARD-MODULE
Depends On      : dkms
Optional Deps   : None
Required By     : None
Optional For    : wireguard-tools
Conflicts With  : None
Replaces        : None
Installed Size  : 1792.00 KiB
Packager        : Arch Linux ARM Build System <builder+n1@archlinuxarm.org>
Build Date      : Tue 02 Jul 2019 03:48:05 PM CEST
Install Date    : Fri 30 Aug 2019 02:00:25 PM CEST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Okay.

Do you have the linux-rpi4-headers package installed aswell?

Yes, there would be no /usr/lib/modules/4.19.68-1-MANJARO-ARM/build otherwise.
The arch folder has arm in it but not arm64.

You are correct. It's not there. I don't understandt why, because in the PKGBUILD it's defined to be arm64.... But I think I found the issue!

I will create a new kernel/headers package today with the fix. Thanks for reporting!

Nice, it was a pleasure :wink: thank you for looking into it.

The Makefiles are needed for it to work and they are not there for the other architectures it seems.

I got wireguard to compile by symlinking /usr/lib/modules/4.19.68-1-MANJARO-ARM/build to ~/linux-rpi4/src/linux-d9a27b27450d9f81b567134f1c8b85401556ab5a (I pulled the linux-rpi4 package to modify the config and recompile the kernel to get me the missing netfilter modules)

Yeah. It's my bad. An oversight on my part. Seems it has been that way, since we started shipping the rpi4 specific kernel. :stuck_out_tongue:

The error has shifted for linux-rpi4-headers-4.19.69-1-aarch64 with wireguard-dkms
So, still no success in compiling the module.

DKMS make.log for wireguard-0.0.20190702 for kernel 4.19.69-1-MANJARO-ARM (aarch64)
Sun 01 Sep 2019 01:47:09 PM CEST
make: Entering directory '/usr/lib/modules/4.19.69-1-MANJARO-ARM/build'
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/main.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/noise.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/device.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/peer.o
In file included from ./arch/arm64/include/asm/timex.h:19,
                 from ./include/linux/timex.h:65,
                 from ./include/linux/jiffies.h:10,
                 from ./include/linux/ktime.h:25,
                 from /var/lib/dkms/wireguard/0.0.20190702/build/compat/compat.h:394,
                 from <command-line>:
./arch/arm64/include/asm/arch_timer.h:31:10: fatal error: clocksource/arm_arch_timer.h: No such file or directory
   31 | #include <clocksource/arm_arch_timer.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from ./arch/arm64/include/asm/timex.h:19,
                 from ./include/linux/timex.h:65,
                 from ./include/linux/jiffies.h:10,
                 from ./include/linux/ktime.h:25,
                 from /var/lib/dkms/wireguard/0.0.20190702/build/compat/compat.h:394,
                 from <command-line>:
./arch/arm64/include/asm/arch_timer.h:31:10: fatal error: clocksource/arm_arch_timer.h: No such file or directory
   31 | #include <clocksource/arm_arch_timer.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.build:303: /var/lib/dkms/wireguard/0.0.20190702/build/device.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:303: /var/lib/dkms/wireguard/0.0.20190702/build/noise.o] Error 1
In file included from ./arch/arm64/include/asm/timex.h:19,
                 from ./include/linux/timex.h:65,
                 from ./include/linux/jiffies.h:10,
                 from ./include/linux/ktime.h:25,
                 from /var/lib/dkms/wireguard/0.0.20190702/build/compat/compat.h:394,
                 from <command-line>:
./arch/arm64/include/asm/arch_timer.h:31:10: fatal error: clocksource/arm_arch_timer.h: No such file or directory
   31 | #include <clocksource/arm_arch_timer.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.build:303: /var/lib/dkms/wireguard/0.0.20190702/build/peer.o] Error 1
In file included from ./arch/arm64/include/asm/timex.h:19,
                 from ./include/linux/timex.h:65,
                 from ./include/linux/jiffies.h:10,
                 from ./include/linux/ktime.h:25,
                 from /var/lib/dkms/wireguard/0.0.20190702/build/compat/compat.h:394,
                 from <command-line>:
./arch/arm64/include/asm/arch_timer.h:31:10: fatal error: clocksource/arm_arch_timer.h: No such file or directory
   31 | #include <clocksource/arm_arch_timer.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.build:303: /var/lib/dkms/wireguard/0.0.20190702/build/main.o] Error 1
make: *** [Makefile:1519: _module_/var/lib/dkms/wireguard/0.0.20190702/build] Error 2
make: Leaving directory '/usr/lib/modules/4.19.69-1-MANJARO-ARM/build'

It looks like the clocksource directory was completely omitted. Before Strit gets around to re-compiling how about un-taring this and see if there are other omissions.

This is the whole clocksource directory and goes under:

/usr/lib/modules/4.19.69-1-MANJARO-ARM/build/include/

Hi Darksky,

thank you I symlinked build to my kernel source like before to get the wireguard module.
Adding clocksource gets it further, it fails on the linking stage now complaining about missing ./arch/arm64/kernel/module.lds.

DKMS make.log for wireguard-0.0.20190702 for kernel 4.19.69-1-MANJARO-ARM (aarch64)
Sun 01 Sep 2019 08:01:48 PM CEST
make: Entering directory '/usr/lib/modules/4.19.69-1-MANJARO-ARM/build'
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/main.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/noise.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/device.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/peer.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/timers.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/queueing.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/send.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/receive.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/socket.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/peerlookup.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/allowedips.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/ratelimiter.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/cookie.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/netlink.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20/chacha20.o
  PERLASM /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20/chacha20-arm64.S
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/poly1305/poly1305.o
  PERLASM /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/poly1305/poly1305-arm64.S
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20poly1305.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/blake2s/blake2s.o
  CC [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/curve25519/curve25519.o
  AS [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/chacha20/chacha20-arm64.o
  AS [M]  /var/lib/dkms/wireguard/0.0.20190702/build/crypto/zinc/poly1305/poly1305-arm64.o
  LD [M]  /var/lib/dkms/wireguard/0.0.20190702/build/wireguard.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /var/lib/dkms/wireguard/0.0.20190702/build/wireguard.mod.o
  LD [M]  /var/lib/dkms/wireguard/0.0.20190702/build/wireguard.ko
ld: cannot open linker script file ./arch/arm64/kernel/module.lds: No such file or directory
make[1]: *** [scripts/Makefile.modpost:129: /var/lib/dkms/wireguard/0.0.20190702/build/wireguard.ko] Error 1
make: *** [Makefile:1523: modules] Error 2
make: Leaving directory '/usr/lib/modules/4.19.69-1-MANJARO-ARM/build'

It might be a good idea if I try other dkms packages to find maybe more missing files.

/usr/lib/modules/4.19.69-1-MANJARO-ARM/build/arch/arm64/kernel/module.lds

SECTIONS {
	.plt (NOLOAD) : { BYTE(0) }
	.init.plt (NOLOAD) : { BYTE(0) }
	.text.ftrace_trampoline (NOLOAD) : { BYTE(0) }
}

That did it. So linux-rpi4-headers needs clocksource and module.lds to compile wireguard-dkms at least.

@popsulfr Thanks for testing and helping out.

New kernel version 4.19.69-2 uploaded to the repo, should contain these.

1 Like

No issues anymore installing wireguard-dkms with 4.19.69-2. Merci :wink:

1 Like

Forum kindly sponsored by Bytemark