First, try to install wireguard:
# this should fail with module compilation error
sudo apt update && sudo apt install -y wireguard wireguard-dkms wireguard-tools linux-headers-$(uname -r) build-essential
Then, go to /usr/src/wireguard-<version here>
and comment out lines 96,97,99 in compat/compat.h
to have