Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 260064 - media-video/mplayer custom-cflags kills all cflags
Summary: media-video/mplayer custom-cflags kills all cflags
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-23 21:17 UTC by emerald
Modified: 2009-03-24 14:02 UTC (History)
0 users

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


Attachments
emerge --info (emerge.info,21.20 KB, text/plain)
2009-02-25 19:51 UTC, emerald
Details
mplayer custom-cflags warning (mplayer-custom-cflags-warn.patch,896 bytes, text/plain)
2009-03-10 20:32 UTC, emerald
Details
restore mplayer custom-cflags functionality (mplayer-custom-cflags-function.patch,1.25 KB, text/plain)
2009-03-10 20:45 UTC, emerald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description emerald 2009-02-23 21:17:52 UTC
mplayer with custom-cflags kills all custom set cflags, leaving only the -march 
intact, at the same time resetting any -O* to -O2

From the name custom-cflags i'd assume my cflags are taken and not the 
upstream-provided ones. But since the ebuild filteres all some safe? flags are 
chosen? Whats custom-cflags supposed to mean then?
In other applications custom-...flags means the user provided flags are chosen, 
not other arbitrary ones.

with USE=custom-cflags
x86_64-pc-linux-gnu-gcc -MM -Wundef -Wdisabled-optimization -Wno-pointer-sign 
-Wdeclaration-after-statement -std=gnu99  -march=native -pipe -O2 
-D__STDC_LIMIT_MACROS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-D_LARGEFILE64_SOURCE -I.  -I/usr/X11R6/include -I/usr/include/ 
-I/usr/include/SDL  -D_REENTRANT -I/usr/kde/3.5/include/artsc -pthread 
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -D_REENTRANT   
-Ilibdvdread4 -I/usr/include/freetype2   -I/usr/include/dirac   
-I/usr/include/schroedinger-1.0 -I/usr/include/liboil-0.3   
-I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 
-I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 
-I/usr/include/libpng12   -Ilibdvdnav   gui/mplayer/gtk/gtk_url.c | sed -e 
"s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &," > 
gui/mplayer/gtk/gtk_url.d
Comment 1 Steve Dibb (RETIRED) gentoo-dev 2009-02-25 06:20:58 UTC
need emerge --info, emerge -pv mplayer
Comment 2 emerald 2009-02-25 09:55:39 UTC
I don't have access to my system now, i'll post those infos later.
But when looking at the ebuild it's already very clear that everything is 
killed:

        if use custom-cflags; then
                # let's play the filtration game!  MPlayer hates on all!
                strip-flags
                # ugly optimizations cause MPlayer to cry on x86 systems!
                        if use x86 || use x86-fbsd ; then
                                replace-flags -O* -O2
                                filter-flags -fPIC -fPIE

                                use debug || append-flags -fomit-frame-pointer
                        fi
                append-flags -D__STDC_LIMIT_MACROS
        else
                unset CFLAGS CXXFLAGS
        fi

I don't understand the strip-flags call at all since it's not anything custom 
anymore if everything is stripped.
Even if upstream hates and does not support other flags than their own, it 
should still be possible, especially in gentoo and especially with the 
custom-cflags use-flag, to use own cflags.
Comment 3 emerald 2009-02-25 19:51:27 UTC
Created attachment 183176 [details]
emerge --info
Comment 4 emerald 2009-02-25 19:52:47 UTC
emerge -p:

[ebuild   R   ] media-video/mplayer-1.0_rc2_p28450  USE="X a52 aac aalib alsa 
amrnb amrwb arts ass bidi bl cddb cdio cdparanoia custom-cflags custom-cpuopts 
dga dirac doc dts dv dvd enca encode esd fbcon ftp ggi gif gtk iconv ipv6 jack 
jpeg ladspa libcaca lirc live lzo mad md5sum mmx mmxext mng mp2 mp3 musepack 
openal opengl oss png pnm pulseaudio quicktime radio rar rtc samba schroedinger 
sdl speex sse sse2 ssse3 teletext tga theora truetype unicode v4l v4l2 vorbis 
x264 xanim xinerama xscreensaver xv xvid xvmc -3dnow -3dnowext (-altivec) 
-bindist -cpudetection -debug -directfb -dvb (-dvdnav) -dxr3 -joystick -nas 
-nemesi -pvr (-real) (-svga) (-vidix) (-win32codecs) -zoran" VIDEO_CARDS="vesa 
-mga -s3virge -tdfx"
Comment 5 Steve Dibb (RETIRED) gentoo-dev 2009-03-10 18:57:25 UTC
This is one of those many things in mplayer that, though not documented, there's a reason it's in there ... and for the life of me I can't remember why now.

I'm going to lean towards not changing it, since I do at least remember it being in there for a reason.  Also, since this is the first time anyone's complained, and it obviously works fine.

If you really want to rice, I'd recommend an overlay or just tweaking the ebuild  yourself.  Either one would be trivial.
Comment 6 emerald 2009-03-10 19:16:34 UTC
Then, why even offer the flag if it's doing something.... whatever it does, it's definitely not what anyone will expect if this flag is set.
About your 'rice', I got a powerpc iBook, it will often bring strange color overflow errors when using mplayer with --ffast-math, so I'd rather set my own CFLAGS and surely not use just -O2 instead of use either -O2 or the default mplayer-generated flags which are available through the ebuild.

Sure, an overlay is no problem, but it's the general approach, why offer a flag if it's effect is opposite to the same flag for all other ebuilds?
qt-*-4.5 offers a similar flag but prints a warning if using the flag but not doing something unexpected as this one here.
Comment 7 Steve Dibb (RETIRED) gentoo-dev 2009-03-10 20:13:42 UTC
> qt-*-4.5 offers a similar flag but prints a warning if using the flag but not
> doing something unexpected as this one here.

Patches welcome for more verbosity.

> About your 'rice', I got a powerpc iBook, it will often bring strange color
> overflow errors when using mplayer with --ffast-math

Alright, well now we are getting close to a real bug report.

I don't see ffast-math in there anyway, am I missing something?  Or did you  mean without it.
Comment 8 emerald 2009-03-10 20:32:23 UTC
Created attachment 184603 [details]
mplayer custom-cflags warning
Comment 9 emerald 2009-03-10 20:39:54 UTC
--ffast-math is automagically being applied when building mplayer without custom-cflags set, it's being used by upstream in their auto-detection.
But those errors are not my point. My point is, the general meaning of the flag custom-cflags and it's result in mplayer is opposite. E.g. if I want mplayer/mencoder to be accurate in their calculations and not use this flag, or  use whatever compiler options I want (e.g. with icc), I will have to tweak the ebuild by myself even though the ebuild provides a flag to apply my very own custom cflags. Only because all my cflags are stripped unconditionally. Then whats the use of even having this flag at all?
Comment 10 emerald 2009-03-10 20:45:18 UTC
Created attachment 184612 [details]
restore mplayer custom-cflags functionality

Restores the common behavior of custom-cflags and adds an additional warning for everyone setting this flag, including bug reporting advice.
Comment 11 Steve Dibb (RETIRED) gentoo-dev 2009-03-11 23:28:25 UTC
alright, thanks for the patches.  I'll get em in next release here, which should be soon.
Comment 12 Steve Dibb (RETIRED) gentoo-dev 2009-03-24 14:02:27 UTC
Fixed in CVS