When trying to emerge ffmpeg compiling fails with the following error: (I've just provided error from 0.4.9_pre1) # emerge -u media-video/ffmpeg ... V_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/fdct_mmx.o i386/fdct_mmx.c gcc -Wall -O2 -march=pentium4 -fweb -fpeel-loops -funswitch-loops -pipe -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/cputest.o i386/cputest.c gcc -Wall -O2 -march=pentium4 -fweb -fpeel-loops -funswitch-loops -pipe -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/dsputil_mmx.o i386/dsputil_mmx.c i386/dsputil_mmx.c: In function `dsputil_init_mmx': i386/dsputil_mmx.c:2540: warning: assignment from incompatible pointer type i386/dsputil_mmx.c:2541: warning: assignment from incompatible pointer type i386/dsputil_mmx.c: In function `h263_h_loop_filter_mmx': i386/dsputil_mmx.c:634: error: can't find a register in class `GENERAL_REGS' while reloading `asm' make[1]: *** [i386/dsputil_mmx.o] Error 1 make[1]: Leaving directory `/tmp/portage/ffmpeg-0.4.9_pre1/work/ffmpeg-0.4.9-pre1/libavcodec' make: *** [lib] Error 2 Reproducible: Always Steps to Reproduce: Just compile on a gentoo box with my USE flags. HOWTO fix: USE="-mmx" -u emerge media-video/ffmpeg will make the build successful. So the mmx flag should be masked for the failing builds. Portage 2.0.51_rc1 (!/usr/portage/profiles/default-x86-1.4, gcc-3.4.2, glibc-2.3.4.20040808-r0, 2.6.8.1-ck6 i686) ================================================================= System uname: 2.6.8.1-ck6 i686 Intel(R) Pentium(R) 4 Mobile CPU 1.80GHz Gentoo Base System version 1.5.3 distcc 2.17 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.15.90.0.1.1-r3 Headers: sys-kernel/linux26-headers-2.6.8.1 Libtools: sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=pentium4 -fweb -fpeel-loops -funswitch-loops -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/share/config:/usr/kde/3.3/env:/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -fweb -fpeel-loops -funswitch-loops -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ http://ftp.easynet.nl/mirror/gentoo/" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/tmp" PORTDIR="/home/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X Xaw3d acpi alsa apache2 apm arts avi berkdb bitmap-fonts bonobo cdr cjk crypt cups dga directfb dmx dvd encode esd evo fbcon foomaticdb gb gdbm gif gnome gpm gstreamer gtk gtk2 imap imlib java jikes joystick jpeg kde kerberos ldap libg++ libwww mad mcal mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl oss pam pcmcia pda pdflib perl png pnp python qt quicktime readline samba sdl slang socks5 spell sse ssl svga tcltk tcpd tiff truetype trusted unicode usb videos wmf wxwindows x86 xml2 xmms xosd xprint xv zlib"
It emerged just fine for me. Portage 2.0.51-r2 (default-linux/x86/2004.3, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.8-gentoo-r3 i686) ================================================================= System uname: 2.6.8-gentoo-r3 i686 AMD Athlon(tm) XP 1600+ Gentoo Base System version 1.4.16 Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.14.90.0.8-r1 Headers: sys-kernel/linux26-headers-2.6.8.1 Libtools: sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache distlocks sandbox sfperms" GENTOO_MIRRORS="ftp://ftp.roedu.net/pub/mirrors/gentoo.org http://gentoo.oregonstate.edu" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync1.ro.gentoo.org/gentoo-portage" USE="3dnow 3dnowex X aalib alsa apache apm avi bitmap-fonts cdr crypt cups curl encode f77 faac faad fam flac foomaticdb gd geoip gif gphoto2 gpm gtk2 guile imagemagick imlib imlib2 jikes jpeg lcms libcaca libwww lzo mad matroska mikmod mmx motif mpeg mysql ncurses network nls no_wxgtk1 oggvorbis opengl pam png python quicktime readline rtc ruby sdl slang spell sse ssl tcpd tga theora tiff truetype x86 xchatdccserver xml2 xmms xv xvid zlib"
Rencently I did an "emerge -uD world" which gave me an update to mplayer-1.0_pre5-r4. But emerging mplayer did not work, it always stopped with the same error as described above. I did not find any solution to my problem, so I gave it up and masked mplayer-1.0_pre5-r4. Just a week ago, I had to do an "emerge -eD world" and ffmpeg-0.4.9_pre1 was RE-emerged. No success: exactly the same error as mentioned before, something with libavcodec. So I tried emerging ffmpeg-0.4.9_pre1 with USE="-mmx" and that did the trick: ffmpeg emerged fine. After that I tried to emerge mplayer-1.0_pre5-r4 and there were no problems. tekknokaetzi@hardcore ~ $ emerge --info Portage 2.0.51-r3 (gcc34-x86-2004.2, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.9-nitro4 i686) ================================================================= System uname: 2.6.9-nitro4 i686 Intel(R) Pentium(R) 4 CPU 1400MHz Gentoo Base System version 1.6.6 Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.15.92.0.2-r2,sys-devel/binutils-2.15.92.0.2-r1 Headers: sys-kernel/linux26-headers-2.6.8.1-r1 Libtools: sys-devel/libtool-1.5.2-r7 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-march=pentium4 -mtune=pentium4 -O3 -mmmx -msse -msse2 -pipe -ffast-math -mfpmath=sse -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -funroll-loops -fthread-jumps" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config/usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium4 -mtune=pentium4 -O3 -mmmx -msse -msse2 -pipe -ffast-math -mfpmath=sse -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -funroll-loops -fthread-jumps" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache distlocks sandbox" GENTOO_MIRRORS="ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://gentoo.inode.at/source/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage /usr/local/overlays/gentoo-de /usr/local/overlays/bmg-main" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="X aalib acpi alsa apm arts atm avi bitmap-fonts cdr crypt cups dvd encode esd f77 fbcon flac foomaticdb fortran gdbm gif gpm gtk imagemagick imlib java joystick jpeg kde libg++ libwww mad mikmod mmx motif mpeg ncurses nls oggvorbis oggvoris opengl oss pam pdflib perl png ppds python qt quicktime readline scanner sdl slang spell sse sse2 ssl svga tcltk tcpd tiff truetype wmf wxwindows x86 xml2 xmms xv zlib linguas_de"
This is a CFLAGS issue. Anything above -O2 on Pentium4 is known to fail. and since -O3 pulls in one of these below... 1 of them is known to fail with Pentium4. So... Florian, test by removing one at a time... and let me know which one you removed fixes the issue. You're also not using the most stable of CFLAGS by using these 3. -fweb -fpeel-loops -funswitch-loops Juergen, stop being a rice boy!! Get rid of some of those CFLAGS!! "-march=pentium4 -mtune=pentium4 -O3 -mmmx -msse -msse2 -pipe -ffast-math -mfpmath=sse -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -funroll-loops -fthread-jumps" mtune is implied by march. mmmx, msse, msse2 is implied by march pentium4 thread-jumps = totally unsafe. mfpmath=sse = might break ASM.
had same problem with my system; however, I have a 32bit Athlon64 system. CFLAGS only "-march=athlon64 -O3 -pipe". I change from -O3 to -O2 and it works fine.
Just now fixed this with a hardened gcc compatible patch. Please note that it DISABLES mmx if pic is enabled. That means if you want it to copmile, it will.. but it will be slow (as pic relocation tends to slow video apps down noticeably).