Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 86843 - ffmpeg-0.4.9_p20050226-r3 fails to compile with mmx support enabled
Summary: ffmpeg-0.4.9_p20050226-r3 fails to compile with mmx support enabled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
: 86845 86855 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-27 03:24 UTC by Hagai Kariti
Modified: 2005-04-26 07:02 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
remove warnings and compile/link errors (ffmpeg-0.4.7-clean.diff,23.48 KB, patch)
2005-03-28 10:48 UTC, Thomas
Details | Diff
ffmpeg-0.4.9_p20050226-r4--typo.patch (ffmpeg-0.4.9_p20050226-r4--typo.patch,904 bytes, patch)
2005-04-22 05:46 UTC, TGL
Details | Diff
ffmpeg-0.4.9_p20050226-r4--mmx-ewarns.patch (ffmpeg-0.4.9_p20050226-r4--mmx-ewarns.patch,839 bytes, patch)
2005-04-22 06:50 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hagai Kariti 2005-03-27 03:24:49 UTC
When I emerged ffmpeg with CFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -pipe -ftracer" I got this error:
i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -O3 -march=pentium4 -fomit-frame-pointer -pipe -ftracer -fPIC -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/vp3dsp_sse2.o i386/vp3dsp_sse2.c
i386/dsputil_mmx.c: In function `dsputil_init_mmx':
i386/dsputil_mmx.c:3076: warning: assignment from incompatible pointer type
i386/dsputil_mmx.c:3077: warning: assignment from incompatible pointer type
i386/dsputil_mmx.c: In function `put_qpel8_mc10_3dnow':
T_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o dpcm.o dpcm.c
...skipping...
i386/dsputil_mmx_avg.h:105: error: can't find a register in class `BREG' while reloading `asm'
i386/dsputil_mmx.c: At top level:
i386/dsputil_mmx_rnd.h:59: warning: 'put_no_rnd_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_no_rnd_pixels16_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:300: warning: 'avg_no_rnd_pixels4_mmx' defined but not used
i386/dsputil_mmx_rnd.h:59: warning: 'put_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_pixels16_l2_mmx' defined but not used
make[1]: *** [i386/dsputil_mmx.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/ffmpeg-0.4.9_p20050226-r2/work/ffmpeg-0.4.9-p20050226-shared/libavcodec'
make: *** [lib] Error 2

When emerging with CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe -ftracer" I got this error:

i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -O2 -march=pentium4 -fomit-frame-pointer -pipe -ftracer -fPIC -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/simple_idct_mmx.o i386/simple_idct_mmx.c
i386/dsputil_mmx.c: In function `dsputil_init_mmx':
i386/dsputil_mmx.c:3076: warning: assignment from incompatible pointer type
i386/dsputil_mmx.c:3077: warning: assignment from incompatible pointer type
i386/dsputil_mmx_avg.h: In function `put_pixels4_l2_3dnow':
i386/dsputil_mmx_avg.h:58: error: can't find a register in class `BREG' while reloading `asm'
i386/dsputil_mmx.c: At top level:
i386/dsputil_mmx_rnd.h:59: warning: 'put_no_rnd_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_no_rnd_pixels16_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:300: warning: 'avg_no_rnd_pixels4_mmx' defined but not used
i386/dsputil_mmx_rnd.h:59: warning: 'put_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_pixels16_l2_mmx' defined but not used
make[1]: *** [i386/dsputil_mmx.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/ffmpeg-0.4.9_p20050226-r2/work/ffmpeg-0.4.9-p20050226-shared/libavcodec'
make: *** [lib] Error 2


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2005-03-27 03:47:40 UTC
*** Bug 86845 has been marked as a duplicate of this bug. ***
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2005-03-27 06:01:34 UTC
*** Bug 86855 has been marked as a duplicate of this bug. ***
Comment 3 Thomas 2005-03-28 07:53:06 UTC
I think this is because the "-mmmx" compiler switch is not present. You could try to add "-mmmx" to your CFLAGS and CXXFLAGS and see if that works. If so, the maintainer of the ebuild might consider to add something like the following line to the ebuild file:

use mmx && append-flags -mmmx

This worked at least for me (athon-xp architecture)...
Comment 4 Thomas 2005-03-28 10:48:53 UTC
Created attachment 54694 [details, diff]
remove warnings and compile/link errors
Comment 5 Thomas 2005-03-28 10:49:51 UTC
well, I digged a bit deeper into the problem and found several things that go wrong, wspecially with gcc-3.4. I also found out that the compiler does not mark some "static" symbols as used, although they are used in inline assembler, which leads to unresolved symbols when linking.

I attached a patch that should solve this, and also makes the source compile without warnings...
Comment 6 Hans-Christian Armingeon 2005-03-29 06:20:14 UTC
could you please update your patch for media-video/ffmpeg-0.4.9_p20050226-r2 ?

Johnny
Comment 7 Luca Barbato gentoo-dev 2005-03-29 15:51:42 UTC
could you please remove -ftracer?
Comment 8 Chris White (RETIRED) gentoo-dev 2005-03-31 10:43:52 UTC
Hrmm.. bunch of test cases requested.  I fixed most of the BREG errors with some pic patches.  Closing as TEST-REQUEST and please let me know if things persist.  Thanks for reporting and using Gentoo!
Comment 9 Hans-Christian Armingeon 2005-04-04 10:09:57 UTC
Did you change anything in the portage tree?

I still have the same problems.
Comment 10 Giacomo Perale 2005-04-18 18:05:45 UTC
same problem with current ebuild in portage (ffmpeg-0.4.9_p20050226-r3) and mmx support enabled (by default in my system it is disabled, see #89172)
Comment 11 Hans-Christian Armingeon 2005-04-19 13:01:34 UTC
Well, I was able to merge ffmpeg.
I did some dirty ahcks, an I don't know what I really did. Here's the lines from my bashhistory.

Can somebody explain, what hte problem is? I called gcc manually.

JOhnny

  502  cd /var/tmp/portage/ffmpeg-0.4.9_p20050226-r3/work/ffmpeg-0.4.9-p20050226-shared/libavcodec
  503  i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -m32 -O3 -mtune=athlon-4 -fomit-frame-pointer -funroll-loops -pipe -mmmx -fno-pie -fPIC -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/vp3dsp_sse2.o i386/vp3dsp_sse2.c
  504  cd -
  505  ebuild /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_p20050226-r3.ebuild compile
  506  cd /var/tmp/portage/ffmpeg-0.4.9_p20050226-r3/work/ffmpeg-0.4.9-p20050226-shared/libavcodec
  507  i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -m32 -O3 -mtune=athlon-4 -fomit-frame-pointer -funroll-loops -pipe -mmmx -fno-pie -fPIC -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
  508  i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -m32 -O3 -mtune=athlon-4 -fomit-frame-pointer -funroll-loops -pipe -mmmx -m3dn -fno-pie -fPIC -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
  509  i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -m32 -O3 -mtune=athlon-4 -fomit-frame-pointer -funroll-loops -pipe -mmmx -m3dnow -fno-pie -fPIC -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
  510  i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -m32 -O3 -mtune=athlon-4 -fomit-frame-pointer -funroll-loops -pipe -mmmx  -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
  511  ebuild /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_p20050226-r3.ebuild compile
  512  ebuild /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_p20050226-r3.ebuild install
  513  ebuild /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_p20050226-r3.ebuild qmerge
  514  ebuild /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_p20050226-r3.ebuild clean
Comment 12 TGL 2005-04-20 18:37:01 UTC
Same error as in initial report, with both -r2 or -r3:

i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -march=i686 -mtune=pentium-m -O2 -fomit-frame-pointer -pipe -fPIC -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:3076: warning: assignment from incompatible pointer type
i386/dsputil_mmx.c:3077: warning: assignment from incompatible pointer type
i386/dsputil_mmx_avg.h: In function `put_pixels4_l2_3dnow':
i386/dsputil_mmx_avg.h:58: error: can't find a register in class `BREG' while reloading `asm'
i386/dsputil_mmx.c: At top level:
i386/dsputil_mmx_rnd.h:59: warning: 'put_no_rnd_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_no_rnd_pixels16_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:300: warning: 'avg_no_rnd_pixels4_mmx' defined but not used
i386/dsputil_mmx_rnd.h:59: warning: 'put_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_pixels16_l2_mmx' defined but not used
make[1]: *** [i386/dsputil_mmx.o] Error 1

This is with:
 - gcc-3.4.3-20050110
 - "-aac (-altivec) -debug -doc -dv +dvd +encode +imlib +mmx +oggvorbis +oss -threads +truetype +v4l +xvid" for USE flags
 - CFLAGS="-march=i686 -mtune=pentium-m -O2 -fomit-frame-pointer -pipe" (but the same happens with empty CFLAGS).

As a workaround, it compiles fine without the "mmx" USE flag, but that's not really an acceptable solution.

Could someone reopen this report?
Thanks.
Comment 13 Hagai Kariti 2005-04-21 03:13:08 UTC
Hmm... With USE="-mmx" it compiles, altough I have -mmmx in my CFLAGS... I guess that would have to be enough until it's fixed (or until Thomas updates his patch :))...
Comment 14 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-21 03:28:27 UTC
Please try with latest -r3
and paste emerge info for every report of success/failure.
Comment 15 TGL 2005-04-21 04:27:58 UTC
My failure report from comment #12 was with the latest version currently in the tree ("ffmpeg-0.4.9_p20050226-r3.ebuild,v 1.4 2005/04/19 20:14:01 lu_zero").

Here my complete emerge info in case i forgot something relevant:
Portage 1.585-cvs (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.11-tgl2 i686)
=================================================================
System uname: 2.6.11-tgl2 i686 Intel(R) Pentium(R) M processor 1500MHz
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Feb 17 2005, 23:21:20)]
distcc: No such file or directory [disabled]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.5, 1.7.9-r1, 1.9.5, 1.8.5-r3, 1.4_p6, 1.6.3
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="no"
CFLAGS="-march=i686 -mtune=pentium-m -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/cursors/xfree/default /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/X11/Sessions /etc/dev.d /etc/env.d /etc/gconf /etc/hotplug /etc/hotplug.d /etc/init.d /etc/sound /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=i686 -mtune=pentium-m -O2 -fomit-frame-pointer -pipe"
DISTDIR="/var/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache digest distlocks fixpackages manifest parallel-fetch sandbox sfperms userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirror.sdv.fr http://mir.zyrianes.net/gentoo http://distro.ibiblio.org/pub/linux/distributions/gentoo ftp://ftp.ussg.iu.edu/linux/gentoo"
LANG="en_US"
LC_ALL="en_US"
LINGUAS="fr fr_FR en en_US"
MAKEOPTS="-j2"
PKGDIR="/var/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage/tree"
PORTDIR_OVERLAY="/var/portage/overlays/bugzilla /var/portage/overlays/tgl /var/portage/overlays/demexp /var/portage/overlays/portage-cvs"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 X Xaw3d a52 aac aalib acpi adns alsa apache2 apm audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdparanoia cdr cross crypt cscope cups curl dba dga dpms dvd dvdr emboss encode esd faad fbcon ffmpeg flac flagB flash foomaticdb fortran freetype gd gdbm ggz gif gnome gnomedb gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hal howl imagemagick imap imlib imlib2 ipv6 java jikes jpeg junit lcms leim libcaca libg++ libwww lirc lzo mad mailwrapper matroska mbox memlimit mikmod mmx mng mozilla mp3 mpeg ncurses nls nptl offensive ogg oggvorbis openal opengl oss pam pdflib perl plotutils png pnp postgres python qt quicktime readline ruby ruby18 scanner sdl slang slp smooth snmp speex spell sqlite sse sse2 ssl svg svga tcltk tcpd tetex theora tiff tmpfs truetype truetype-fonts type1-fonts unicode usb v4l v4l2 vorbis win32codecs wmf wxwindows xface xfs xinerama xml xml2 xosd xprint xv xvid zeo zlib video_cards_radeon input_devices_synaptics linguas_fr linguas_fr_FR linguas_en linguas_en_US"
Unset:  ASFLAGS, CBUILD, CTARGET, LDFLAGS
Comment 16 MAL 2005-04-21 05:12:23 UTC
-r3 gives me the same problem.

Portage 2.0.51.19 (default-linux/x86/2005.0/2.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.26-procyon1 i686)
=================================================================
System uname: 2.4.26-procyon1 i686 Intel(R) Pentium(R) 4 CPU 2.66GHz
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Apr  5 2005, 22:07:10)]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.9.4, 1.8.5-r3, 1.7.9-r1, 1.5, 1.6.3, 1.4_p6
sys-devel/binutils:  2.15.90.0.1.1-r3
sys-devel/libtool:   1.4.3-r1, 1.5.2-r7
virtual/os-headers:  2.4.19-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -mcpu=pentium4 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /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=pentium4 -mcpu=pentium4 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.heanet.ie/pub/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://192.168.0.2/gentoo-portage"
USE="x86 apache2 apm berkdb bitmap-fonts crypt cups directfb edl emboss encode fbcon foomaticdb fortran gdbm gif gpm imagemagick jpeg libg++ libwww mikmod mmx mmxext motif mp3 mpeg ncurses nls oss pam pdflib perl png qt readline rtc slang spell sse sse2 ssl tcpd tiff truetype truetype-fonts type1-fonts xml2 zlib video_cards_i8x0 video_cards_nvidia video_cards_radeon video_cards_matrox"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 17 Hagai Kariti 2005-04-21 07:25:55 UTC
I, too, use the -r3 release. emerge info:

Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.10-lxnay3 i686)
=================================================================
System uname: 2.6.10-lxnay3 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 20 2005, 18:08:28)]
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe -msse -msse2 -mmmx -mfpmath=sse,387"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /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 -fomit-frame-pointer -pipe -msse -msse2 -mmmx -mfpmath=sse,387 -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.hamakor.org.il/pub/mirrors/gentoo/"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://mirror.hamakor.org.il/gentoo-portage"
USE="x86 X a52 aac aalib acl acpi alsa apm avi bash-completion berkdb bidi bitmap-fonts bmp bzlib cdparanoia cdr cracklib crypt cups dv dvd dvdr emboss encode esd exif fam ffmpeg flac foomaticdb ftp gdbm gif gnome gnutls gphoto2 gpm gstreamer gtk gtk2 hal icq imagemagik imap imlib jpeg lcms libcaca libg++ libwww mad maildir mikmod mime mmx mozilla mp3 mpeg msn ncurses nls nptl nptlonly offensive ogg oggvorbis opengl oscar pam pcre pdflib perl png posix python quicktime readline samba sasl scanner sdl sharedmem snmp sockets spell sse sse2 ssl svg svga sysfs tcltk tcpd tiff truetype truetype-fonts type1-fonts unicode usb vcd videos vorbis xine xml2 xv xvid zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LINGUAS
Comment 18 MAL 2005-04-21 08:06:38 UTC
I was using gcc-3.2.3

Updated to gcc-3.3.5-20050130, ran "gcc-config i686-pc-linux-gnu-3.3.5-20050130", and "fix_libtool_files.sh 3.2.3", and now I can emerge ffmpeg-0.4.9_p20050226-r3 fine.
Comment 19 Jabari R. Roberts 2005-04-21 08:24:52 UTC
Same error for me in -r3. Running MAL's fix in comment 18 (for me using gcc's 3.3.5 and 3.4.3, the latter of which I had for a while) didn't work.
Not sure if the line above most of the other errors we've seen here is relevant, though -- observe (start at mpegvideo_mmx_template.c):

i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -march=athlon-tbird -O3 -pipe -fPIC -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o oggvorbis.o oggvorbis.c
i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -march=athlon-tbird -O3 -pipe -fPIC -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/fdct_mmx.o i386/fdct_mmx.c
oggvorbis.c: In function `oggvorbis_decode_frame':
oggvorbis.c:246: warning: unused variable `i'
i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -march=athlon-tbird -O3 -pipe -fPIC -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/cputest.o i386/cputest.c
i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -march=athlon-tbird -O3 -pipe -fPIC -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
i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -march=athlon-tbird -O3 -pipe -fPIC -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/mpegvideo_mmx.o i386/mpegvideo_mmx.c
i386/mpegvideo_mmx_template.c: In function `dct_quantize_MMX':
i386/mpegvideo_mmx_template.c:93: error: can't find a register in class `GENERAL_REGS' while reloading `asm'
make[1]: *** [i386/mpegvideo_mmx.o] Error 1
make[1]: *** Waiting for unfinished jobs....
i386/dsputil_mmx.c: In function `dsputil_init_mmx':
i386/dsputil_mmx.c:3076: warning: assignment from incompatible pointer type
i386/dsputil_mmx.c:3077: warning: assignment from incompatible pointer type
i386/dsputil_mmx.c: In function `put_qpel8_mc10_3dnow':
i386/dsputil_mmx_avg.h:105: error: can't find a register in class `BREG' while reloading `asm'
i386/dsputil_mmx.c: At top level:
i386/dsputil_mmx_rnd.h:59: warning: 'put_no_rnd_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_no_rnd_pixels16_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:300: warning: 'avg_no_rnd_pixels4_mmx' defined but not used
i386/dsputil_mmx_rnd.h:59: warning: 'put_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_pixels16_l2_mmx' defined but not used
make[1]: *** [i386/dsputil_mmx.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/ffmpeg-0.4.9_p20050226-r3/work/ffmpeg-0.4.9-p20050226-shared/libavcodec'
make: *** [lib] Error 2

Here's my emerge --info:

Gentoo Base System version 1.6.11
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.11-gentoo-r6 i686)
=================================================================
System uname: 2.6.11-gentoo-r6 i686 AMD Athlon(tm) processor
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Feb 18 2005, 12:19:36)]
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-tbird -O3 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=athlon-tbird -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://mirrors.acm.cs.rpi.edu/gentoo/ http://gentoo.ccccom.com http://open-systems.ufl.edu/mirrors/gentoo http://gentoo.chem.wisc.edu/gentoo/"
LINGUAS="en ja ko zh_TW zh_CN"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 16bit 3dnow 3dnowex 3dnowext 3ds S3TC X Xaw3d a52 aac aalib aavm abook accounting acpi acpi4linux aim aliaschain alsa amd ao aotuv apache2 apm arts artswrappersuid artworkextra async athena atlas audiofile authdaemond avantgo avi bash-completion bcmath bdf beepmp berkdb bidi bitmap-fonts blender-game bmp bonobo boundschecking bzip2 bzlib cairo canna cddb cdf cdparanoia cdr cdrom chroot cjk clamav clanJavaScript clanVoice cln codecs crypt cscope css cups curl curlwrappers dedicated dga dhcp dict dillo dio directfb distcache divx4linux djbfft dmalloc dnd doc dpms dts dv dvd dvdr dvdread ecc editor edl eds elf emacs emacs-w3 emboss emoticon encode escreen esd estraier etwin evms2 examples exif exim expat f2c fam fame fastcgi fax fb fbcon fbdev festival ffmpeg fftw fits flac flash flood fltk fluidsynth fmod foomaticdb fortran fpx freetype ftp gb gcj gd gdbm geoip ggi gif gimp gimpprint ginac gkrellm glade glgd glitz glut gmtfull gmthigh gmtsuppl gmttria gnokii gnome gnomedb gnuplot gphoto2 gpm graphviz 
ithreads jabber java javascript jbig jce jikes joystick jp2 jpeg jpeg2k justify kadu-modules kadu-voice kakasi kde kipi koffice-plugin largeterminal latex lcms ldirectord leim libcaca libclamav libdsk libg++ libsamplerate libwww live lm_sensors lua lzo lzw lzw-tiff m17n-lib mad maps matroska md5sum memlimit messages mew migemo mikmod milter mime mimencode ming mixer mjpeg mmap mmx
mmx2 mmxext mng modcache modchat monkey motif mozilla mozp3p mp3 mpeg mpi mplayer mpm-leader mpm-metux mpm-peruser mpm-prefork mpm-threadpool mpm-worker msn mule multi-tty music mysql mysqli mythtv mzscheme nagios-dns nagios-ntp nagios-ping nagios-ssh nas
ncurses net netbeans netcdf nethack network neural nls nntp nptl nptlonly ntlm nviz oav objc offensive ogg oggvorbis openal openexr opengl oscar oss pam pam_chroot pam_console pam_timestamp parse-clocks pcntl pcre pda pdf pdfkit pdflib perl physfs playlist plotutils png portaudio povray ppds private pthreads pvm python qemu-fast qhull qt quicktime rdesktop readline real recode remote rogue rplay rpm rtc ruby samba sample scanner sdk sdl session sftplogging shaper shared sharedmem sheep silc silverxp slang smime smtp smux sndfile snmp sockets socks5 sounds sox spamassassin speedo speex spell src srp ssl stats stencil-buffer svg svga
symlink szip t1lib tcltk tcpd tetex tga theora threads thumbnail tidy tiff timidity toolbar tools transcode translator truetype
truetype-fonts type1 type1-fonts uim underscores unicode uptimed usb uudeview v4l v4l2 vcd vcdimager videos vidix vim vim-pager
vim-with-x virus-scan voice vorbis wildlsearch win32codecs withsamplescripts wma123 wmf wxwindows xanim xatrix xchattext xemacs
xface xforms xine xinerama xml xml2 xmms xosd xpm xrandr xscreensaver xsl xv xvid yahoo yv12 zeroconf zlib zvbi video_cards_radeon linguas_en linguas_ja linguas_ko linguas_zh_TW linguas_zh_CN"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 20 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-21 08:53:35 UTC
Comment #17 is invalid report for me, turn down that cflags please. In particulare visibility stuff is *known* broken.

I wasn't able to reproduce this problem asking to other users, I'll setup a 32-bit chroot to test them now.
Changing severity to major as this version is now stable.
Comment 21 Luca Barbato gentoo-dev 2005-04-21 13:13:18 UTC
Jabari try to add -fomit-frame pointer and/or move to -O2
Comment 22 Luca Barbato gentoo-dev 2005-04-21 13:19:33 UTC
just to mention, if you use PIC you should not use mmx. It won't work.
Comment 23 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-21 14:47:40 UTC
Everyone had trouble with this, try -r4 and see if it works better.
Comment 24 Giacomo Perale 2005-04-21 16:38:01 UTC
Am I the only one who had to edit the ebuild, removing the has_pic check, to enable mmx support?
however, -r4 compiles without problems
Comment 25 Luca Barbato gentoo-dev 2005-04-21 17:42:13 UTC
Just to make it clear:

x86 has just few registers and some general purpose are used for many ABI related stuff, basically if you use -fomit-frame-pointer you free one more, if you use -fPIC you need one more, if you use mmx you need some more (depending on what you are doing I'm afraid).

Sometimes the upstream authors take care of that just adding some -DPIC conditional code that fix the problematic part (adding some overhead).
Comment 26 Jabari R. Roberts 2005-04-21 19:23:22 UTC
-r4 compiles with no problems here (with the same CFLAGS as before).  Thanks very much!

A note about -fomit-frame-pointer though: according to the GCC manual for 3.4.3, it's enabled for the following -O levels:
"Enabled at levels -O, -O2, -O3, -Os."
(See "3.10: Options that control optimization.")

so it looks like I (and just about everybody using Gentoo on 3.4.3) has it turned on already. Just an observation... o_-
Comment 27 Luca Barbato gentoo-dev 2005-04-22 02:31:04 UTC
looks like sometimes I have to review the gcc manpage myself.
Comment 28 TGL 2005-04-22 05:45:15 UTC
About -r4:

 * the first bad news is that it unconditionaly disable mmx on non-amd64 because of a bash typo. I will attach a patch that fixes it. That means that people who have already tested it should redo their tests, because in its current state it was just like having USE="-mmx".

 * the good news is that it still compiles fine with mmx support added back and CFLAGS="-march=pentium-m -O2 -fomit-frame-pointer -pipe"

 * the other bad news is that it then fails again with CFLAGS="-march=i686 -mtune=pentium-m -O2 -pipe" (same error as reported before). Lucas' explanation is right, and I think the gcc manpage is a bit missleading about -O* turning on -fomit-frame-pointer. The point is that it also says:
  "-O also turns on -fomit-frame-pointer on machines where doing so does not
   interfere with debugging."
Sure, on x86, it does interfere, so no, it is not turned on by default. Maybe an acceptable fix would be an "append-flag" for x86 when mmx is on.
Comment 29 TGL 2005-04-22 05:46:49 UTC
Created attachment 56914 [details, diff]
ffmpeg-0.4.9_p20050226-r4--typo.patch

Fixes the bash typo in the enable/disable-mmx condition. Also adds "sdl" to
IUSE.
Comment 30 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-22 06:14:49 UTC
Thanks, fixed the typo on CVS.

I don't like adding -fomit-frame-pointer to the complete ebuild, as it bails out debug support, so I think it's better to leave it up to users who has problems (and there aren't so much) to fix it.
Comment 31 TGL 2005-04-22 06:50:07 UTC
Created attachment 56918 [details, diff]
ffmpeg-0.4.9_p20050226-r4--mmx-ewarns.patch

> I don't like adding -fomit-frame-pointer to the complete ebuild, as it bails
> out debug support, so I think it's better to leave it up to users who has 
> problems (and there aren't so much) to fix it.

Ok for not forcing -fomit-frame-pointer, but i don't think the average user can
guess he should add it to it's CFLAGS to make this ebuild compile.

What about something like this patch then? It would:
 - disable MMX in case of PIC or lack of -fomit-frame-pointer (so that it
compiles for everyone)
 - ewarn the user about why he can't have MMX support (so that he knows what to
change if he really wants it)
Comment 32 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-22 06:59:04 UTC
mmx *is* disabled when pic is enabled.
the problem here noted is mainly relative to combinations of cflags which uses the registers in different ways.
Comment 33 TGL 2005-04-22 07:06:24 UTC
> mmx *is* disabled when pic is enabled.

Yep, i know. My patch doesn't try to change that behavior, it just adds the ewarn so that user knows that his USE flag can't be honored.
And where the behavior changes is only in case fomit-frame-pointer lacks (instead of failing to build, it will do just like for pic: disable mmx and warn the user). 
Comment 34 Jabari R. Roberts 2005-04-22 08:39:20 UTC
I experienced the same things in comment 28 that TGL experienced; just noticed that MMX wasn't enabled when I had to recompile (for something different).
The new -r4 plus -fomit-frame-pointer works for me completely now.
Sorry about the misleads; must RTFM harder... ^_^
Comment 35 Giacomo Perale 2005-04-22 11:38:35 UTC
sorry for insisting on this, but I need some explanations on has_pic. this check is inherited from flag-o-matic.eclass, where I can read:

has_pic() {
        [ "${CFLAGS/-fPIC}" != "${CFLAGS}" ] && return 0
        [ "${CFLAGS/-fpic}" != "${CFLAGS}" ] && return 0
        [ "$(echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep __PIC__)" ] && return
0
        test_version_info pie && return 0
        return 1
}

If I understand correctly, first two checks in this function return 0 when -fPIC/fpic isn't in $CFLAGS, otherwise the function returns 1. What does [ "$(echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep __PIC__)" ] mean?
Comment 36 Giacomo Perale 2005-04-22 13:05:58 UTC
ok, I figured that it returns 0 when __PIC__ is in a list of #define. So this function return 0 when 

a) -fPIC or -fpic is in CFLAGS
b) __PIC__ is in a list of #define (I suppose valid for all system)

and 1 when both these conditions are false. So has_pic is true (0) when pic is enabled, and false (1) when pic is not enabled, and in this ebuild mmx is enabled when has_pic = 1 ==> ! has_pic = 0. Still I can't understand why in my system mmx is always disabled, but my CFLAGS don't contain -fPIC nor there is __PIC__ in the output of echo etc.etc.
Comment 37 Carsten Lohrke (RETIRED) gentoo-dev 2005-04-26 07:02:38 UTC
The problem is that 'test_version_info pie' returns 0 on a non pic box, Bug 90391