On two ~x86 machines, strip-flags does nothing. I have to manually prefix emerge with CFLAGS='' and run it like this: CLFAGS='' emerge emacs-cvs It is important that we remove flags for emacs-cvs. Without stripping the CFLAGS, emacs-cvs doesn't get past bootstrap for certain flags.
On ~x86 machines, strip-flags allows stable flags, "-O -O1 -O2 -mcpu -march -mtune -fstack-protector -pipe -g" plus unstable flags, "-Os -O3 -freorder-blocks -fprefetch-loop-arrays" (and arch specific flags needed for that arch to compile things correctly). If we need to remove flags listed above, we should use filter-flags to disable the flags explicitly.
I think we should be using a filter which removes any flags which interfere with debugging, especially given thats its a cvs port. Any suggestions?
In general I agree with the idea, given that per package CFLAGS setting is not available at the moment. If per package CFLAGS is supported by Portage, I would rather leave CFLAGS to users than filter except some of them known to cause problem. Some users may want to try emacs-cvs package not for helping development but for using newer version of Emacs, as <=emacs-21.3 has bad Unicode support, no GTK+, etc. However, I'm not strongly against removing any flags which interfer with debugging. What do other people say about it?
*** Bug 76875 has been marked as a duplicate of this bug. ***
I think that the emacs-cvs ebuild should focus on performance rather than debugging, unless a USE flag is present, such as 'debug', or something similar. A lot of developers use Emacs as their primary editor, but couldn't care less about firing up gdb to debug the emacs application. And likewise, emacs 21.x is missing a lot of essential features, even more Unicode and GTK+. I know for myself, I run emacs-cvs more than any other application on my systems (except maybe screen and rxvt).
I've started adding appropriate CFLAG munging to the ebuild. So far -O3 has been caught with replace-flags.