I find that xfree rejects cflags because people were complaining about xfree breaking. The comments seem to indicate that the maintainers don't want people using -march= and then enabling -msse or -mmmx or such things that their CPU doesn't handle, and so filter all cflags. It seems that -fomit-frame-pointer doesn't hurt X, and there is good reason to use it. I suggest two things: 1) Expliticely allow -fomit-frame-pointer 2) add a USE flag 'xfreecflags' to respect cflags in xfree for users who know what they're doing. Reproducible: Always Steps to Reproduce: 1. set CFLAGS to include -fomit-frame-pointer 2. emerge xfree Actual Results: emerged xfree without -fomit-frame-pointer Expected Results: emerge xfree with -fomit-frame-pointer (None necessary)
Created attachment 19896 [details] ebuild for 4.3.99.14 that allows -fomit-frame-pointer, -Os, and USE=+xfreecflags just backport the changes to older X ebuilds. They're all at the top, and just involve the script that strips the cflags. Annoying little thing but has its uses, although you might want to hold off on actually releasing this with -fomit-frame-pointer in the ALLOWED_FLAGS until I test it more. It's given me no trouble so far but I don't know how to stress-test X.
Is it so difficult to simply comment the strip-flags line? That also seems more likely to ensure people doing so are aware of what they're doing and that they read the large comment about extra flags causing problems and not to file bugs if using them. It actually doesn't strip all CFLAGS. It allows these: ALLOWED_FLAGS="-fstack-protector -march -mcpu -O -O1 -O2 -O3 -pipe" and in the case of ACCEPT_KEYWORDS="~arch" also allows -freorder-blocks and -fprefetch-loop-arrays, based on reading the strip-flags and filter-flags functions in /usr/portage/eclass/flag-o-matic.eclass. However adding -fomit-frame-pointer to ALLOWED_FLAGS may be a valid suggestion. Also in the future please attach diffs to the current ebuilds in portage; it makes it a lot easier to see what the changes actually are.
btw compiling with -Os is known to cause problems, that's why it's disallowed by default.
Ahh, thanks, I'll keep the -Os thing in mind, please make sure to filter that out in any case. Flags that DEFINITELY cause problems should be filtered. Flags that are unconfirmed or just too uncommon for us to care should be allowed by using the USE=
You haven't justified yet why a USE flag is better than commenting out the strip-flags line, with its accompanying comments on why it may be a bad idea etc.
good point, but -fomit-frame-pointer doesn't seem harmful (I've been using it on 4.3.0-r3) so test it out and if it's not problematic add it to the allowed flags.
We can give it a shot on the next development release and see if there seem to be problems.
OK, it's in 4.3.99.16.
You can mark this bug INVALID or WONTFIX any time, you know
Ah, INVALIDed it myself