Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 288918

Summary: media-video/mplayer needs at least -O level on x86_64 to gain -fomit-frame-pointer
Product: Gentoo Linux Reporter: Mike Limansky <limanski>
Component: Current packagesAssignee: Gentoo Media-video project <media-video>
Status: VERIFIED FIXED    
Severity: normal CC: Reimar.Doeffinger
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Build log

Description Mike Limansky 2009-10-13 18:48:39 UTC
media-video/mplayer-1.0_rc4_p20090919-r2 can not be compiled on amd64. I tried both gcc-4.4.1 and gcc-4.3.3 - there is same error.

Reproducible: Always

Steps to Reproduce:
1. emerge mplayer
Actual Results:  
mplayer compilation failed.

Expected Results:  
mplayer installed successfully

Portage 2.1.7 (default/linux/amd64/2008.0/desktop, gcc-4.4.1, glibc-2.10.1-r0, 2.6.30-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.30-gentoo-r5-x86_64-AMD_Athlon-tm-_64_Processor_3000+-with-gentoo-2.0.1
Timestamp of tree: Sun, 11 Oct 2009 19:30:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p33
dev-java/java-config: 1.3.7-r1, 2.1.9
dev-lang/python:     2.5.4-r2, 2.6.3, 3.1.1-r1
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.4-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.1
sys-apps/sandbox:    2.1
sys-devel/autoconf:  2.13, 2.63-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.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -pipe -fomit-frame-pointer"
CHOST="x86_64-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/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=k8 -pipe -fomit-frame-pointer"
DISTDIR="/mnt/data/distfiles"
FEATURES="assume-digests ccache distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://linuxarchive.nnov.ru/Unix/Gentoo ftp://ftp1.zxc.nnov.ru/gentoo/ http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="ru"
MAKEOPTS="-j1"
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="3dnow X a52 aac aalib acpi alsa amd64 audiofile branding bzip2 cairo cdr clamav cli consolekit cracklib crypt cups dbus dri dts dvd dvdr dvdread encode esd evo fam firefox flac foomaticdb fortran gdbm gif gpm hal iconv icq jack jpeg kde kdeenablefinal kdehiddenvisibility kpathsea libcaca libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mplayer mudflap multilib ncurses nls nptl nptlonly offensive ogg opengl openmp oscar pam pcre pdf perl png ppds pppd python qt qt3 qt3support qt4 quicktime readline reflection scanner sdl session spell spl srt sse sse2 ssl startup-notification svg sysfs tcpd thunar tiff truetype unicode usb vorbis x264 xine xml xmms xorg xulrunner xv xvid zlib" ALSA_CARDS="emu10k1" 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Mike Limansky 2009-10-13 18:49:34 UTC
Created attachment 206995 [details]
Build log

Build log for the problem (gcc-4.3.3).
Comment 2 Reimar Döffinger 2009-10-14 08:20:43 UTC
Compiling without -fomit-frame-pointer is in no way supported by upstream, if you need that unset HAVE_EBP_AVAILABLE manually and expect vastly slower code for some things.
Comment 3 Mike Limansky 2009-10-14 09:21:14 UTC
I'll check it. So, I suppose the ebuild shall be fixed to use proper CFLAGS, right?
Comment 4 Mike Limansky 2009-10-16 22:55:25 UTC
It seems like it not depends on fomit-frame-pointer option.
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2009-10-26 18:58:12 UTC
Try mplayer-1.0_rc4_p20091026.
Comment 6 Reimar Döffinger 2009-10-26 20:37:22 UTC
Well, -fomit-frame-pointer does not really have any effect without at least -O or possibly -O2 I think.
Anyway, the compilation options seem thoroughly broken (at lest very suboptimal) to me, personally I'd consider broken compilation preferable to the badly performing code this would probably give.
Now the real question is of course how those compilation options ended up like this...
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2009-10-26 20:45:26 UTC
(In reply to comment #0)
> CFLAGS="-march=k8 -pipe -fomit-frame-pointer"
> CXXFLAGS="-march=k8 -pipe -fomit-frame-pointer"

Missing -O<ptimization> level.(In reply to comment #6)

> Now the real question is of course how those compilation options ended up like
> this...

^^

It seems to me that we need a code snip that will detect if no >= -O1 flag is specified, and then append -O1 as failsafe.
Comment 8 Reimar Döffinger 2009-10-26 21:00:48 UTC
If you ask for my opinion: I am very much opposed to fiddling with the compilation options behind the user's back. If you want to do that, then just always use the only variant supported by upstream: those that MPlayer's configure detected.
Otherwise just e.g. replicated the warning from MPlayer's configure: if you insist on overriding compilation flags, better be prepared to fix the issues yourself (or if you want something more user-friendly). However in the case of missing -O2 or something I really think the warning belongs on some higher level, I strongly doubt there are many users who really intend that.
Comment 9 Reimar Döffinger 2009-10-26 21:06:24 UTC
I forgot: A patch to implement detection of HAVE_EBP_AVAILABLE similar to HAVE_EBX_AVAILABLE would be possible, too - except as said the question is if a slow system and slow MPlayer is better than it not compiling at all for most users or not.
It's been long since I tested, but I think this e.g. has a more than 10% speed impact on H.264 with CABAC (probably the case where performance is needed most), without counting the possible performance losses due to missing -O2.
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2009-10-26 21:15:23 UTC
That's why I actually removed all the remaining fiddling from
the latest snapshot (with todays date).

The users environment is now respected, with the exception that 
-fomit-frame-pointer is appended unless USE="debug" is used on
x86.

On x86_64 -fomit-frame-pointer is appended by gcc itself with -O set:

"-O also turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging", ref. `man gcc`

The check you mentioned would be the best possible outcome of course, as I agree that a slow-mplayer is better than no-mplayer.
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2009-10-27 13:59:35 UTC
+  27 Oct 2009; Samuli Suominen <ssuominen@gentoo.org>
+  mplayer-1.0_rc4_p20091026-r1.ebuild:
+  If no -O flag is specified, append-flags -O2 (to gain -fomit-frame-pointer
+  by gcc) wrt #288918

Failsafe added. Not the ideal solution, but same as we already have for FFmpeg.