the overall problem is crashing, as per bug #155749, which may just be a vlc problem but when i take a look at the output of the build process i notice the -mtune and -maltivec flags seem to be used incorrectly. I am building on a G3 750 laptop, in /etc/make.conf my CFLAGS is set to: CFLAGS="-O3 -mcpu=750 -mtune=powerpc -pipe" however when i look at the build output of vlc i notice: powerpc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.. -DSYS_LINUX -I../include -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REEN TRANT -D_THREAD_SAFE -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -DDATA_PATH=\"/usr/share/vlc\" -DPLUGIN_PATH=\"/usr/lib/vlc\" -O3 -ffast-math -funr oll-loops -mtune=G4 -fomit-frame-pointer -D__VLC__ -I../src/misc -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus -1.0/include -maltivec -Wsign-compare -Wall -O3 -mcpu=750 -mtune=powerpc -pipe -pipe -MT playlist/libvlc_la-item-ext.lo -MD -MP -MF playlist/.deps/libvl c_la-item-ext.Tpo -c playlist/item-ext.c -fPIC -DPIC -o playlist/.libs/libvlc_la-item-ext.o note -mtune=G4 and -maltivec are being set, followed by the proper CFLAGS arguments later the USE flags should be ok and the configure call appears to be ok (--disable-altivec): ./configure --prefix=/usr --host=powerpc-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --lo calstatedir=/var/lib --disable-altivec --enable-sout --disable-httpd --disable-gnutls --disable-v4l --enable-cdda --enable-cddax --enable-libcddb --disable-vcd --disable-vcdx --enable-dvb --enable-pvr --enable-ogg --disable-mkv --enable-flac --enable-vorbis --enable-theora --enable-x11 --enable-xvideo --disable-xinerama --enable-glx --enable-opengl --enable-freetype --disable-fribidi --enable-dvdread --enable-dvdplay --enable-dvdnav --enable-fb --disable-svgalib --disable-glide --disable-aa --disable-caca --disable-oss --enable-esd --disable-arts --enable-alsa --enable-wxwidgets --enable-ncurses --enable-xosd --enable-lirc --enable-live555 --with-live555-tree=/usr/lib/live --enable-mad --enable-a52 --enable-dts --enable-libmpeg2 --enable-ggi --disable-glide --enable-sdl --enable-png --enable-libxml2 --enable-smb --disable-daap --disable-corba --disable-mod --enable-speex --disable-shout --disable-rtsp --disable-realrtsp --disable-loader --enable-skins2 --enable-hal --enable-bonjour --disable-upnp --disable-optimize-memory --disable-libnotify --enable-ffmpeg --disable-faad --disable-jack --disable-dv --disable-libvc1 --disable-snapshot --disable-growl --disable-pth --disable-portaudio --disable-x264 --enable-utf8 --enable-libtool --enable-mozilla XPIDL=/usr/lib/mozilla-firefox MOZILLA_CONFIG=/usr/lib/mozilla-firefox/firefox-config --with-wx-config =gtk2-unicode-release-2.6 --with-wx-config-path=/usr/lib/wx/config --enable-vlm --enable-sout --disable-directfb --build=powerpc-unknown-linux-gnu emerge --info is: Portage 2.1.1-r2 (default-linux/ppc/2005.1/ppc, gcc-4.1.1, glibc-2.4-r4, 2.6.17-gentoo-r4 ppc) ================================================================= System uname: 2.6.17-gentoo-r4 ppc 740/750 Gentoo Base System version 1.12.6 Last Sync: Wed, 13 Dec 2006 12:30:01 +0000 app-admin/eselect-compiler: [Not Present] dev-java/java-config: 1.3.7, 2.0.30 dev-lang/python: 2.3.5, 2.4.3-r4 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r4 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.16 ACCEPT_KEYWORDS="ppc" AUTOCLEAN="yes" CBUILD="powerpc-unknown-linux-gnu" CFLAGS="-O3 -mcpu=750 -mtune=powerpc -pipe" CHOST="powerpc-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo" CXXFLAGS="-O3 -mcpu=750 -mtune=powerpc -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="ppc X Xaw3d a52 aac alsa alsa_cards_powermac amr audiofile auth avahi bash-completion berkdb bitmap-fonts browserplugin bzip2 calendar cdb cdda cddb cdparanoia cdr cli cracklib crpyt crypt ctype dga dio divx divx4linux dlloader dri dts dvb dvd dvdread eds elibc_glibc emboss encode esd fbcon ffmpeg firefox flac fortran ftp gdbm ggi gif gmedia gpm gstreamer gtk gtk2 hal iconv ieee1394 imagemagick input_devices_keyboard input_devices_mouse ipv6 isdnlog java jpeg kde kdeenablefinal kdehiddenvisibility kernel_linux libvisual libwww lirc live mad madwifi motif mp3 mpeg mysql ncurses nls nptl nptlonly nsplugin offensive ogg oggvorbis opengl pam pcmcia pcre perl png pppd python qt qt3 qt4 quicktime readline realmedia reflection ruby samba sdl session skins sndfile speex spell spl ssl stream svg tcpd theora threads tiff truetype truetype-fonts type1-fonts unicode usb userland_GNU video_cards_r128 visualization vlm vorbis wmp wxwindows x264 xine xml xml2 xorg xosd xv xvid zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
I've disabled autodetected optimizations for vlc-0.8.6_p18636, could you please test if it solves the problems ? vlc tries to autodetect which cflags to pass to gcc, but it might be wrong there. If it solves the problems, could you please report that upstream to let them know that they autodetect wrong cflags for ppc ?
no that doesn't solve the problem. It still tries to build with -mtune=G4 (and i think -maltivec), and crashes when I run it.
Are you sure you tried vlc-0.8.6_p18636 ? could you please post the output of the ./configure call ? I've just disabled it in vlc-0.8.6-r1 also, vlc's configure tried to autodetect which cflags to enable and appended them to cflags. It's probably not what we want for gentoo because we already have cflags defined in make.conf.
Created attachment 109944 [details] output from running emerge vlc
yes I am trying to install vlc-0.8.6_p18636. the output is in the attached file.
I dont think you ran emerge --sync since I modified this. btw, you can check which cflags will be used by vlc automatic detection by going to the directory where it's being compiled, most likely in /var/tmp/portage/media-video/vlc-0.8.6_p18636/work/vlc-0.8.6_p18636 and run ./vlc-config --cflags
it seems to have a number of compile options that default to G4, altivec compilation on a PPC (and similar for x86). the flags to turn it off *should* be --disable-altivec and --with-tuning=G3, however I noticed in the last build it was compiling with --disable-altivec and some components still built with -maltivec. running manually I can examine the various internal build settings using vlc-config, it shows the -mtune=G4 flag is set under --cxxflags. i tried building using --with-tuning=G3 (although i usually use -mtune=powerpc) and it seems to set the flags ok. i'm not sure how this would be solved to fit in with the gentoo format, better if there was some way of telling it simply not to set a tuning option, but not easy when it defaults to G4 on PPC and pentium 2 on x86.
by the way I did run emerge --sync recently but I think it may take a while for changes to find their way through the mirrors? i am still waiting for a bug fix for mplayer flags (#156605) to make its way through the system even though am re-running emerge --sync, and am using default mirrors: >>> Starting rsync with rsync://209.177.148.226/gentoo-portage... (will try again)
i've run --sync again and rebuilt vlc, it seems to build with the correct flags this time, it doesn't try and build with -mtune=G4 or -maltivec but running the vlc plug in it still crashes the browser (as per bug #155749). i suppose it needs to be resolved upstream.
(In reply to comment #9) > i've run --sync again and rebuilt vlc, it seems to build with the correct flags > this time, it doesn't try and build with -mtune=G4 or -maltivec > > > but running the vlc plug in it still crashes the browser (as per bug #155749). > i suppose it needs to be resolved upstream. > correction! it is still building with -maltivec: make[3]: Entering directory `/var/tmp/portage/media-video/vlc-0.8.6_p18636/work/vlc-0.8.6_p18636/src' make[4]: Entering directory `/var/tmp/portage/media-video/vlc-0.8.6_p18636/work/vlc-0.8.6_p18636/src' /bin/sh ../libtool --tag=CC --mode=compile powerpc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -DSYS_LINUX -I../include `top_builddir=".." .. /vlc-config --cflags vlc` -Wsign-compare -Wall -O3 -mcpu=750 -mtune=powerpc -pipe -pipe -MT libvlc_la-libvlc.lo -MD -MP -MF .deps/libvlc_la-libvlc.T po -c -o libvlc_la-libvlc.lo `test -f 'libvlc.c' || echo './'`libvlc.c cd ../modules/demux && make liblive555_builtin.la make[5]: Entering directory `/var/tmp/portage/media-video/vlc-0.8.6_p18636/work/vlc-0.8.6_p18636/modules/demux' /bin/sh ../../libtool --tag=CXX --mode=compile powerpc-unknown-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../.. -DSYS_LINUX -I../../include `top_buildd ir="../.." ../../vlc-config --cxxflags builtin live555` -Wsign-compare -Wall -O3 -mcpu=750 -mtune=powerpc -pipe -pipe -MT liblive555_builtin_la-live 555.lo -MD -MP -MF .deps/liblive555_builtin_la-live555.Tpo -c -o liblive555_builtin_la-live555.lo `test -f 'live555.cpp' || echo './'`live555.cpp mkdir .libs powerpc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -DSYS_LINUX -I../include -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REEN TRANT -D_THREAD_SAFE -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -DDATA_PATH=\"/usr/share/vlc\" -DPLUGIN_PATH=\"/usr/lib/vlc\" -O2 -D__VLC__ -I. ./src/misc -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -maltivec -Wsign-compare -Wall -O3 -m cpu=750 -mtune=powerpc -pipe -pipe -MT libvlc_la-libvlc.lo -MD -MP -MF .deps/libvlc_la-libvlc.Tpo -c libvlc.c -fPIC -DPIC -o .libs/libvlc_la-libvlc .o
That's probably due to those lines in configure.ac : 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([libvlc],[${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}]) if test "${ac_cv_altivec_inline}" = "no"; then ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}" fi fi that probably need to be put in some if test "${enable_altivec}" = "yes" checks As I dont have any ppc myself, I can't do more than asking you to report that upstream ( https://trac.videolan.org/vlc ) and see how they fix it and then backport the fixes in our ebuilds.
I suppose this url is what you submitted, thanks for doing so.
here is the patch suggested from the vlc bug list, doing anything with it in the gentoo framework is a bit beyond me at the moment: {{{ Index: configure.ac =================================================================== --- configure.ac (revision 18832) +++ configure.ac (working copy) @@ -1362,7 +1362,7 @@ AC_CHECK_HEADERS(altivec.h) CPPFLAGS="${CPPFLAGS_save}" -if test "${ac_cv_c_altivec}" != "no"; then +if test "${ac_cv_c_altivec}" != "no" -a "${enable_altivec}" != "no" ; then AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.) VLC_ADD_CFLAGS([libvlc],[${ac_cv_c_altivec}]) VLC_ADD_CFLAGS([idctaltivec motionaltivec],[${ac_cv_c_altivec}]) }}} You will need to run eautoreconf (or autoreconf or ./bootstrap)
Thanks, I've added this patch to our patchset. You'll have to wait a few hours and then run emerge --sync and it should apply the patch : 290_all_altivec.patch
Any news Anthony? I'm trying to build vlc-0.8.6_p18636 and it fails after the following: (cd .libs && rm -f liblogo_plugin.la && ln -s ../liblogo_plugin.la liblogo_plugin.la) /bin/sh ../../libtool --tag=CC --mode=compile powerpc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -DSYS_LINUX -I../../include `top_builddir="../.." ../../vlc-config --cflags plugin deinterlace` -Wsign-compare -Wall -O2 -mcpu=603e -pipe -pipe -MT libdeinterlace_plugin_la-deinterlace.lo -MD -MP -MF .deps/libdeinterlace_plugin_la-deinterlace.Tpo -c -o libdeinterlace_plugin_la-deinterlace.lo `test -f 'deinterlace.c' || echo './'`deinterlace.c powerpc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -DSYS_LINUX -I../../include -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -DDATA_PATH=\"/usr/share/vlc\" -DPLUGIN_PATH=\"/usr/lib/vlc\" -O2 -D__VLC__ -D__PLUGIN__ -DMODULE_NAME=deinterlace -DMODULE_NAME_IS_deinterlace -Wsign-compare -Wall -O2 -mcpu=603e -pipe -pipe -MT libdeinterlace_plugin_la-deinterlace.lo -MD -MP -MF .deps/libdeinterlace_plugin_la-deinterlace.Tpo -c deinterlace.c -fPIC -DPIC -o .libs/libdeinterlace_plugin_la-deinterlace.o In file included from deinterlace.c:37: /usr/lib/gcc/powerpc-unknown-linux-gnu/4.1.1/include/altivec.h:37:2: error: #error Use the "-maltivec" flag to enable PowerPC AltiVec support make[4]: *** [libdeinterlace_plugin_la-deinterlace.lo] Error 1 make[4]: Leaving directory `/var/tmp/portage/media-video/vlc-0.8.6_p18636/work/vlc-0.8.6_p18636/modules/video_filter' make[3]: *** [all-modules] Error 1 I didn't search for why it is currently failing. I don't have altivec either.
my build fails in the same place
I've updated the patchset to not include altivec.h when altivec is not wanted, this solves compile issues. Thanks to cam for testing. Unfortunately this does not seem to solve all the 'illegal instruction' problems, I've been looking at x264, and for now it assumes that ppc implies altivec; I've sent a mail to their -devel ml, I hope this will be fixed soon. If you experience such "illegal instruction" problems, feel free to open a bug with a meaningful backtrace ( http://www.gentoo.org/proj/en/qa/backtraces.xml ) to know which package is faulty. For now, vlc should be sane as it does not compile any altivec code when --disable-altivec is given, but some of the libs it's using might have the same problem as x264.
my VLC is now compiling without errors and runs fine on the video that it was crashing on before (eg cnn news videos). thanks :)