1 |
Tuesday 30 May 2006 07:41 skrev Graham Murray: |
2 |
> > Besides, by looking at the terminal while merging packages, you will |
3 |
> > soon notice, that lot's of packages add their very own CFLAGS to your |
4 |
> > default ones. For example mplayer or xine-lib was compiled with '-O3' on |
5 |
> > my system, allthough i have '-O2' in my CFLAGS. (As far as i know, "gcc |
6 |
> > -O3 -O2" == "gcc -O3"). |
7 |
> |
8 |
> Where packages do this, should they not filter out the appropriate |
9 |
> flags from the user's CFLAGS and substitute their flags rather than |
10 |
> having both flags on the command line? |
11 |
|
12 |
Not in this particular case. xine-lib is a good example. src_compile() |
13 |
contains the following in the ebuild (and more): |
14 |
|
15 |
if [[ $(tc-arch) == "x86" ]]; then |
16 |
filter-flags -fforce-addr |
17 |
filter-flags -momit-leaf-frame-pointer |
18 |
is-flag -O? || append-flags -O2 |
19 |
fi |
20 |
|
21 |
On an x86 architecture it filters out -fforce-addr |
22 |
and -momit-leaf-frame-pointer. If the CFLAGS contain any optimizations it |
23 |
just appends -O2 yielding that -O2 will be used as stated by Christian |
24 |
Limberg. In 'man gcc' you find the following statement: |
25 |
|
26 |
"If you use multiple -O options, with or without level numbers, the last such |
27 |
option is the one that is effective." |
28 |
|
29 |
So this is completely legal. |
30 |
|
31 |
And I very much doubt that there are any ebuilds in the portage tree that |
32 |
enforces -O3 or higher... |
33 |
|
34 |
-- |
35 |
Bo Andresen |