Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 270497 - flag-o-matic.eclass strip-flags should allow -fno-omit-frame-pointer
Summary: flag-o-matic.eclass strip-flags should allow -fno-omit-frame-pointer
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-19 22:16 UTC by Mart Raudsepp
Modified: 2009-05-27 22:39 UTC (History)
0 users

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 Mart Raudsepp gentoo-dev 2009-05-19 22:16:23 UTC
-fno-omit-frame-pointer should be in ALLOWED_FLAGS.
Since quite some time gcc defaults to omitting frame pointers with -O2 on systems where omitting frame pointers does not disturb with debugging thanks to the location lists features since gcc4/gdb-6.7ish.
However it disturbs sample based profiling with sysprof (and I believe also oprofile) - without frame pointers they are not able to construct a function call tree in the end (sampling must be low resource usage and only frame pointers get saved for later processing I think).
But -O2 is in ALLOWED_FLAGS, so a typical optimizing developer (like me, who routinely profiles whole desktop and system to find the bottlenecks..) machine is built with CFLAGS="-O2 -fno-omit-frame-pointer -ggdb ...", and packages that use strip-flags get frame pointers omitted because gcc gets -O2 passed but not -fno-omit-frame-pointer. -O2 is used because profiling makes not much sense when not profiling the typical -O2 optimized system.

Please add -fno-omit-frame-pointer to the ALLOWED_FLAGS list in flag-o-matic.eclass
Comment 1 SpanKY gentoo-dev 2009-05-19 23:35:43 UTC
sounds fine to me if you feel like making the change yourself
Comment 2 Mark Loeser (RETIRED) gentoo-dev 2009-05-20 00:09:13 UTC
(In reply to comment #1)
> sounds fine to me if you feel like making the change yourself
> 

Same here....or file bugs for where we actually call strip-flags so we can get rid of it :)  I'd love to actually fix the compiler bugs instead of ignoring them.
Comment 3 Mart Raudsepp gentoo-dev 2009-05-20 00:14:35 UTC
I was merely trying to find out how more than 50% of my CPU resources (dual-core) was being used with mplayer -benchmark and found with sysprof that both mplayer and mozilla-firefox were missing -fno-omit-frame-pointer in its CFLAGS file in VDB (mplayer had no CFLAGS VDB file at all), so investigated it to be reminded again that strip-flags was causing it.
I believe both are using strip-flags to get more support from upstream or some such.
So I'd basically just add -fno-omit-frame-pointer to the short line with -fno-ident in it already? :)
Comment 4 SpanKY gentoo-dev 2009-05-23 23:10:31 UTC
ive added -fno-omit-frame-pointer to the allowed list
http://sources.gentoo.org/eclass/flag-o-matic.eclass?r1=1.134&r2=1.135

but i dont think this is what you actually want.  if you're saying the packages are building with -fno-omit-frame-pointer but you *dont* want them to, then this strip-flags change wouldnt matter.  you actually want to be able to add -fomit-frame-pointer to your flags and/or have the build system of those two packages *not* add -fno-omit-frame-pointer themselves.  try USE=custom-cflags in that case.
Comment 5 Mart Raudsepp gentoo-dev 2009-05-27 09:47:17 UTC
Thanks for making the change. I hadn't done it yet because I wasn't able to take the time yet to rebuild one of these big packages affected yet to verify it.

As for the comment, please read what I actually wrote in comment #0.

gcc is adding -fomit-frame-pointer itself implicitly with -O2 automatically on many architectures these days, so for sample based profiling I need to disable that with a -fno-*, but strip-flags filters that out. The ebuilds are not adding -fomit-frame-pointer -- GCC is.
Comment 6 SpanKY gentoo-dev 2009-05-27 22:39:39 UTC
your comment #3 seemed to imply you thought the speed hit was due to the FP being omitted, but whatever