Subject: Problem encountered compiling xine-lib on i386
To: None <tech-pkg@netbsd.org>
From: Joachim Thiemann <thiemann@gel.usherbrooke.ca>
List: tech-pkg
Date: 06/11/2004 12:47:15
Hello,  I've encounterd a problem compiling multimedia/xine-lib.  It seems 
an "optimisation flag" problem, to be precise, an incompatibility with 
devel/cpuflags (problem does not occur on a clean build if cpuflags is not 
included in /etc/mk.conf).  Here is what happens:

(in the directory multimedia/xine-lib/work/xine-lib-1-rc4/src/post/goom):

=====
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  -O2 
-march=pentium4 -I/usr/pkg/include -I/usr/pkg/include/freetype2 
-DGLX_GLXEXT_LEGACY -I/usr/include  -DHAVE_MMX `echo -mcpu=i386 -O3 -pipe 
-fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4  
-mpreferred-stack-boundary=2 -fexpensive-optimizations -fschedule-insns2 
-fno-strict-aliasing -ffast-math -funroll-loops -finline-functions -Wall 
-DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE  
-Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts 
-Wmissing-declarations -Wmissing-prototypes -O2 -march=pentium4 
-I/usr/pkg/include -I/usr/pkg/include/freetype2 -DGLX_GLXEXT_LEGACY 
-I/usr/include | 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
 gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../src 
-I../../../src/xine-engine -I../../../src/xine-utils -I../../../src/input 
-O2 -march=pentium4 
-I/home/pkgsrc/multimedia/xine-lib/work/.buildlink/include 
-I/home/pkgsrc/multimedia/xine-lib/work/.buildlink/include/freetype2 
-DGLX_GLXEXT_LEGACY -DHAVE_MMX -mcpu=i386 -O3 -pipe -falign-functions=4 
-falign-loops=4 -falign-jumps=4 -mpreferred-stack-boundary=2 
-fexpensive-optimizations -fschedule-insns2 -fno-strict-aliasing 
-ffast-math -funroll-loops -finline-functions -Wall -DNDEBUG -D_REENTRANT 
-D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wpointer-arith -Wnested-externs 
-Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes 
-O2 -march=pentium4 -c zoom_filter_xmmx.c -MT zoom_filter_xmmx.lo -MD -MP 
-MF .deps/zoom_filter_xmmx.TPlo  -fPIC -DPIC -o .libs/zoom_filter_xmmx.o
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}:93: Error: suffix or operands invalid for `add'
gmake[4]: *** [zoom_filter_xmmx.lo] Error 1
====

Now, I can get around the problem if I cd to 
multimedia/xine-lib/work/xine-lib-1-rc4/src/post/goom and execute that line 
by hand, if I execute the line

====
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  -O2 
-I/usr/pkg/include -I/usr/pkg/include/freetype2 -DGLX_GLXEXT_LEGACY 
-I/usr/include  -DHAVE_MMX `echo -O3 -pipe -fomit-frame-pointer 
-falign-functions=4 -falign-loops=4 -falign-jumps=4  
-mpreferred-stack-boundary=2 -fexpensive-optimizations -fschedule-insns2 
-fno-strict-aliasing -ffast-math -funroll-loops -finline-functions -Wall 
-DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE  
-Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts 
-Wmissing-declarations -Wmissing-prototypes -O2 -I/usr/pkg/include 
-I/usr/pkg/include/freetype2 -DGLX_GLXEXT_LEGACY -I/usr/include | 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
====

which is the problem command with the "-arch=pentium4" options (2 of them) 
and the "-mcpu=i386" option removed.

A similar problem later occurs with paddusb, when compiling surf3d.c.

Any idea what the best way to fix this would be? If I send-pr this, is this 
a "devel/cpuflags" or "multimedia/xine-lib" problem?  (BTW, this is on 
NetBSD-2-0, on a Thinkpad T30 (P4 cpu), and cpuflags-0.71 and 
xine-lib-1rc4nb1)

Cheers,
	Joe.
-- 
http://www.gel.usherbrooke.ca/thiemann