wireguard-linux-compat
wireguard-linux-compat copied to clipboard
builds for ARMv5 with GCC 4.4
This patch allows for building wireguard into the 3.18.140 kernel with gcc-4.1.2 targeting an ARMv5 without an FPU
-Wframe-larger-than is not recognized by older compilers -O3 probably would work fine, but I've had trouble with it in the past.
A few additional braces are required by older gcc version in initializers.
Older gas macro assemblers don't support the \0 pseudo variable. Turns out, your code doesn't even rely in it, as there is only one instance of the chacha20 macro.
The GCC flags are not big deal, but I hope you will at least accept adding the braces in struct inits and avoiding \0 for in gas. None of those changes alter the generated code in the slightest.
By the way, the tip of the master branch will not build against kernel 3.18 due to recent commits regarding the .parse_protocol hook. You probably already know this. Is there any policy for fetching the latest tested tag or branch?
I'm looking forward to replacing our PPTP based VPN over the next couple months in these: https://en.wikipedia.org/wiki/Environmental_Sample_Processor
One thing a forgot to mention: The create-patch.sh script turned off the floating point emulation, replacing it with VFP. This is incorrect because many ARM926 CPUs to not have any floating point acceleration hardware. Perhaps it could suffice to add help text to the WIREGUARD config option recommending that floating point hardware be used if available.