Many ebuilds and their parent eclasses are using various methods to force the use of '-O2' in an effort to maintain stability and coherency amidst CFLAG-hotshots. This causes problems with those of us building low-memory-footprint or semi-embedded systems which benefit greatly from use of the -Os flag. Can a policy be set that transforms to -O2 should only happen to instances of -O[3-9], please? I'd like to see that my -Os flags (which are considered conservative and safe for use by the GCC team) are applied across the board. Reproducible: Always Steps to Reproduce: 1. Set optimization level to -Os in /etc/make.conf 2. #emerge -e system 3. Watch as many important packages (including gcc, glibc, and mozilla-*) are compiled with -O2 instead of the more conservative -Os you asked for. Actual Results: Packages that do optimization flag transforms, appends, or substitutions erroneously compile many packages with '-O2'. Expected Results: Packages that do optimization flag transforms, appends, or substitutions should only force '-O2' when they encounter flags '-O[3-9]' in the CFLAGS, they should not transform '-O?'. I'm marking this major, because there are several bugs currently open (67670, 100146) and several more in the history (57223 is a good example, with great resolution) that wouldn't have popped-up if this was fixed on a policy-level. This will also affect many ebuilds from many development teams. Also, the idea that conservative CFLAGS are getting replaced by less conservative ones because some people use extreme ones is somewhat antithetical to Gentoo's 'build-your-own' philosophy. There's a simple way to let a lot of people have their cake while preventing the hotshots from getting burned on the candles (see 'expected results' section).
(In reply to comment #0) > Many ebuilds and their parent eclasses are using various methods to force the > use of '-O2' in an effort to maintain stability and coherency amidst CFLAG-hotshots. > > This causes problems with those of us building low-memory-footprint or > semi-embedded systems which benefit greatly from use of the -Os flag. Which "many ebuilds" and "parent eclasses" do you have in mind? Anyway: - if you want particular ebuild modified, file a new bug against that ebuild. - if you want some Gentoo policy on CFLAGS substitution, then bugzilla is really not the right place to discuss such things. Such ideas need to be taken to gentoo-dev mailing list.
(In reply to comment #1) I was hoping that this bug could be made into a 'meta-bug' of sorts, and that as ebuilds are found that conflict, I'd pop bugs as blockers to this one. Here's a quick list of packages I think I saw '-O2' scrolling by with even though I'm configured to pass '- Os' as a CFLAG: GCC, glibc, and even XOrg are doing these transforms. XOrg in particular is doing it for bug #12775, which is an oddball corner-case involving a deprecated GCC on K6-2, and nothing else. glibc is locked to -O2 as well, and it's a HUGE package that would benefit greatly from -Os on lightweight systems. Perhaps I will try to join a Gentoo-dev mailing list to raise this issue. It's been irking me for a while and resolution would be wonderful.