Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40686 - xine-lib does not compile under pentium4, gcc3.3.2 using any -O flags
Summary: xine-lib does not compile under pentium4, gcc3.3.2 using any -O flags
Status: RESOLVED DUPLICATE of bug 40681
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
: 41991 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-07 00:56 UTC by assamite
Modified: 2005-07-17 13:06 UTC (History)
4 users (show)

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


Attachments
xine-lib.log (xine-lib.log,628.99 KB, text/plain)
2004-02-15 07:09 UTC, Narada Sage
Details

Note You need to log in before you can comment on or make changes to this bug.
Description assamite 2004-02-07 00:56:03 UTC
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"
Comment 1 Eric Muehlstein 2004-02-07 02:14:28 UTC
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.
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-08 01:49:28 UTC
Can you try with -r5?
Comment 3 assamite 2004-02-09 11:07:51 UTC
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
Comment 4 assamite 2004-02-10 07:55:48 UTC
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'
Comment 5 Chance Platt 2004-02-10 14:54:44 UTC

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.

Comment 6 assamite 2004-02-11 00:35:30 UTC
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)
Comment 7 Thomas T. Veldhouse 2004-02-11 06:15:05 UTC
-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.
Comment 8 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-11 13:32:05 UTC
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.
Comment 9 assamite 2004-02-12 09:27:31 UTC
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.
Comment 10 Dale K Dicks 2004-02-13 05:07:34 UTC
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
Comment 11 Radek Podgorny 2004-02-14 19:27:33 UTC
Do you know about bug 31087? It may be the same issue...
Comment 12 Radek Podgorny 2004-02-14 19:30:52 UTC
...and bug 40681...

...maybe bug 34626, too...
Comment 13 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-15 00:12:29 UTC
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.
Comment 14 Narada Sage 2004-02-15 07:08:19 UTC
I was getting emerge failure (xine-lib.log) but changing pentium4 to pentium3 in CFLAGS made the emerge succeed.
Comment 15 Narada Sage 2004-02-15 07:09:40 UTC
Created attachment 25666 [details]
xine-lib.log

The log of the failed xine-lib emerge with pentium4
Comment 16 Tomas Torstensvik 2004-02-15 13:53:07 UTC
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.
Comment 17 Michael C. Ferguson 2004-02-17 21:22:35 UTC
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
Comment 18 Stuart Bain 2004-02-17 21:26:42 UTC
*** Bug 41991 has been marked as a duplicate of this bug. ***
Comment 19 Martin Holzer (RETIRED) gentoo-dev 2004-02-18 01:03:03 UTC

*** This bug has been marked as a duplicate of 40681 ***