CFLAGS apparently isn't supported upstream. The configure script tests for a big-endian system by compiling a global integer and dumping the object file as hex. When CFLAGS enables LTO, the value gets optimized out, so PowerPC builds fail due to big-endian macros not getting set. https://github.com/FFmpeg/FFmpeg/blob/master/configure#L5758-L5762 Reproducible: Always Steps to Reproduce: 1. powerpc-gentoo-linux-gnu-emerge -v media-video/ffmpeg # with -flto in CFLAGS Actual Results: ... big-endian no ... src/libavcodec/ppc/audiodsp.c: In function ‘scalarproduct_int16_altivec’: src/libavutil/ppc/util_altivec.h:123:5: error: implicit declaration of function ‘vec_vsx_ld’; did you mean ‘vec_vsel’? [-Werror=implicit-function-declaration] 123 | vec_vsx_ld(offset, b) | ^~~~~~~~~~ ... Expected Results: It should build and install. Fixing this particular problem can be done by filtering out the -flto* flags like below. (The --enable-lto option adds back a plain -flto later, without the jobserver setting.) If that's not doable, then "use ppc && local -x bigendian=yes" also fixes it. --- media-video/ffmpeg/ffmpeg-4.3.1.ebuild +++ media-video/ffmpeg/ffmpeg-4.3.1.ebuild @@ -426,6 +426,7 @@ # LTO support, bug #566282 is-flagq "-flto*" && myconf+=( "--enable-lto" ) + filter-flags "-flto*" # Mandatory configuration myconf=(