[Edit: posted this before I saw the previous response, will review after following those suggestions]
[Edit2: after reviewing the above:
The wireguard.ko module is provided in
http://www.tinycorelinux.net/13.x/armv6/releases/RPi/src/kernel/5.10.16-piCore_modules.tar.xz and I already have that and its dependencies loading ok.
Building wireguard-tools fails as described below]
Following the instructions here
https://www.wireguard.com/compilation/I've installed bunutils, gcc, make, git, linux-5.10.y_api_headers.tcz, libelf-dev, libmnl-dev, glibc_base-dev.tcz
The asm/socket.h header is missing:
$ CC config.o
In file included from /usr/include/sys/socket.h:33,
from /usr/include/netinet/in.h:23,
from /usr/include/arpa/inet.h:22,
from config.c:6:
/usr/include/bits/socket.h:354:11: fatal error: asm/socket.h: No such file or directory
On raspbian it looks like that file is at
/usr/include/arm-linux-gnueabihf/asm/socket.h
which is provided by linux-libc-dev.
What package provides that file in piCore?