Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 317069 - x86 mpg123 CPU optimizations not enabled during build despite USE="mmx sse"
Summary: x86 mpg123 CPU optimizations not enabled during build despite USE="mmx sse"
Status: RESOLVED DUPLICATE of bug 295075
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Samuli Suominen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-25 00:34 UTC by Alex Cannon
Modified: 2010-05-07 22:53 UTC (History)
0 users

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


Attachments
emerge -av mpg123 log (mpg123_emerge.log,46.54 KB, text/plain)
2010-04-25 00:35 UTC, Alex Cannon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Cannon 2010-04-25 00:34:01 UTC
The CPU optimizations for the 32 bit build of mpg123 are not getting enabled. Running ./configure by hand works.

After the regular Gentoo install this is what I get:
$ mpg123 --list-cpu
Builtin decoders: generic

And the benchmark:
[2:48] Decoding of Johnny Cash - The Long Black Veil.mp3 finished.

real    0m6.164s
user    0m6.020s
sys     0m0.100s

The configure options passed to configure contain "--with-cpu=generic_fpu" which you can see at the top of the build log, so that is the problem. It should be "--with-cpu=sse" for my Pentium III here with the sse USE flag.

What it should look like is this:
$ src/mpg123 --list-cpu
Builtin decoders: SSE

And the benchmark with SSE:
[2:48] Decoding of Johnny Cash - The Long Black Veil.mp3 finished.

real    0m4.018s
user    0m3.883s
sys     0m0.133s

But I had to run configure by hand with the sse option to make it compile properly. You can also select "x86" for CPU optimizations and it will add all the optimizations in to the binary and turn them on depending on the capabilities of the CPU when it is run.

I'm attaching the build log.

Reproducible: Always




Portage 2.1.8.3 (default/linux/x86/10.0, gcc-4.3.4, glibc-2.10.1-r1, 2.6.32-gentoo-r7 i686)
=================================================================
System uname: Linux-2.6.32-gentoo-r7-i686-Pentium_III_-Katmai-with-gentoo-1.12.13
Timestamp of tree: Tue, 13 Apr 2010 23:00:01 +0000
app-shells/bash:     4.0_p37
dev-lang/python:     2.5.4-r3, 2.6.4-r1
dev-python/pycrypto: 2.1.0_beta1
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r4, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc:       4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i586-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -fomit-frame-pointer"
CHOST="i586-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/bind /var/qmail/alias /var/qmail/control /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=pentium3 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://csociety-ftp.ecn.purdue.edu/pub/gentoo/ http://mirror.tucdemonic.org/gentoo/ http://gentoo.llarian.net/ http://mirror.datapipe.net/gentoo http://chod.cwru.edu/gentoo ftp://chod.cwru.edu/gentoo ftp://linux.cs.lewisu.edu/gentoo/ http://mirror.usu.edu/mirrors/gentoo/"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acc acl alsa apache2 berkdb bittorrent bzip2 cddb cdparanoia cli cracklib crypt cups cxx dga directfb divx4linux dri dvd dvdread encode esd esound exif extras faad fasttrack ffmpeg finger fltk foomaticdb fortran ftp gdbm gif gimp gimpprint gnutella gopher gpm gtk iconv idn imagemagick imap imlib innodb ipv6 javascript joystick jpeg live lua mad maildir mmx modules motif mp2 mp3 mpeg mudflap mysql nas ncurses nls nntp nptl nptlonly ogg openft openmp pam pcre perl png pnm ppds pppd pulseaudio qt3 quicktime readline reflection ruby sasl scanner sdl session slp snmp softmmu speex spl sse ssl sve svg sysfs tcpd theora tiff truetype unicode usb v4l vchkpw vorbis x264 x86 xft xml xmms xorg xv xvid 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 mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Alex Cannon 2010-04-25 00:35:26 UTC
Created attachment 229041 [details]
emerge -av mpg123 log
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2010-04-25 00:49:14 UTC
Does changing 

if [[ ${ABI} = x86 ]]; then

to 

if use x86; then

in the ebuild solve your problem? That change was made for bug 295075.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2010-04-25 00:50:35 UTC
And this is a duplicate of bug 313729.
Comment 4 Alex Cannon 2010-04-25 13:16:50 UTC
After that change it went to x86 now! So yeah that worked.

What does ${ABI} mean anyway?
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2010-04-25 13:33:17 UTC

*** This bug has been marked as a duplicate of bug 295075 ***
Comment 6 Alex Cannon 2010-04-25 15:24:08 UTC
In bug 295075 the "fixed" ebuild that was attached there contains this:

	if [[ ${ABI} = x86 ]]; then
		_cpu=i586
		use mmx && _cpu=mmx
		use 3dnow && _cpu=3dnow
		use sse && _cpu=x86
		use 3dnowext && _cpu=x86
	fi

Which is what I had in portage, and I had to change "if [[ ${ABI} = x86 ]]; then" to "if use x86; then" to make it work. So I don't think that bug is resolved yet.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2010-04-25 15:28:53 UTC
I fixed it differently, just emerge --sync to get the updated ebuild
Comment 8 Alex Cannon 2010-05-07 22:53:45 UTC
I just did --sync and emerge mpg123 and it is still broken. The ebuild still contains this problematic code. Apparently that if statement is always false.

    if [[ ${ABI} = x86 ]]; then
        _cpu=i586
        use mmx && _cpu=mmx
        use 3dnow && _cpu=3dnow
        use sse && _cpu=x86
        use 3dnowext && _cpu=x86
    fi