Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 218382 - media-libs/imlib2: unmask USE=mmx on amd64 profiles.
Summary: media-libs/imlib2: unmask USE=mmx on amd64 profiles.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: AMD64 Project
URL:
Whiteboard:
Keywords:
: 260746 519710 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-19 10:13 UTC by Patrik Larsson
Modified: 2015-08-14 06:36 UTC (History)
7 users (show)

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


Attachments
The build output requested (imlib2_build_output,116.10 KB, text/plain)
2008-04-19 15:47 UTC, Patrik Larsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrik Larsson 2008-04-19 10:13:24 UTC
While configuring the build for imlib2 on my AMD64 system, I noticed that the AMD64 optimizations where not used, see Actual Results. I asked around on #gentoo@freenode and there seems to be some flaw here, the mmx use flag is written as "(-mmx)" when i execute "emerge -va imlib2" even though the AMD64 processor has MMX capabilities.

This problem probably applies to other ebuilds as well.

The reason why i would like this to work is to get faster program execution, this is probably something that is desired by many of us.

I read through the "emerge --info" output to see if i could find any flaws there, the mmx flag is not mentioned even though i have it in my make.conf file.

Reproducible: Always

Steps to Reproduce:
1. ~ # emerge -va imlib2

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] media-libs/imlib2-1.4.0  USE="X bzip2 gif jpeg mp3 nls png tiff zlib -doc (-mmx)" 0 kB 

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No]

Actual Results:  
I saw while building imlib2 the following:

~ # emerge -va imlib2

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] media-libs/imlib2-1.4.0  USE="X bzip2 gif jpeg mp3 nls png tiff zlib -doc (-mmx)" 0 kB 

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] y

Output from ./configure:
...
checking whether to enable amd64 asm support... no
...
------------------------------------------------------------------------
imlib2 1.4.0
------------------------------------------------------------------------
 
Configuration Options Summary:
...
Use AMD64 for speed.......: no
...

Expected Results:  
I should have seen the following while building imlib2:

~ # emerge -va imlib2

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] media-libs/imlib2-1.4.0  USE="X bzip2 gif jpeg mmx mp3 nls png tiff zlib -doc" 0 kB 

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] y

Output from ./configure:
...
checking whether to enable amd64 asm support... yes
...
------------------------------------------------------------------------
imlib2 1.4.0
------------------------------------------------------------------------
 
Configuration Options Summary:
...
Use AMD64 for speed.......: yes
...

~ $ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 31
model name      : AMD Athlon(tm) 64 Processor 3000+
stepping        : 0
cpu MHz         : 1800.000
cache size      : 512 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow rep_good lahf_lm
bogomips        : 3620.76
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

~ # emerge --info
Portage 2.1.4.4 (default-linux/amd64/2006.1/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-gentoo-r9 x86_64)
=================================================================
System uname: 2.6.23-gentoo-r9 x86_64 AMD Athlon(tm) 64 Processor 3000+
Timestamp of tree: Sat, 19 Apr 2008 08:45:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -pipe -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /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/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=k8 -pipe -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict titles unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ds.thn.htu.se/linux/gentoo http://gentoo.mirror.web4u.cz"
LANG="en_US"
LC_ALL="en_US"
LINGUAS="en_US"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3d X a52 aac acl alsa amd64 apache2 apic audiofile avi bash-completion bitmap-fonts boundschecking bzip2 cairo cdr clflush cli cmov cracklib crypt cscope cups cx8 dbus de dga dhcp directfb divx divx4linux dlloader dri dvd dvdr dvdread emboss encode fam ffmpeg firefox flac font-server fortran fpu fpu_exception freetype fxsr fxsr_opt gd gdbm gif glut gpm graphviz gstreamer gtk gtk2 hal iconv icq imlib immqt-bc isdnlog java jpeg junit lahf_lm lcms lzo mad mca mce midi mikmod mime mixer mjpeg mmap mp3 mpeg mppe-mppc msn msr mtrr mudflap mysql nas ncurses netpbm nls no-seamonkey nowext nptl nptlonly nsplugin nvidia nx ogg openal opengl openmp oss pam paste64 pat pcre pdf pge png posix ppds pppd pse pse36 python quicktime readline reflection sdl sep session snmp spell spl ssl svg syscall tcl tcltk tcpd tetex tiff tk truetype truetype-fonts tsc type1 type1-fonts unzip usb vcd vme vorbis wma wmf wp x86-64 xml xorg xpm xscreensaver xv xvid zip zlib" ALSA_CARDS="intel8x0" 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" 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 php 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" LINGUAS="en_US" USERLAND="GNU" VIDEO_CARDS="nvidia vesa fbdev"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-04-19 15:36:12 UTC
Could you post more of the build log, please?
Comment 2 Patrik Larsson 2008-04-19 15:47:39 UTC
Created attachment 150303 [details]
The build output requested
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2008-04-19 16:34:29 UTC
According to the ebuild, there's good reason to:

src_compile() {
    # imlib2 has diff configure options for x86/amd64 mmx
    local mymmx=""
    if [[ $(tc-arch) == "amd64" ]] ; then
        mymmx="$(use_enable mmx amd64) --disable-mmx"
    else
        mymmx="--disable-amd64 $(use_enable mmx)"
Comment 4 Patrik Larsson 2008-04-19 17:00:29 UTC
So what you are saying is that the use of AMD64 optimized code is not to be turned on? Is there some way of getting statement "Use AMD64 for speed" to say yes here that can apply to other ebuilds with similar options for using optimized code?
Comment 5 Patrik Larsson 2008-04-19 19:05:08 UTC
So what you are saying is that the use of AMD64 optimized code is not to be turned on? Is there some way of getting statement "Use AMD64 for speed" to say yes here that can apply to other ebuilds with similar options for using optimized code?
Comment 6 SpanKY gentoo-dev 2008-04-19 21:02:48 UTC
the profiles in question need to be updated to not mask the mmx flag
Comment 7 Patrik Larsson 2008-04-19 21:22:27 UTC
OK, now i am getting confused. Jeroen Roovers is saying one thing and SpanKY says another as i understand this. What is going on? What is going to happen here?

Some clarification would be nice here.
Comment 8 Stefan Briesenick (RETIRED) gentoo-dev 2008-07-14 23:25:26 UTC
if I read this:

> if [[ $(tc-arch) == "amd64" ]] ; then
>         mymmx="$(use_enable mmx amd64) --disable-mmx"

I would say: no profile change, but an ebuild change would be THE solution:

> if [[ $(tc-arch) == "amd64" ]] ; then
>         mymmx="--enable-amd64 --disable-mmx"

I guess, there is no excuse for not enabling "amd64" on that platform. ;-) Ok, one should not use 3Dnow on Intel, but MMX compatible code should work everywhere on AMD64/EMT64.
Comment 9 Santiago M. Mola (RETIRED) gentoo-dev 2008-09-17 10:50:32 UTC
vapier, is there anything that prevents --enable-amd64 to be enabled unconditionally for amd64?

Leaving mmx masked and just using $(use_enable amd64) seems ok to me.
Comment 10 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-12-21 00:17:17 UTC
ahha. This use flag is masked from bug 166240. I compiled imlib2 with USE=mmx and tested a few programs that depended on it and didn't find an issue. So, unmasked the use flag on 2007 and 2008 profiles.

Open another bug if there are additional problems. Thanks.
Comment 11 Yuriy Rusinov 2009-01-24 11:26:20 UTC
Unmasking USE flags "mmx" results in problem in idesk, see bug http://bugs.gentoo.org/show_bug.cgi?id=253619
Comment 12 Seerp 2009-02-07 02:21:44 UTC
Compiling imlib2 with the mmx USE-flag enabled breaks pypanel for me. It crashes with an segmentation fault.

After disabling the mmx USE-flag it works flawlessly again.

Cheers, Seerp
Comment 13 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-02-07 04:37:50 UTC
ok fine, masked again. In the future you shouldn't append comments to old bugs, they are likely to get overlooked.
Comment 14 SpanKY gentoo-dev 2009-03-01 18:20:25 UTC
*** Bug 260746 has been marked as a duplicate of this bug. ***
Comment 15 Siim Ainsaar 2011-06-03 15:17:10 UTC
How could this bug be FIXED if the flag is still masked? If the newest imlib2[mmx] works, then the mask should be lifted. If not, then perhaps a better resolution would be WONTFIX together with a fixing request upstream. Certainly not yet FIXED.
Comment 16 Markos Chandras (RETIRED) gentoo-dev 2011-06-05 17:45:30 UTC
Re-opening per user request
Comment 17 Agostino Sarubbo gentoo-dev 2012-08-12 19:46:59 UTC
If this flag could break something...no need to force to enable it. 

Closed for now as cantfix
Comment 18 Markos Chandras (RETIRED) gentoo-dev 2014-09-03 18:57:37 UTC
*** Bug 519710 has been marked as a duplicate of this bug. ***
Comment 19 Emmanuel Anne 2014-09-03 19:28:27 UTC
I took the time to test the 2 programs mentioned, idesk and pypanel.
idesk doesn't crash anymore with my build using amd64 assembler (default configuration for imlib2).
For pypanel I am not sure because I can't make it work, it seems lost in my e18 environment, it outputs this error on startup :
Xlib.protocol.request.QueryExtension
Traceback (most recent call last):
  File "/usr/bin/pypanel", line 957, in <module>
    PyPanel(display.Display())
  File "/usr/bin/pypanel", line 94, in __init__
    self.getDesktopNames()
  File "/usr/bin/pypanel", line 360, in getDesktopNames
    desktop.total = self.root.get_full_property(self._DESKTOP_COUNT, 0).value[0]
AttributeError: 'NoneType' object has no attribute 'value'

But it isn't a crash anyway, it just can't seem to be able to find the desktop here.
I don't think the disabling of optimizations is still usefull, but anyway I use my own build of imlib2, so it's not a problem for me...
Comment 20 SpanKY gentoo-dev 2015-08-14 06:36:35 UTC
(In reply to Patrik Larsson from comment #7)

Jeroen misread the code -- the imlib2 configure script is confusing and provides two different options for enabling assembly code for the arch.  --enable-mmx controls 32bit mmx code and --enable-amd64 controls 64bit sse2 code.  trying to enable mmx in a 64bit build or amd64 in a 32bit build leads to hard failures.

that said, the amd64 code path is sse2 based, not mmx (even though the routines are based on the mmx originally), so i can change flags to sse2.  i'll do that in the 9999 ebuild and it'll be in the next release if no one complains.
http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f0496dcd57987019ba99c2e6c1bfc607d15b07f