With multilib systems, the 2nd arch run will return false when tc-is-lto is called since filter-lto was called in the previous one. On my system it builds x86 first, which skips LTO due to previous bugs, but still calls filter-lto which means when it gets to build amd64 tc-is-lto will return false and skip LTO. I did check an object file with readelf -S when it should have compiled with LTO and it did not. I did try moving the LTO stuff to src_prepare (anything only called once before src_configure will work, but I thought it made sense to do it there)
Created attachment 883955 [details] Fixed ffmpeg ebuild This is what I ended up doing which works out fine (verified with checking object files with readelf -S)
Created attachment 883956 [details] Min-repo ebuild demonstrating issue
Created attachment 883957 [details] Min-repo ebuild eclass-debug.log
I couldn't find any other multilib packages in the tree that has this issue, but media-libs/x264 would if LTO support was added (they support LTO as a config flag) which does make me wonder if pkg_setup would be a better place to do a fix like this.