David,
Here are 3 patches that we can apply on Gentoo linux in order to either compile with our musl profile[1] or comply with Gentoo QA. Two of these issues were discovered after your patch 15 and are not related to the previous issue with gcc-10.
I am not too inclined to turn the Make file into a Gentoo specific file. It (the Make file) is ugly, and I would change some things if needed, but it is really written for me (at this point in time). I ran across some changes when I was creating the one for my SDL port. I use the -g option for debugging information. I don't normally install the executable, but stripping the debug information before the install is reasonable.
It seems that the patch about ldflags was around since patch 09. I'm sorry for not telling about this one at the time.
We don't have any LDFLAGS, so why use it? Do we need the generality that it adds? One thing that may help is to use the -std=C99 option. I have that selected in the IDE I use for the SDL port.
Please let me know if you intend to do something about these. Otherwise we'll package it as is (https://github.com/gentoo/gentoo/pull/16675).
The addition of <fcntl.h> to unix.c doesn't seem to make any difference on my system. What is the benefit? In short, no current plans to update the source. Jonathan