Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 12021 - Bug in "inherit flag-o-matic" model, replace-flags acts "wrong"
Summary: Bug in "inherit flag-o-matic" model, replace-flags acts "wrong"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High minor
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-12 08:38 UTC by Sascha Herrmann
Modified: 2003-02-04 19:42 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 Sascha Herrmann 2002-12-12 08:38:01 UTC
Hi, 
while bugfixing some ebuild i discovered a bug in the _"inherit flag-o-matic"_
system (taken from an ebuild i wrote):

# The order the flags are replaced is IMPORTANT, because while using:
# replace-flags "-march=k6" "-march=i586"
# replace-flags "-march=k6-2" "-march=i586"
#
# following output appeared:
# original CFLAGS="-march=k6-2 -O3 ..."
# replaced CFLAGS="-march=i586 -2 -O3 ..."
this means that gcc tries to do gcc -c -march=i586 -2 -O3  ... and here he says
"unknown option!".
So the point is that replace-flags takes a match of regex but the regex is not
FULLY fullfilled! (here -march=k6 matches -march=k6-2 and is replaced while -2
is separated!)
Comment 1 SpanKY gentoo-dev 2002-12-12 12:34:40 UTC
the eclass doesnt use regex to replace but simple bash string replacing 
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-14 09:47:22 UTC
Ditto.  Rather than duplicating work, look at the 'gcc2_flags' function
in the gcc.eclass, OR do it in this order:

# replace-flags "-march=k6-2" "-march=i586"
# replace-flags "-march=k6" "-march=i586"

And if you really think about it, it does do exactly what you ased for :P

Otherwise you have to do it like this:

# replace-flags "-march=k6 " "-march=i586 "
# replace-flags "-march=k6$" "-march=i586"

or to that extend.  Anyhow, it was not designed to error check, so not
really valid in my mind.  Closing ...