Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 189007 - =media-video/ffmpeg-0.4.9_p20070616-r1 - CMOV disabled in ffmpeg because ebuild does not pass --cpu configure switch
Summary: =media-video/ffmpeg-0.4.9_p20070616-r1 - CMOV disabled in ffmpeg because ebui...
Status: RESOLVED DUPLICATE of bug 172723
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-15 15:06 UTC by Zeev Tarantov
Modified: 2008-10-14 09:24 UTC (History)
2 users (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 Zeev Tarantov 2007-08-15 15:06:43 UTC
The ffmpeg configure script wants us to pass a value for gcc's -march not in CFLAGS but in a separate special switch they invented and called "--cpu".
The scripts matches this value to a list to determine whether to use CMOV instructions (#define HAVE_CMOV, ENABLE_CMOV, ENABLE_FAST_CMOV) and generates the -march gcc switch overriding user CFLAGS.
Since the ebuild does not pass this value, by default CMOV is disabled (you can see this in the configure output as it scroll during build).
Just passing my good CFLAGS doesn't help of course, because the #defines are never set and the fast codepath is ifdef'd away...
I have not tested it yet, but I think my Core 2 would run faster with cmoves.
Since I think portage doesn't know anything other than "686" about my cpu, maybe we can try and extract the -march value from the CFLAGS in make.conf and pass that as --cpu?

Reproducible: Always

Steps to Reproduce:
1. set decent cflags in make.conf. I use -O2 -march=nocona -mtune=generic -fomit-frame-pointer -pipe
2. emerge =media-video/ffmpeg-0.4.9_p20070616-r1
3. watch it not use CMOV instructions.

Actual Results:  
big-endian                no
MMX enabled               no
CMOV enabled              no
CMOV is fast              no


Expected Results:  
big-endian                no
MMX enabled               no
CMOV enabled              yes
CMOV is fast              yes


I think I saw the ebuild disable mmx because the assembly is not PIC. If there is a similar problem with CMOVs, it should be addressed in the same manner: disable if PIC is required.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-08-15 15:11:47 UTC
Post your emerge --info, it's required for bugs.
Comment 2 Zeev Tarantov 2007-08-15 18:08:02 UTC
Oh, sorry. Here (it's ~x86 updated today):

Portage 2.1.3.5 (default-linux/x86/2007.0/desktop, gcc-4.2.0, glibc-2.6.1-r0, 2.6.22-gentoo-r2 i686)
=================================================================
System uname: 2.6.22-gentoo-r2 i686 Intel(R) Core(TM)2 Duo CPU E6550 @ 2.33GHz
Gentoo Base System release 1.12.10
Timestamp of tree: Wed, 15 Aug 2007 13:20:01 +0000
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17.50.0.16
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=nocona -mtune=generic -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /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/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=nocona -mtune=generic -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="http://mirror.hamakor.org.il/pub/mirrors/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ "
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=both"
LINGUAS="en en_US"
MAKEOPTS="-j3"
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 --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa apache2 bash-completion bidi bitmap-fonts bzip2 cairo cddb cdparanoia cdr cli cracklib crypt curl dbus dga dri dvd dvdr dvdread encode exif fam fastcgi fbcon ffmpeg fftw firefox flac gd gdbm geoip gif gnutls gpm gtk hal hddtemp iconv ieee1394 innodb isdnlog jpeg kde kdeenablefinal kdehiddenvisibility kdexdeltas libsamplerate lm_sensors mad matroska midi mikmod mime mmap mmx mp3 mpeg mplayer mudflap musepack mysql mysqli ncurses nls nptl nptlonly nsplugin offensive ogg opengl openmp oss pam pcre pdf perl php pic png postgres pppd python qt3 qt3support qt4 quicktime readline reflection scanner sdl session spell spl sqlite3 sse sse2 ssl ssse3 startup-notification svg tcpd theora threads tidy tiff truetype truetype-fonts type1-fonts unicode urandom usb vhosts vorbis wifi win32codecs wmf x264 x86 xcomposite xml xorg xv xvid yahoo zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 3 trefoil 2007-11-28 17:28:36 UTC
I confirm this bug also, and would like to see a fix. Below is the relevant section, but I haven't a clue how to fix it in a clean way:

        # targets that do NOT support conditional mov (cmov)
        i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
            add_cflags "-march=$cpu"
            cmov="no"
        ;;
        # targets that do support conditional mov (cmov)
        i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
            add_cflags "-march=$cpu"
            cmov="yes"
            fast_cmov="yes"
        ;;
        # targets that do support conditional mov but on which it's slow
        pentium4|prescott|nocona)
            add_cflags "-march=$cpu"
            cmov="yes"
            fast_cmov="no"
        ;;

Comment 4 Alexis Ballier gentoo-dev 2008-10-14 09:24:59 UTC

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