Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38100 - mozilla-firebird optimization code is wrong
Summary: mozilla-firebird optimization code is wrong
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Aron Griffis (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-13 13:40 UTC by Jason Rhinelander
Modified: 2004-03-18 21:24 UTC (History)
2 users (show)

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 Jason Rhinelander 2004-01-13 13:40:22 UTC
mozilla-firebird's code for optimization is odd.  If I have -O2 in my CFLAGS,
it gets compiled with -O2, but if I have -O3, it gets compiled with -O.

The problem comes from this code:

# -O2 and below allowed on 32-bit
enable_optimize=$(echo "$CFLAGS" | sed 's/.*\(-O[012]\?\).*/\1/p')
enable_optimize=${enable_optimize:--O2}
filter-flags -O -O?
;;


An example:
$ CFLAGS="-f1337foobar -O3 -march=1337-x86"; enable_optimize=$(echo "$CFLAGS" | sed 's/.*\(-O[012]\?\).*/\1/p'); echo $enable_optimize
-O -O

CFLAGS="-f1337foobar -O2 -march=1337-x86"; enable_optimize=$(echo "$CFLAGS" | sed 's/.*\(-O[012]\?\).*/\1/p'); echo $enable_optimize
-O2 -O2

(I have no idea why the -O is doubled - the /p on the regex seems to do this,
but my sed regex knowledge isn't advanced).

This is easy enough to fix, just add:

'; s/-O[3-9]/-O2/' into the first sed command.
Comment 1 Jason Rhinelander 2004-01-13 14:56:19 UTC
Oops, no, I'm wrong, in involves also changing the [012] in the sed line to [0-9]


Should -Os be allowed as well?
Comment 2 SpanKY gentoo-dev 2004-01-13 15:22:33 UTC
any reason filter flags arent used ?
Comment 3 Aron Griffis (RETIRED) gentoo-dev 2004-03-18 21:24:09 UTC
thanks, I've fixed this in mozilla-firefox-0.8-r1 (but didn't bother to bump the rev)