Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 82128 - vlc-0.8.1 build fails on deinterlace.c, function `MergeAltivec'
Summary: vlc-0.8.1 build fails on deinterlace.c, function `MergeAltivec'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC All
: High normal (vote)
Assignee: PPC Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-15 09:30 UTC by Michael Kiermaier
Modified: 2005-12-25 09:40 UTC (History)
1 user (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 Michael Kiermaier 2005-02-15 09:30:59 UTC
I am on a G3 iBook Rev. 2.2 800 MHz. This error occurs on emerge vlc:

powerpc-unknown-linux-gnu-gcc -Wsign-compare -Wall -O2 -pipe -mcpu=750 -fsigned-char -mpowerpc-gfxopt -pipe -o libmotionblur_plugin.so libmotionblur_plugin_a-motionblur.o `top_builddir=../.. ../../vlc-config --libs plugin motionblur`
if powerpc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../..   -DSYS_LINUX -I../../include `top_builddir="../.." ../../vlc-config --cflags plugin logo` -Wsign-compare -Wall -O2 -pipe -mcpu=750 -fsigned-char -mpowerpc-gfxopt -pipe -MT liblogo_plugin_a-logo.o -MD -MP -MF ".deps/liblogo_plugin_a-logo.Tpo" \
  -c -o liblogo_plugin_a-logo.o `test -f 'logo.c' || echo './'`logo.c; \
then mv -f ".deps/liblogo_plugin_a-logo.Tpo" ".deps/liblogo_plugin_a-logo.Po"; \
else rm -f ".deps/liblogo_plugin_a-logo.Tpo"; exit 1; \
fi
powerpc-unknown-linux-gnu-gcc -Wsign-compare -Wall -O2 -pipe -mcpu=750 -fsigned-char -mpowerpc-gfxopt -pipe -o liblogo_plugin.so liblogo_plugin_a-logo.o `top_builddir=../.. ../../vlc-config --libs plugin logo`
if powerpc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../..   -DSYS_LINUX -I../../include `top_builddir="../.." ../../vlc-config --cflags plugin deinterlace` -Wsign-compare -Wall -O2 -pipe -mcpu=750 -fsigned-char -mpowerpc-gfxopt -pipe -MT libdeinterlace_plugin_a-deinterlace.o -MD -MP -MF ".deps/libdeinterlace_plugin_a-deinterlace.Tpo" \
  -c -o libdeinterlace_plugin_a-deinterlace.o `test -f 'deinterlace.c' || echo './'`deinterlace.c; \
then mv -f ".deps/libdeinterlace_plugin_a-deinterlace.Tpo" ".deps/libdeinterlace_plugin_a-deinterlace.Po"; \
else rm -f ".deps/libdeinterlace_plugin_a-deinterlace.Tpo"; exit 1; \
fi
deinterlace.c: In function `MergeAltivec':
deinterlace.c:962: error: `vector' undeclared (first use in this function)
deinterlace.c:962: error: (Each undeclared identifier is reported only once
deinterlace.c:962: error: for each function it appears in.)
deinterlace.c:962: error: parse error before "unsigned"
deinterlace.c:966: error: `perm1v' undeclared (first use in this function)
deinterlace.c:966: warning: implicit declaration of function `vec_lvsl'
deinterlace.c:967: error: `perm2v' undeclared (first use in this function)
deinterlace.c:968: error: `s1oldv' undeclared (first use in this function)
deinterlace.c:968: warning: implicit declaration of function `vec_ld'
deinterlace.c:969: error: `s2oldv' undeclared (first use in this function)
deinterlace.c:973: error: `s1newv' undeclared (first use in this function)
deinterlace.c:974: error: `s2newv' undeclared (first use in this function)
deinterlace.c:975: error: `s1v' undeclared (first use in this function)
deinterlace.c:975: warning: implicit declaration of function `vec_perm'
deinterlace.c:976: error: `s2v' undeclared (first use in this function)
deinterlace.c:979: error: `destv' undeclared (first use in this function)
deinterlace.c:979: warning: implicit declaration of function `vec_avg'
deinterlace.c:980: warning: implicit declaration of function `vec_st'
deinterlace.c:990: error: parse error before "unsigned"
make[4]: *** [libdeinterlace_plugin_a-deinterlace.o] Error 1
make[4]: Leaving directory `/var/tmp/portage/vlc-0.8.1/work/vlc-0.8.1/modules/video_filter'
make[3]: *** [all-modules] Error 1
make[3]: Leaving directory `/var/tmp/portage/vlc-0.8.1/work/vlc-0.8.1/modules/video_filter'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/vlc-0.8.1/work/vlc-0.8.1/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/vlc-0.8.1/work/vlc-0.8.1'
make: *** [all] Error 2


# emerge info
Portage 2.0.51-r15 (default-linux/ppc/2004.1, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.10 ppc)
=================================================================
System uname: 2.6.10 ppc 750FX
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.2.2,dev-lang/python-2.3.4-r1 [2.3.4 (#1,Feb  8 2005, 21:08:51)]
distcc 2.18.3 powerpc-unknown-linux-gnu (protocols 1 and 2) (default port 3632)[disabled]
dev-lang/python:     2.2.2, 2.3.4-r1
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.8.5-r3, 1.7.9-r1, 1.5, 1.6.3, 1.4_p6, 1.9.4
sys-devel/binutils:  2.15.90.0.3-r4
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.4.18-r2, 2.4.22-r1
ACCEPT_KEYWORDS="ppc ~ppc"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe -mcpu=750 -fsigned-char -mpowerpc-gfxopt"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config/usr/lib/X11/xkb /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="-O2 -pipe -mcpu=750 -fsigned-char -mpowerpc-gfxopt"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="ftp://gentoo.inode.at/source/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ http://gd.tuwien.ac.at/opsys/linux/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aalib alsa apache2 apm arts audiofile berkdb bitmap-fonts blas bzlib caps cdparanoia crypt cups curl dba divx4linux doc dvd encode exif f77 fam flac font-server fortran gcj gd gdbm gif gphoto2 gpm gtk gtk2 guile icq imagemagick imlib innodb jack jack-tmpfs java jpeg kde ladcca ladspa lcms libcaca libwww live lzo mad maildir matroska monkey motif mpeg mysql ncurses nls objc offensive oggvorbis opengl oss pam pdflib perl png ppc python qt readline samba sasl sdl slang sndfile speex spell ssl tcltk tcpd tetex theora tiff truetype truetype-fonts type1-fonts usb wmf xine xml xml2 xmms xprint xv xvid zlib video_cards_radeon"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS


# emerge -pv vlc

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild     U ] media-video/vlc-0.8.1 [0.8.0] (-3dfx) +X -a52 +aalib +alsa -altivec +arts -bidi -cdda -cddb -cdio -debug -dts -dvb +dvd -esd -faad -fbcon -ffmpeg +flac -freetype -ggi -gnutls -hal -httpd -joystick +libcaca -lirc +live +mad +matroska -mozilla +mpeg +ncurses +nls -ogg +opengl +oss -stream -svg (-svga) +theora -utf8 -v4l -vcd -vlm -vorbis -wxwindows -xosd +xv 0 kB
Comment 1 Luca Barbato gentoo-dev 2005-02-17 08:04:52 UTC
1 remove -fsigned char

2 looks like vlc doesn't think that there are non altivec ppc around anymore
Comment 2 Michael Kiermaier 2005-02-19 03:05:49 UTC
removing -fsigned-char does not change anything, the error subsists.

the vlc ebuild uses the use-flag "altivec". It is not set on my iBook. Could there be an error handling this use-flag in the ebuild?
Comment 3 Ruben 2005-03-17 01:52:51 UTC
It looks like something is wrong with the configure script. It seems to check whether gcc can compile altivec code, and then it seems to enable altivec. A simple workaround to get vlc to compile, is to comment out some lines in config.h after the configure script ended.

config.h /should/ contain the following i think:
/**************************/
/* Define if \$CC groks AltiVec inline assembly. */
/* #undef CAN_COMPILE_ALTIVEC */

/* Define if your compiler groks C AltiVec extensions. */
/* #undef CAN_COMPILE_C_ALTIVEC */
/**************************/

But as you will see, it will have a define for both. If it's not defined, then it will take a GenericMerge function in deinterlace.c.

With the modified config.h, i got it to compile. (didn't do a lot of testing though)
Comment 4 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-06-04 22:20:41 UTC
I don't have an altivec-less PPC to test on, however in configure.ac there are 
two tests for Altivec present, and your system would have to pass them in order 
for the correct DEFINES in config.h to occur.

AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
    [ac_cv_altivec_inline],
    [CFLAGS="${CFLAGS_save}"
     AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
         ac_cv_altivec_inline=yes,
         [CFLAGS="${CFLAGS_save} -Wa,-m7400"
          AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
            [ac_cv_altivec_inline="-Wa,-m7400"],
            ac_cv_altivec_inline=no)
         ])])
if test "${ac_cv_altivec_inline}" != "no"; then
  AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline 
assembly.)
  if test "${ac_cv_altivec_inline}" != "yes"; then
    VLC_ADD_CFLAGS([idctaltivec],[${ac_cv_altivec_inline}])
    VLC_ADD_CFLAGS([motionaltivec],[${ac_cv_altivec_inline}])
    VLC_ADD_CFLAGS([memcpyaltivec],[${ac_cv_altivec_inline}])
    VLC_ADD_CFLAGS([i420_yuy2_altivec],[${ac_cv_altivec_inline}])
    VLC_ADD_CFLAGS([vlc],[${ac_cv_altivec_inline}])
  fi
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
fi

and

AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
    [ac_cv_c_altivec],
    [# Darwin test
     CFLAGS="${CFLAGS_save} -faltivec"
     AC_TRY_COMPILE([],
       [vec_ld(0, (unsigned char *)0);],
       [ac_cv_c_altivec="-faltivec"],
       [# Linux/PPC test (no flags)
        CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -maltivec -mabi=altivec"
        AC_TRY_COMPILE([#ifdef HAVE_ALTIVEC_H
                        #include <altivec.h>
                        #endif],
          [vec_ld(0, (unsigned char *)0);],
          [ac_cv_c_altivec=""
           ac_cv_c_altivec_abi="-maltivec -mabi=altivec"],
          [# Linux/PPC test (old GCC versions)
           CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -fvec"
           AC_TRY_COMPILE([#ifdef HAVE_ALTIVEC_H
                           #include <altivec.h>
                           #endif],
             [vec_ld(0, (unsigned char *)0);],
             [ac_cv_c_altivec="-fvec"],
             [ac_cv_c_altivec=no])
           ])
        ])
     CFLAGS="${CFLAGS_save}"])
if test "${ac_cv_c_altivec}" != "no"; then
  AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec 
extensions.)
  VLC_ADD_CFLAGS([vlc],[${ac_cv_c_altivec}])
  VLC_ADD_CFLAGS([idctaltivec motionaltivec],[${ac_cv_c_altivec}])
  VLC_ADD_CFLAGS([i420_yuy2_altivec memcpyaltivec deinterlace],
[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
fi

It only enables altivec ( see the AC_DEFINE() statements ) when the processor 
can compile altivec, otherwise it skips them.  However, later in the configure 
script, altivec optimizations are turned on by default on PowerPC architectures. 

dnl
dnl  AltiVec acceleration
dnl
AC_ARG_ENABLE(altivec,
[  --disable-altivec       disable AltiVec optimizations (default enabled on 
PPC)],
[ if test "${enable_altivec}" = "yes"; then ARCH="${ARCH} altivec";
    VLC_ADD_BUILTINS([${ACCEL_MODULES}]) fi ],
[ if test "${target_cpu}" = "powerpc"; then ARCH="${ARCH} altivec";
    VLC_ADD_BUILTINS([${ACCEL_MODULES}]) fi ])

However, most of the vlc e-builds I looked at did had the correct altivec USE 
flag usage, and the latter example of setting altivec to on would be over-ridden 
by having a -altivec flag.

Can you look in your config.h and see if the variables "CAN_COMPILE_C_ALTIVEC" 
and "CAN_COMPILE_ALTIVEC" are defined?  If so it would be interesting to see how 
your compiler managed to pass the configure tests.
Comment 5 Vieri Verze 2005-07-03 10:13:44 UTC
If u uncomment the config.h.in line:

/**************************/
/* Define if \$CC groks AltiVec inline assembly. */
/* #undef CAN_COMPILE_ALTIVEC */

/* Define if your compiler groks C AltiVec extensions. */
/* #undef CAN_COMPILE_C_ALTIVEC */
/**************************/

as described by Ruben, it works and emerge perfectly.
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-07-13 08:33:40 UTC
Can you try with 0.8.2 ? 
 
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-08-07 04:00:50 UTC
PPC team, I don't have the hardware to look at this, can someone take a look? 
 
Comment 8 Alessandro Chirico 2005-11-06 14:04:20 UTC
I've got the same problem on my ibook G3 with version 0.8.2
I tried version 0.8.4 beta1 and everything builds and works fine
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-11-29 04:17:35 UTC
Is 0.8.4 fixed then? 
Comment 10 Martin 2005-11-29 14:27:28 UTC
same error with media-video/vlc-0.8.4-r1 here on x86
Comment 11 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-11-29 14:35:07 UTC
... what the...? altivec problems on x86 does not really seem the case. 
Comment 12 Michael Kiermaier 2005-11-30 02:33:42 UTC
My iBook is broken, so at the moment I cannot test if it works. As soon as I get
it repaired, I will test the new version.
Comment 13 Michael Kiermaier 2005-12-25 09:40:29 UTC
My iBook is back, thanks for your patience.

0.8.4 compiles without problems.