In xine-lib, file "zoom_filer_xmmx.c" does not compile under gcc 3.3.2-r6 with any -O flags. The error appear within the inlined asm functions using mmx code. Error is: "standard input:90: Error: suffix or operands invalid for 'add'". Removing the -O flag seems to fix the problem. Reproducible: Always Steps to Reproduce: 1. Use Flags includes mmx,sse on a pentium4 mobile stepping 04 2. compile xine-lib-1_rc3-r1 with -O3 (for example) 3. Gentoo Base System version 1.4.3.8p1 Portage 2.0.50_pre21 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.1-gentoo) ================================================================= System uname: 2.6.1-gentoo i686 Intel(R) Pentium(R) 4 Mobile CPU 1.80GHz ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59 Automake: sys-devel/automake-1.8.2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -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/env.d" CXXFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs buildpkg ccache sandbox" GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X alsa apm arts avi berkdb camera cdr crypt cups dvd encode foomatic foomaticdb gdbm ggi gif gpm gtk2 imlib java jpeg kde libg++ libwww mad mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl pam pda pdflib perl png ppds python qt quicktime readline samba scanner sdl slang spell sse ssl svga tcpd tetex truetype usb x86 xml xml2 xmms xv zlib"
I am having a similar problem. See http://bugs.gentoo.org/show_bug.cgi?id=40681 I have tried emerging xine-lib with many different CFLAGS including CFLAGS="-march=pentium4" to no avail.
Can you try with -r5?
Still broken with gcc 3.3.2-r5 (gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7). The exact error message is: source='zoom_filter_mmx.c' object='zoom_filter_mmx.lo' libtool=yes \ depfile='.deps/zoom_filter_mmx.Plo' tmpdepfile='.deps/zoom_filter_mmx.TPlo' \ depmode=gcc3 /bin/sh ../../../depcomp \ /bin/sh ../../../libtool-nofpic --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../.. -I../../../include -I../../../include -I../../../src -I../../../src/xine-engine -I../../../src/xine-engine -I../../../src/xine-utils -I../../../src/input -I../../../src/input -DHAVE_MMX `echo -Wall -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -march=pentium4 -O3 -pipe | sed -e 's/-fomit-frame-pointer//g;s/-Os//g'` -c -o zoom_filter_mmx.lo `test -f 'zoom_filter_mmx.c' || echo './'`zoom_filter_mmx.c zoom_filter_mmx.c:16: warning: no previous prototype for `zoom_filter_mmx_supported' source='zoom_filter_xmmx.c' object='zoom_filter_xmmx.lo' libtool=yes \ depfile='.deps/zoom_filter_xmmx.Plo' tmpdepfile='.deps/zoom_filter_xmmx.TPlo' \ depmode=gcc3 /bin/sh ../../../depcomp \ /bin/sh ../../../libtool-nofpic --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../.. -I../../../include -I../../../include -I../../../src -I../../../src/xine-engine -I../../../src/xine-engine -I../../../src/xine-utils -I../../../src/input -I../../../src/input -DHAVE_MMX `echo -Wall -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -march=pentium4 -O3 -pipe | sed -e 's/-fomit-frame-pointer//g;s/-Os//g'` -c -o zoom_filter_xmmx.lo `test -f 'zoom_filter_xmmx.c' || echo './'`zoom_filter_xmmx.c zoom_filter_xmmx.c:23: warning: no previous prototype for `zoom_filter_xmmx_supported' zoom_filter_xmmx.c:31: warning: no previous prototype for `zoom_filter_xmmx' zoom_filter_xmmx.c: In function `zoom_filter_xmmx': zoom_filter_xmmx.c:40: warning: unused variable `interpix' {standard input}: Assembler messages: {standard input}:73: Error: suffix or operands invalid for `add' make: *** [zoom_filter_xmmx.lo] Error 1
With CFLAGS="" it compiles zoom_filter, but gives an error later on: make[5]: Entering directory `/var/tmp/portage/xine-lib-1_rc3-r1/work/xine-lib-1-rc3a /src/libffmpeg/libavcodec/libpostproc' source='postprocess.c' object='postprocess.lo' libtool=yes \ depfile='.deps/postprocess.Plo' tmpdepfile='.deps/postprocess.TPlo' \ depmode=gcc3 /bin/sh ../../../../depcomp \ /bin/sh ../../../../libtool-nofpic --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../. ./../.. -I../../../.. -I../../../../include -I../../../../include -I../../../../src -I../../../../src/xine-engine -I../../../../src/xine-engine -I../../../../src/xine-u tils -I../../../../src/input -I../../../../src/input -DSIMPLE_IDCT -DHAVE_AV_CONF IG_H -DRUNTIME_CPUDETECT -DUSE_FASTMEMCPY -DCONFIG_RISKY -DCONFIG_DECODERS -DXINE_MP EG_ENCODER -Wall -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wpoin ter-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wm issing-prototypes -c -o postprocess.lo `test -f 'postprocess.c' || echo './'`postpr ocess.c In file included from postprocess.c:477: postprocess_template.c: In function `postProcess_MMX2': postprocess_template.c:1156: error: can't find a register in class `GENERAL_REGS' wh ile reloading `asm' postprocess_template.c:1156: error: can't find a register in class `GENERAL_REGS' wh ile reloading `asm' make[5]: *** [postprocess.lo] Error 1 make[5]: Leaving directory `/var/tmp/portage/xine-lib-1_rc3-r1/work/xine-lib-1-rc3a/ src/libffmpeg/libavcodec/libpostproc'
xine-lib seems not to work with CFLAGS set to '-march=pentium4 -O3' but is does work for me with '-mcpu=pentium4 -O3'. The problem seems to be with the -march flag.
Doh, one should read the comments in /etc/make.conf (pentium4 generating invalid SSE2 Code). So maybe overriding any "pentium4" user-settings in compiling xine-lib is a solution? (setting them to "-march=pentium3" compiled flawless)
-march=pentium4 creating invalid SSE code is an old issue and is no longer a problem with the latest 3.[23].x compilers. Hey ... why is this thing a dependency of KDE 3.2 anyway? I explicitly do NOT have xine set in my USE flags.
You might try the following: 1) uncomment the next line in gcc-3.3.2-r5.ebuild: -- # mv -f ${WORKDIR}/patch/{40,41}* ${WORKDIR}/patch/exclude/ -- (its in src_unpack()) 2) rebuild gcc then try xine-lib again.
Unfortunately this does not solve the issue with -march=pentium4 flag. Tried it with gcc3.3.2-r5 and gcc3.3.2-r7 and both gave that error again.
I get this with: CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -mfpmath=sse -msse -msse2 -mmmx -pipe" eems to be moved source='input_v4l.c' object='input_v4l.lo' libtool=yes \ depfile='.deps/input_v4l.Plo' tmpdepfile='.deps/input_v4l.TPlo' \ depmode=gcc3 /bin/sh ../../depcomp \ /bin/sh ../../libtool-nofpic --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils -I../../src/input -I../../src/input -D_LARGEFILE64_SOURCE -pthread -DORBIT2=1 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I../../src/input/libdvdnav/ -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -O2 -march=pentium4 -fomit-frame-pointer -mfpmath=sse -msse -msse2 -mmmx -pipe -c -o input_v4l.lo `test -f 'input_v4l.c' || echo './'`input_v4l.c In file included from ../../include/xine.h:51, from ../../src/xine-engine/xine_internal.h:43, from input_v4l.c:49: /usr/include/sys/time.h:57: error: redefinition of `struct timezone' /usr/include/sys/time.h:94: error: syntax error before numeric constant /usr/include/sys/time.h:108: error: redefinition of `struct itimerval' In file included from ../../include/xine.h:52, from ../../src/xine-engine/xine_internal.h:43, from input_v4l.c:49: /usr/include/time.h:160: error: redefinition of `struct itimerspec' input_v4l.c:780: warning: `close_radio_capture_device' defined but not used make[4]: *** [input_v4l.lo] Error 1 make[4]: Leaving directory `/var/tmp/portage/xine-lib-1_rc2/work/xine-lib-1-rc2/src/input' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/var/tmp/portage/xine-lib-1_rc2/work/xine-lib-1-rc2/src/input' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/var/tmp/portage/xine-lib-1_rc2/work/xine-lib-1-rc2/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/xine-lib-1_rc2/work/xine-lib-1-rc2' make: *** [all] Error 2 !!! ERROR: media-libs/xine-lib-1_rc2 failed. !!! Function src_compile, Line 97, Exitcode 2 !!! Parallel make failed
Do you know about bug 31087? It may be the same issue...
...and bug 40681... ...maybe bug 34626, too...
Not the same thing (bug #40681). It miscalculates the address for the addl instruction for some reason (actually puts in xmm1). If you remove some of the code in the file that miscompiles, it seems to work fine.
I was getting emerge failure (xine-lib.log) but changing pentium4 to pentium3 in CFLAGS made the emerge succeed.
Created attachment 25666 [details] xine-lib.log The log of the failed xine-lib emerge with pentium4
Adding -mno-sse2 (which is what the ebuild does if `gcc-version` == 3.2) make it compile with gcc 3.3.2 and -march=pentium4.
I had the same problem -- I was able to get it to compile by changing -march=pentium4 in my CFLAGS to -march=pentium3 -mcpu=pentium4. This is on a fresh install, gcc 3.3.2-r5, etc. Looks like we need to keep replacing -march=pentium4, even for gcc >= 3.2. -- mcf
*** Bug 41991 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of 40681 ***