Similar changes are already on the portable branch.
In releases, elfutils-portability.patch is generated from that branch.
If you are building elfutils for a system distribution, you probably
want to apply elfutils-robustify.patch (which is used on Fedora) too.
Thanks,
Roland