See build log
Created attachment 540954 [details] build log
Created attachment 540956 [details] emerge --info
Reported upstream: https://github.com/stella-emu/stella/issues/382
I checked the upstream version, it works.
Please do not close tickets, if the bug is still unfixed.
Fixed in 5.1.3 ebuild.