I have AMD Duron processor which does not support SSE: vendor_id : AuthenticAMD cpu family : 6 model : 3 model name : AMD Duron(tm) processor stepping : 1 cpu MHz : 951.632 cache size : 64 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow bogomips : 1903.26 clflush size : 32 cache_alignment : 32 address sizes : 36 bits physical, 32 bits virtual power management: But compiling media-libs/x264-0.0.20111220 with USE="custom-cflags threads" creates a binary which uses SSE instructions resulting in run-time error: [libx264 @ 0x92af240] your cpu does not support SSE1, but x264 was compiled with asm support [libx264 @ 0x92af240] to run x264, recompile without asm support (configure --disable-asm) This is because x264 configure script injects "-msse" into CFLAGS: case $host_cpu in i*86) ARCH="X86" AS="yasm" ASFLAGS="$ASFLAGS -O2" if [ $compiler = GNU ]; then if [[ "$asm" == auto && "$CFLAGS" != *-march* ]]; then CFLAGS="$CFLAGS -march=i686" fi if [[ "$asm" == auto && "$CFLAGS" != *-mfpmath* ]]; then CFLAGS="$CFLAGS -mfpmath=sse -msse" fi else [...] esac and encoder/encoder.c code looks like: static int x264_validate_parameters( x264_t *h, int b_open ) { #if HAVE_MMX #ifdef __SSE__ if( b_open && !(x264_cpu_detect() & X264_CPU_SSE) ) { x264_log( h, X264_LOG_ERROR, "your cpu does not support SSE1, but x264 was compiled with asm support\n"); #else if( b_open && !(x264_cpu_detect() & X264_CPU_MMX2) ) { x264_log( h, X264_LOG_ERROR, "your cpu does not support MMXEXT, but x264 was compiled with asm support\n"); #endif x264_log( h, X264_LOG_ERROR, "to run x264, recompile without asm support (configure --disable-asm)\n"); return -1; } #endif I think ebuilds CLFAGS hack: if use custom-cflags; then local cflags cflags="$(grep "^CFLAGS=" config.mak | sed 's/CFLAGS=//')" does not catch this occurrence. I think harnessing USE flags "sse" or "mmx" would be more appropriate.
Created attachment 310215 [details, diff] Fix This is yet another CFLAGS hack to remove SSE options if USE="custom-cflags -sse".
+ 01 Aug 2013; Alexis Ballier <aballier@gentoo.org> x264-9999.ebuild, + +files/x264-cflags.patch: + Do not mess too much with CFLAGS. Should fix bug #413661 and bug #351219. +