Skip to contentSkip to conversation

Trouble building WireGuard since December releases

DISCUSSION Kevin 4 participants 7 messages Jan 22, 2018 – Jan 24, 2018

lore
Share & tools
lore

Kevin

author
#0 lore raw

Hi all,

I've been having trouble building WireGuard on Solus since its December snapshots. Earlier snapshots (e.g. November) still build without a problem, even on new kernels. Does this have to do with Solus kernel builds, or am I overlooking something?

user@t450s-solus ~/bin/WireGuard-0.0.20180118/src $ make debug test -e include/generated/autoconf.h -a -e include/config/auto.conf ||
( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or
include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src
to fix it."; \
echo >&2 ; \
/bin/false)
mkdir -p /home/user/bin/WireGuard-0.0.20180118/src/.tmp_versions ; rm -f /home/user/bin/WireGuard-0.0.20180118/src/.tmp_versions/* make -f ./scripts/Makefile.build obj=/home/user/bin/WireGuard- 0.0.20180118/src
make[2]: *** No rule to make target '/home/user/bin/WireGuard- 0.0.20180118/src/main.o', needed by '/home/user/bin/WireGuard- 0.0.20180118/src/wireguard.o'. Stop.
make[1]: *** [Makefile:1507: _module_/home/user/bin/WireGuard- 0.0.20180118/src] Error 2
make: *** [Makefile:39: module-debug] Error 2

#1 lore raw
Quoted 7 lines · Kevin

Hi all,

I've been having trouble building WireGuard on Solus since its December snapshots. Earlier snapshots (e.g. November) still build without a problem, even on new kernels. Does this have to do with Solus kernel builds, or am I overlooking something?

Quoted 9 lines

user@t450s-solus ~/bin/WireGuard-0.0.20180118/src $ make debug test -e include/generated/autoconf.h -a -e include/config/auto.conf ||
( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or
include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src
to fix it."; \

Have you run 'make oldconfig' and 'make prepare' on the kernel source tree you are wanting to build the wireguard code against?

thanks,

greg k-h

#3 lore raw

Worked exactly as intended for me.

1. I downloaded the latest ISO from the solus website.
2. I installed it using the GUI installer.
3. I booted into the new installation.
4. I updated all packages using the GUI updater.
5. I ran these commands in the built-in terminal:

$ sudo eopkg install git
$ sudo eopkg install -c kernel.devel
$ sudo eopkg install -c system.devel
$ sudo eopkg install libmnl-devel
$ git clone https://git.zx2c4.com/WireGuard
$ cd WireGuard/src && make debug -j$(nproc) && sudo make install
$ sudo modprobe wireguard && dmesg | grep wireguard
[   31.554056] wireguard: loading out-of-tree module taints kernel.
[   31.555061] wireguard: allowedips self-tests: pass
[   31.555463] wireguard: nonce counter self-tests: pass
[   31.555761] wireguard: curve25519 self-tests: pass
[   31.555798] wireguard: chacha20poly1305 self-tests: pass
[   31.555808] wireguard: poly1305 self-tests: pass
[   31.556129] wireguard: blake2s self-tests: pass
[   31.755518] wireguard: ratelimiter self-tests: pass
[   31.755531] wireguard: WireGuard 0.0.20180118-2-gc80cbfa loaded.
See www.wireguard.com for information.
[   31.755532] wireguard: Copyright (C) 2015-2018 Jason A. Donenfeld
<[email protected]>. All Rights Reserved.
#4 lore raw

Ahh, small update. When building this, I noticed:

Makefile:944: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"

After installing libelf-devel, the exact problem you reported appeared. I then tried this hack:

$ sudo ln -s /bin/true /lib/modules/$(uname -r)/build/tools/objtool/objtool

And after, the build worked again. It therefore appears that Solus is not distributing objtool with their kernel headers, when they should be.

I opened a bug for your issue, but as I've never used Solus until today, I won't be following up on it. So, please direct your distribution to the bug at: https://dev.solus-project.com/T5607 and see what you can do about helping to get this fixed.

Regards,
Jason

#5 lore raw
Quoted 4 lines · Jason A. Donenfeld

Ahh, small update. When building this, I noticed:

Makefile:944: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"

fwiw, debian had the same issue around libelf-dev with their kernel source packaging, and treated it as a bug there, which was resolved in the kernel package itself, rather than requiring additional build dependencies of all kernel modules: https://bugs.debian.org/886474

(this message is just about libelf-dev; i haven't followed the details about objtool)

             --dkg
#6 lore raw
Quoted 11 lines · Daniel Kahn Gillmor
Quoted 4 lines · Jason A. Donenfeld

Ahh, small update. When building this, I noticed:

Makefile:944: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"

fwiw, debian had the same issue around libelf-dev with their kernel source packaging, and treated it as a bug there, which was resolved in the kernel package itself, rather than requiring additional build dependencies of all kernel modules: https://bugs.debian.org/886474

Seems like a sane resolution.

Quoted 3 lines

(this message is just about libelf-dev; i haven't followed the details about objtool)

The detail about objtool is just that they forgot to include it in their headers, so when the build system tries to use it, it can't find it and fails. Simple problem with a simple solution, thankfully.