Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 100970 - Many ebuilds wrongly convert -Os and -O1 into -O2
Summary: Many ebuilds wrongly convert -Os and -O1 into -O2
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-31 23:38 UTC by Marc Doughty
Modified: 2005-08-01 12:50 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 Marc Doughty 2005-07-31 23:38:19 UTC
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).
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-08-01 05:30:09 UTC
(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.
Comment 2 Marc Doughty 2005-08-01 12:50:08 UTC
(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.