Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 56075 - Can't compile gst-plugins-ffmpeg with CFLAGS = -Os
Summary: Can't compile gst-plugins-ffmpeg with CFLAGS = -Os
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
: 60968 62645 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-07-04 11:15 UTC by Ermanno Poggi
Modified: 2004-10-12 09:00 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ermanno Poggi 2004-07-04 11:15:26 UTC
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../libavcodec -DHAVE_AV_CONFIG_H=1 -msse -march=athlon-xp -Os -pipe -MT libmmxsse_la-dsputil_mmx.lo -MD -MP -MF .deps/libmmxsse_la-dsputil_mmx.Tpo -c dsputil_mmx.c  -fPIC -DPIC -o .libs/libmmxsse_la-dsputil_mmx.o
dsputil_mmx.c: In function `h263_h_loop_filter_mmx':
dsputil_mmx.c:614: error: can't find a register in class `INDEX_REGS' while reloading `asm'
make[8]: *** [libmmxsse_la-dsputil_mmx.lo] Error 1
make[8]: Leaving directory `/var/tmp/portage/gst-plugins-ffmpeg-0.8.0/work/gst-ffmpeg-0.8.0/gst-libs/ext/ffmpeg/libavcodec/i386'
make[7]: *** [all-recursive] Error 1
make[7]: Leaving directory `/var/tmp/portage/gst-plugins-ffmpeg-0.8.0/work/gst-ffmpeg-0.8.0/gst-libs/ext/ffmpeg/libavcodec'
make[6]: *** [all-recursive] Error 1
make[6]: Leaving directory `/var/tmp/portage/gst-plugins-ffmpeg-0.8.0/work/gst-ffmpeg-0.8.0/gst-libs/ext/ffmpeg'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/var/tmp/portage/gst-plugins-ffmpeg-0.8.0/work/gst-ffmpeg-0.8.0/gst-libs/ext/ffmpeg'
make[4]: *** [all-local] Error 2
make[4]: Leaving directory `/var/tmp/portage/gst-plugins-ffmpeg-0.8.0/work/gst-ffmpeg-0.8.0/gst-libs/ext'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/gst-plugins-ffmpeg-0.8.0/work/gst-ffmpeg-0.8.0/gst-libs/ext'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/gst-plugins-ffmpeg-0.8.0/work/gst-ffmpeg-0.8.0/gst-libs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/gst-plugins-ffmpeg-0.8.0/work/gst-ffmpeg-0.8.0'
make: *** [all] Error 2

!!! ERROR: media-plugins/gst-plugins-ffmpeg-0.8.0 failed.
!!! Function src_compile, Line 29, Exitcode 2
!!! (no error message)

The compilation stop every time in the same point!!

Reproducible: Always
Steps to Reproduce:
1.emerge gst-ffmpeg
2.with CFLAGS -Os
3.

Actual Results:  
don't compile 

Expected Results:  
compile 

Adding this filter to the ebuild solve the problem 
 
replace-flags "-Os" "-O2" 
 
For me!!
Comment 1 foser (RETIRED) gentoo-dev 2004-07-05 11:10:17 UTC
and your 'emerge info' is ? (read the bugreport form!)
Comment 2 Ermanno Poggi 2004-07-05 12:08:27 UTC
Sorry!!

$ emerge info
Portage 2.0.50-r8 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.7-ck4)
=================================================================
System uname: 2.6.7-ck4 i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -Os -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -Os -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X aalib alsa apm arts artswrappersuid avi bzlib cdr crypt cups dga divx4linux dvd dvdr encode esx exif faac faad fbcon ffmpeg flac freetype gif gimp gimpprint gpm gstreamer gtk2 imagemagick imap imlib2 java javascript jce jpeg kde kerberos krb4 lcms libwww mad maildir matroska mikmod mldonkeypango mmx monkey motif mozilla moznocompose moznoirc moznomail mozsvg mpeg mplayer ncurses nls nptl oggvorbis ooo-kde opengl pam pdflib perl pic plotutils png python qt quicktime readline samba scanner sdl slang spell sse ssl svg svga tcltk tcpd tetex theora tiff transcode truetype type1 unicode wmf x86 xine xml2 xmms xv xvid zlib"
Comment 3 Duarte Henriques 2004-07-16 10:43:15 UTC
me too post: compile fails with -Os, works with -O2.

emerge info:
Portage 2.0.50-r9 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.4.20040619-r0, 2.6.7-gentoo-r7)
=================================================================
System uname: 2.6.7-gentoo-r7 i686 AMD Athlon(TM) XP 2800+
Gentoo Base System version 1.5.1
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-Os -march=athlon-xp -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /etc/tomcat /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /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="-Os -march=athlon-xp -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://ftp.rnl.ist.utl.pt/gentoo http://darkstar.ist.utl.pt/gentoo/ http://gentoo.felisberto.net"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/bmg-main"
SYNC="rsync://ftp.rnl.ist.utl.pt/gentoo-portage"
USE="3dnow X alsa apm avi berkdb crypt cups dvd encode esd gdbm gif gimpprint gnome gpm gstreamer gtk gtk2 guile imlib jack java jpeg libg++ libwww mad mikmod mmx mozilla moznocompose moznoirc moznomail mpeg ncurses nls nptl oggvorbis opengl oss pam pdflib perl png python quicktime readline samba sdl slang sse ssl svga tcpd theora truetype x86 xml2 xmms xv zlib"
Comment 4 Kristiaan Lenaerts 2004-08-20 01:16:27 UTC
I think the problem lies with the -falign-functions, it has to be enabled, but without extra arguments. In my CFLAGS I had -falign-functions=4, and I had exactly the same error, after changing that into -falign-functions, the compile went fine.

Because that flag is turned off with -Os, my guess is it's just needed for the compile to succeed.
Comment 5 foser (RETIRED) gentoo-dev 2004-08-20 05:45:31 UTC
*** Bug 60968 has been marked as a duplicate of this bug. ***
Comment 6 Kristiaan Lenaerts 2004-08-21 00:46:58 UTC
You can forget my laast comment, I just tried some optimalisations, it still fails by just adding -falign-functions with -Os but it works after adding -fprefetch-loop-arrays to the CFLAGS
My problem was with -fforce-addr, adding that flag will let the build fail, when editing my CFLAGS to change -falign-funcions, I accidentally deleted the -fforce-addr flag. -falign-functions had no effect on succes or not.

Compile-tests:
-Os => FAILS
-Os -falign-functions => FAILS
-Os -fprefetch-loop-arrays => WORKS
-O2 -fforce-addr => FAILS

the -Os -fprefetch-loop-arrays is a bit strange... on every file, it gives the warning that it is not supported with -Os...

I guess the ebuild should add -fprefetch-loop-arrays if -Os is detected, and it should filter -fforce-addr.
Comment 7 Hammerfall 2004-08-22 06:30:21 UTC
i have the same compilation problem. But i was using an -O3 flag.
i tried using -O2 but the compilation error persists..

this is my emerge info:
root@Valhalla ~ # emerge info
Portage 2.0.50-r10 (default-x86-1.4, gcc-3.3.4, glibc-2.3.4.20040619-r0, 2.6.8-gentoo-r1)
=================================================================
System uname: 2.6.8-gentoo-r1 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz
Gentoo Base System version 1.5.3
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -msse2 -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -msse2 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://mir.zyrianes.net/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/mnt/mobile-linux/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acpi alsa avi berkdb cdr crypt cups dvd encode esd foomaticdb gdbm gif gimpprint gnome gpm gstreamer gtk gtk2 imlib java jpeg ldap libg++ libwww mad mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png ppds python qt quicktime readline samba sdl slang spell sse sse2 ssl svga tcpd tetex truetype usb wifi x86 xml2 xmms xv zlib"
Comment 8 foser (RETIRED) gentoo-dev 2004-09-03 09:18:15 UTC
*** Bug 62645 has been marked as a duplicate of this bug. ***
Comment 9 Hammerfall 2004-09-13 05:34:31 UTC
It compile with warnings using:"-Os -fprefetch-loop-arrays" 
Comment 10 Skobel 2004-09-16 10:11:02 UTC
Compiles for me with -O3 when I change march pentium4 to pentium3... also works with -O3 on my athlon-xp, so it seems to be jumpy depending on -march...
Comment 11 foser (RETIRED) gentoo-dev 2004-10-11 04:24:25 UTC
i added a filter for -Os & -fforce-addr for now, see if that solves most problems.
Comment 12 Mikel Olasagasti 2004-10-12 08:50:56 UTC
Foser I can't build even with that filters...

I Googled a bit and found http://gcc.gnu.org/ml/gcc-bugs/2004-09/msg00225.html I tried to filter -falign-functions and still can't build. 

Looked at http://www.coyotegulch.com/products/acovea/ and realised that -march=pentium4 inserts some flags that other -march's doesn't. Changed to Pentium3 and have no problem (O2).

So the things to filter will be '-Os' '-fforce-addr' '-falign-functions' and 'pentium4'
Comment 13 foser (RETIRED) gentoo-dev 2004-10-12 09:00:49 UTC
there is a limit to what i will filter. In the end it is all gcc version/arch specific & we can't go filter it all.

CFLAGS, especially exotic ones, are the responsibility of the user.