Gentoo has a fix for that: https://bugs.gentoo.org/668670. The actual patch is pretty simple and should be trivial to incorporate.