public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] How to properly change CFLAGS ?
@ 2006-08-21 20:51 Stefan G. Weichinger
  2006-08-21 21:01 ` Richard Fish
                   ` (2 more replies)
  0 siblings, 3 replies; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-21 20:51 UTC (permalink / raw
  To: gentoo-user


I *don't* want to start some flamewar her, I am a newbie in this group,
and I just would like some info on how to do it right, as my extensive
rtfm'ing/googling/etc. has still not given me a satisfying answer.

I started my Gentoo-installation with CFLAGS containing -O3, believing
to do it right ...

Now I read about the fact that -O3 results in bigger binaries and isn't
at all guaranteed to give me a faster system. The bigger files result in
more load on IO, so this tells me that it puts the load on the
(relatively slow) 5400 rpm HDD I have in my laptop. OTOH I have "only"
512 MB RAM in there so it seems interesting to me to go the -O2 way of
doing Gentoo ...

Now the question:

Do I have to do "emerge -e --newuse world" on my system or what else
would be needed?

Is it worth the effort or should I prefer to spend the cpu-cycles on
re-emerging only the core-apps of my system? Or forget about it all and
enjoy my nice and shiny system as it is, simply editing make.conf to use
-O2 for any new emerges coming?

I am not asking this to get the "best result" in terms of speed or
performance, but to make sure that I don't break my system (which has
been backed up, sure, thanks ...).

Greets and thanks, Stefan.



-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-21 20:51 [gentoo-user] How to properly change CFLAGS ? Stefan G. Weichinger
@ 2006-08-21 21:01 ` Richard Fish
  2006-08-21 21:19   ` Stefan G. Weichinger
  2006-08-21 21:16 ` Neil Bothwick
  2006-08-22 14:12 ` Alan Mckinnon
  2 siblings, 1 reply; 48+ messages in thread
From: Richard Fish @ 2006-08-21 21:01 UTC (permalink / raw
  To: gentoo-user

On 8/21/06, Stefan G. Weichinger <lists@xunil.at> wrote:
> Do I have to do "emerge -e --newuse world" on my system or what else
> would be needed?

--newuse is not needed here.  "emerge -e world" will catch everything.

> I am not asking this to get the "best result" in terms of speed or
> performance, but to make sure that I don't break my system (which has
> been backed up, sure, thanks ...).

Changing CFLAGS should not cause any breakage.  So the choice is
entirely up to you whether you want to wait for an "emerge -e system"
or "emerge -e world" to complete.  I would be tempted to just change
the flags and hold off on recompiling everything until the next
version of gcc comes out.

-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-21 20:51 [gentoo-user] How to properly change CFLAGS ? Stefan G. Weichinger
  2006-08-21 21:01 ` Richard Fish
@ 2006-08-21 21:16 ` Neil Bothwick
  2006-08-21 21:27   ` Stefan G. Weichinger
  2006-08-22 14:12 ` Alan Mckinnon
  2 siblings, 1 reply; 48+ messages in thread
From: Neil Bothwick @ 2006-08-21 21:16 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

On Mon, 21 Aug 2006 22:51:43 +0200, Stefan G. Weichinger wrote:

> Now I read about the fact that -O3 results in bigger binaries and isn't
> at all guaranteed to give me a faster system. The bigger files result in
> more load on IO, so this tells me that it puts the load on the
> (relatively slow) 5400 rpm HDD I have in my laptop. OTOH I have "only"
> 512 MB RAM in there so it seems interesting to me to go the -O2 way of
> doing Gentoo ...

I agree with Richard's response to the other other parts of your mail, but
I'd also add that -O2 may not be the best setting for your system. -Os
applies some of the optimisations of -O3 but also optimises for size. It
is often the best setting for systems with slow memory and disk I/O, i.e.
laptops.


-- 
Neil Bothwick

A bug in the hand is better than one as yet undetected.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-21 21:01 ` Richard Fish
@ 2006-08-21 21:19   ` Stefan G. Weichinger
  2006-08-22  3:18     ` Richard Fish
  0 siblings, 1 reply; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-21 21:19 UTC (permalink / raw
  To: gentoo-user

Richard Fish schrieb:
> On 8/21/06, Stefan G. Weichinger <lists@xunil.at> wrote:
>> Do I have to do "emerge -e --newuse world" on my system or what else
>> would be needed?
> 
> --newuse is not needed here.  "emerge -e world" will catch everything.

Got that from one of the zillions of howtos ...
Reading the manpage would have told me to drop --newuse, on the other
hand it doesn't seem to do harm here ...

>> I am not asking this to get the "best result" in terms of speed or
>> performance, but to make sure that I don't break my system (which has
>> been backed up, sure, thanks ...).
> 
> Changing CFLAGS should not cause any breakage.  So the choice is
> entirely up to you whether you want to wait for an "emerge -e system"
> or "emerge -e world" to complete.  I would be tempted to just change
> the flags and hold off on recompiling everything until the next
> version of gcc comes out.

( ... "next version" in terms of minor- or major-version?)

I see the point in this. (AFAIK there is no way to break up "emerge -e
xy" into smaller pieces, something to do in several separated steps.
>From your posting I conclude that it also won't do any harm to re-emerge
selected parts with new CFLAGS?)

So does it make *any* sense to re-emerge stuff like OO.org or
Thunderbird? Maybe I will let my small distcc-cluster work on this ...
what else should it do? :-)

Apart from this I have enough computer-related experience to know that I
simply should be happy with the
luks-encrypted/cpufreq'ed/hibernating/etc. gentoo-system I now have at
hand, instead of spending numerous hours to gain minimal speedups.

And I am.

Thanks a lot, Stefan.

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-21 21:16 ` Neil Bothwick
@ 2006-08-21 21:27   ` Stefan G. Weichinger
       [not found]     ` <20060822003250.3daebfb0@krikkit.digimed.co.uk>
  2006-08-22  3:06     ` Richard Fish
  0 siblings, 2 replies; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-21 21:27 UTC (permalink / raw
  To: gentoo-user

Neil Bothwick schrieb:
> On Mon, 21 Aug 2006 22:51:43 +0200, Stefan G. Weichinger wrote:
> 
>> Now I read about the fact that -O3 results in bigger binaries and isn't
>> at all guaranteed to give me a faster system. The bigger files result in
>> more load on IO, so this tells me that it puts the load on the
>> (relatively slow) 5400 rpm HDD I have in my laptop. OTOH I have "only"
>> 512 MB RAM in there so it seems interesting to me to go the -O2 way of
>> doing Gentoo ...
> 
> I agree with Richard's response to the other other parts of your mail, but
> I'd also add that -O2 may not be the best setting for your system. -Os
> applies some of the optimisations of -O3 but also optimises for size. It
> is often the best setting for systems with slow memory and disk I/O, i.e.
> laptops.

After sending my initial posting I thought I should have mentioned the
details of that laptop, as there are older and newer, slower and faster
ones ...

I think mine is somehow middleclass these days (correct me ...):

Acer TM 634
P4-M 1.8GHz (cpu family : 15, model : 2)
512 MB RAM
30 GB 5200 rpm HDD

So it is not *that* constrained in terms of RAM and disk, I assume.

But I am also ready to go the -Os-way if you recommend/suggest it for my
system.

Thanks a lot, Stefan.




-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
       [not found]     ` <20060822003250.3daebfb0@krikkit.digimed.co.uk>
@ 2006-08-22  2:28       ` Collins Richey
  2006-08-22 14:16         ` Bo Ørsted Andresen
  0 siblings, 1 reply; 48+ messages in thread
From: Collins Richey @ 2006-08-22  2:28 UTC (permalink / raw
  To: gentoo-user

On 8/21/06, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Mon, 21 Aug 2006 23:27:14 +0200, Stefan G. Weichinger wrote:
>
> > So it is not *that* constrained in terms of RAM and disk, I assume.
> >
> > But I am also ready to go the -Os-way if you recommend/suggest it for my
> > system.
>
> Many laptops have relatively poor memory and HD speed, irrespective of
> their capacity. -Os helps with slow IO.
>

I'm just curious. The last time I participated in a -O2 vs. -Os
discussion was 1 -1/2 to 2 years ago. There were certain software
components (don't remember which) where -Os was contraindicated -
warnings against compiling them with -Os. Have things progressed to
the point  where -Os can be generally recommended?


-- 
Collins Richey
     If you fill your heart with regrets of yesterday and the worries
     of tomorrow, you have no today to be thankful for.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-21 21:27   ` Stefan G. Weichinger
       [not found]     ` <20060822003250.3daebfb0@krikkit.digimed.co.uk>
@ 2006-08-22  3:06     ` Richard Fish
  2006-08-22  7:26       ` Stefan G. Weichinger
       [not found]       ` <1156978378.17760.22.camel@scarlatti.leonora.org>
  1 sibling, 2 replies; 48+ messages in thread
From: Richard Fish @ 2006-08-22  3:06 UTC (permalink / raw
  To: gentoo-user

On 8/21/06, Stefan G. Weichinger <lists@xunil.at> wrote:
> Acer TM 634
> P4-M 1.8GHz (cpu family : 15, model : 2)
> 512 MB RAM
> 30 GB 5200 rpm HDD

It's all relative.  I have a 2.1Ghz Core Duo with 2G of RAM and a
160Gb HD, so *I* would consider your laptop, um, "underpowered".  :-)

But I also run with -Os.  The fact is that some things will run
slightly faster at -Os than -O2, and some things will be slightly
slower.  The same applies comparing -O3 to -O2, or -O3 to -Os; it all
depends on what you are doing at the moment.

So you should not assume that -O3 is faster for some random task just
because it is "more optimized".  It simply makes different trade-offs
than -O2 or -Os, and because of the way CPUs and caches work these
days, those trade-offs may help or hurt a particular segment of code.

FYI, in all of the tests I did, the performance was within 10% of the
median. The real deciding factor for me now is that -Os seems to take
much less time and memory to compile than -O2 or -O3.  And being a
~arch user, time-to-compile is a nice thing to reduce.

-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-21 21:19   ` Stefan G. Weichinger
@ 2006-08-22  3:18     ` Richard Fish
  2006-08-22  7:23       ` Stefan G. Weichinger
                         ` (2 more replies)
  0 siblings, 3 replies; 48+ messages in thread
From: Richard Fish @ 2006-08-22  3:18 UTC (permalink / raw
  To: gentoo-user

On 8/21/06, Stefan G. Weichinger <lists@xunil.at> wrote:
> Richard Fish schrieb:
> > or "emerge -e world" to complete.  I would be tempted to just change
> > the flags and hold off on recompiling everything until the next
> > version of gcc comes out.
>
> ( ... "next version" in terms of minor- or major-version?)

Gcc version numbers are in the form of X.Y.Z, so at a change in X or
Y.  The .Z changes should be just bug-fixes.  The sad thing is that,
due to changes in the C++ library, it is commonly to recompile all C++
applications when a new version of gcc comes out.  And even if it
isn't strictly /necessary/, an emerge -e world is considered the safe
way to handle a gcc upgrade.

> I see the point in this. (AFAIK there is no way to break up "emerge -e
> xy" into smaller pieces, something to do in several separated steps.

Actually there is.  You can find all packages not compiled with -Os
and rebuild them with something like:

cd /var/db/pkg
for pkg in */* ; do
    grep -v -- "-Os" $pkg/CFLAGS >/dev/null
    test $? -eq 0 && emerge --oneshot =$pkg
done

> From your posting I conclude that it also won't do any harm to re-emerge
> selected parts with new CFLAGS?)

Correct.

> Apart from this I have enough computer-related experience to know that I
> simply should be happy with the
> luks-encrypted/cpufreq'ed/hibernating/etc. gentoo-system I now have at
> hand, instead of spending numerous hours to gain minimal speedups.

Hrm, I also have the experience, but apparently not the good sense.... :-P

-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22  3:18     ` Richard Fish
@ 2006-08-22  7:23       ` Stefan G. Weichinger
  2006-08-22 15:03       ` Bo Ørsted Andresen
  2006-08-23 21:04       ` Bo Ørsted Andresen
  2 siblings, 0 replies; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-22  7:23 UTC (permalink / raw
  To: gentoo-user

Richard Fish schrieb:
> On 8/21/06, Stefan G. Weichinger <lists@xunil.at> wrote:
>> Richard Fish schrieb:
>> > or "emerge -e world" to complete.  I would be tempted to just change
>> > the flags and hold off on recompiling everything until the next
>> > version of gcc comes out.
>>
>> ( ... "next version" in terms of minor- or major-version?)
> 
> Gcc version numbers are in the form of X.Y.Z, so at a change in X or
> Y.  The .Z changes should be just bug-fixes.  The sad thing is that,
> due to changes in the C++ library, it is commonly to recompile all C++
> applications when a new version of gcc comes out.  

How do I know which they are? Certain USE-flags?

> And even if it
> isn't strictly /necessary/, an emerge -e world is considered the safe
> way to handle a gcc upgrade.

Ok.


>> I see the point in this. (AFAIK there is no way to break up "emerge -e
>> xy" into smaller pieces, something to do in several separated steps.
> 
> Actually there is.  You can find all packages not compiled with -Os
> and rebuild them with something like:
> 
> cd /var/db/pkg
> for pkg in */* ; do
>    grep -v -- "-Os" $pkg/CFLAGS >/dev/null
>    test $? -eq 0 && emerge --oneshot =$pkg
> done

Threw me an error immediately with zsh, in bash it starts off fine ...
thanks!

This way I am able to run this step by step while I am working on other
machines, satisfying my need for constant changes ;-)

>> From your posting I conclude that it also won't do any harm to re-emerge
>> selected parts with new CFLAGS?)
> 
> Correct.

Good to know.

>> Apart from this I have enough computer-related experience to know that I
>> simply should be happy with the
>> luks-encrypted/cpufreq'ed/hibernating/etc. gentoo-system I now have at
>> hand, instead of spending numerous hours to gain minimal speedups.
> 
> Hrm, I also have the experience, but apparently not the good sense.... :-P

I also don't have that all the time, not at all. At least I get better
in preparing my steps with proper backups etc. so the loss of time
and/or data is drastically reduced compared to earlier times. So in a
way it gets even more interesting to try things.

Thanks, Stefan.

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22  3:06     ` Richard Fish
@ 2006-08-22  7:26       ` Stefan G. Weichinger
       [not found]       ` <1156978378.17760.22.camel@scarlatti.leonora.org>
  1 sibling, 0 replies; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-22  7:26 UTC (permalink / raw
  To: gentoo-user

Richard Fish schrieb:
> On 8/21/06, Stefan G. Weichinger <lists@xunil.at> wrote:
>> Acer TM 634
>> P4-M 1.8GHz (cpu family : 15, model : 2)
>> 512 MB RAM
>> 30 GB 5200 rpm HDD
> 
> It's all relative.  I have a 2.1Ghz Core Duo with 2G of RAM and a
> 160Gb HD, so *I* would consider your laptop, um, "underpowered".  :-)

Oh my .... ;)
So you see, it is even more important to choose the right flags with
such an outdated box ;-)

> But I also run with -Os.  The fact is that some things will run
> slightly faster at -Os than -O2, and some things will be slightly
> slower.  The same applies comparing -O3 to -O2, or -O3 to -Os; it all
> depends on what you are doing at the moment.
> 
> So you should not assume that -O3 is faster for some random task just
> because it is "more optimized".  It simply makes different trade-offs
> than -O2 or -Os, and because of the way CPUs and caches work these
> days, those trade-offs may help or hurt a particular segment of code.
> 
> FYI, in all of the tests I did, the performance was within 10% of the
> median. The real deciding factor for me now is that -Os seems to take
> much less time and memory to compile than -O2 or -O3.  And being a
> ~arch user, time-to-compile is a nice thing to reduce.


I am going the -Os-way now, using your script from your other posting.

Thanks a lot for the information,
Stefan
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-21 20:51 [gentoo-user] How to properly change CFLAGS ? Stefan G. Weichinger
  2006-08-21 21:01 ` Richard Fish
  2006-08-21 21:16 ` Neil Bothwick
@ 2006-08-22 14:12 ` Alan Mckinnon
  2006-08-22 16:23   ` Dale
                     ` (2 more replies)
  2 siblings, 3 replies; 48+ messages in thread
From: Alan Mckinnon @ 2006-08-22 14:12 UTC (permalink / raw
  To: gentoo-user

On Mon, 2006-08-21 at 22:51 +0200, Stefan G. Weichinger wrote:
> I *don't* want to start some flamewar her, I am a newbie in this group,
> and I just would like some info on how to do it right, as my extensive
> rtfm'ing/googling/etc. has still not given me a satisfying answer.
> 
> I started my Gentoo-installation with CFLAGS containing -O3, believing
> to do it right ...
> 
> Now I read about the fact that -O3 results in bigger binaries and isn't
> at all guaranteed to give me a faster system. The bigger files result in
> more load on IO, so this tells me that it puts the load on the
> (relatively slow) 5400 rpm HDD I have in my laptop. OTOH I have "only"
> 512 MB RAM in there so it seems interesting to me to go the -O2 way of
> doing Gentoo ...

-O3 tells gcc to do some wild and wonderful optimizations, none of which
are guaranteed to perform well, or even to work at all. They have a use
and a place, but are not intended for general use.

-O2 is correct for a general purpose machine

> Now the question:
> 
> Do I have to do "emerge -e --newuse world" on my system or what else
> would be needed?

modify CFLAGS in /etc/make.conf
emerge -e system
emerge -s world

This will rebuild your toolchain (gcc, glibc and friends) to use -O2
then rebuild the entire system, including the toolchain again, with -O2.
Your current compiler was built with -O3, and you want to rebuild the
system using a compiler compiled as -O2, hence the 2 step process.

Be warned, this will take a LONG time to complete - consider yourself
lucky if you get away with 36 hours if you have all OOo and of KDE or
Gnome... So you should only consider doing it if you have specific
problems caused by -O3


alan


-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22  2:28       ` Collins Richey
@ 2006-08-22 14:16         ` Bo Ørsted Andresen
  0 siblings, 0 replies; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-22 14:16 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 768 bytes --]

On Tuesday 22 August 2006 04:28, Collins Richey wrote:
> I'm just curious. The last time I participated in a -O2 vs. -Os
> discussion was 1 -1/2 to 2 years ago. There were certain software
> components (don't remember which) where -Os was contraindicated -
> warnings against compiling them with -Os. Have things progressed to
> the point  where -Os can be generally recommended?

Though I haven't used it myself so far (I'm using -O2) I think it has in the 
sense that most programs in the Gentoo tree that are sensible to this (e.g. 
openoffice, kdelibs and xorg-x11) are replacing -Os by -O2 in the ebuilds. If 
you experience a problem with a program in the Gentoo tree because of -Os you 
should be filing a bug to get it fixed...

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22  3:18     ` Richard Fish
  2006-08-22  7:23       ` Stefan G. Weichinger
@ 2006-08-22 15:03       ` Bo Ørsted Andresen
  2006-08-22 19:58         ` Stefan G. Weichinger
  2006-08-23 21:04       ` Bo Ørsted Andresen
  2 siblings, 1 reply; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-22 15:03 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

On Tuesday 22 August 2006 05:18, Richard Fish wrote:
> > I see the point in this. (AFAIK there is no way to break up "emerge -e
> > xy" into smaller pieces, something to do in several separated steps.
>
> Actually there is.  You can find all packages not compiled with -Os
> and rebuild them with something like:

[SNIP]

Just wanted to add that another approach for emerging the packages that are
used the most could be found in [1]. Be replacing splitdebug with "\-Os" and
FEATURES with CFLAGS the script in the sixth post will allow you to emerge all
packages that any application that you specify belongs to or is linked against
but which isn't already emerged with -Os.

[1] http://groups.google.com/group/linux.gentoo.user/tree/browse_frm/thread/939e2c14eb49af8f/b8731194c759d361

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 14:12 ` Alan Mckinnon
@ 2006-08-22 16:23   ` Dale
  2006-08-22 18:36   ` Adrian Frith
  2006-08-22 18:40   ` Richard Fish
  2 siblings, 0 replies; 48+ messages in thread
From: Dale @ 2006-08-22 16:23 UTC (permalink / raw
  To: gentoo-user

Alan Mckinnon wrote:
>> Now the question:
>>
>> Do I have to do "emerge -e --newuse world" on my system or what else
>> would be needed?
>>     
>
> modify CFLAGS in /etc/make.conf
> emerge -e system
> emerge -s world
>   

Why is he searching for a package with world in it?  I think you meant
to put emerge -e world.  lol
> <snip>
> alan
>
>
>   

Dale

:-)  :-)
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 14:12 ` Alan Mckinnon
  2006-08-22 16:23   ` Dale
@ 2006-08-22 18:36   ` Adrian Frith
  2006-08-22 18:54     ` Dale
                       ` (2 more replies)
  2006-08-22 18:40   ` Richard Fish
  2 siblings, 3 replies; 48+ messages in thread
From: Adrian Frith @ 2006-08-22 18:36 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

On Tue, 2006-08-22 at 16:12 +0200, Alan Mckinnon wrote:
> modify CFLAGS in /etc/make.conf
> emerge -e system
> emerge -s world
> 
> This will rebuild your toolchain (gcc, glibc and friends) to use -O2
> then rebuild the entire system, including the toolchain again, with -O2.
> Your current compiler was built with -O3, and you want to rebuild the
> system using a compiler compiled as -O2, hence the 2 step process.

Correct me if I am wrong, but doesn't the gcc ebuild in fact use the
"make bootstrap" method of compiling gcc? - that is:
1. compile with installed compiler -> stage1
2. compile with stage1 compiler -> stage2
3. compile with stage2 compiler -> stage3
4. compare stage2 and stage3 and install stage3 if they are the same

If I am right, doesn't it mean that the whole "emerge -e system" step is
pointless? Couldn't one just do "emerge -u gcc" and then "emerge -e
world"? Or am I being stupid?

Cheers,
Adrian

-- 
Adrian Frith
adrian@frith.co.za | adrian@clug.org.za | frtadr003@cs.uct.ac.za
083 393 1257 | 021 531 8719 | http://frith.co.za/~adrian/

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 14:12 ` Alan Mckinnon
  2006-08-22 16:23   ` Dale
  2006-08-22 18:36   ` Adrian Frith
@ 2006-08-22 18:40   ` Richard Fish
  2006-08-23  8:07     ` Alan Mckinnon
  2 siblings, 1 reply; 48+ messages in thread
From: Richard Fish @ 2006-08-22 18:40 UTC (permalink / raw
  To: gentoo-user

On 8/22/06, Alan Mckinnon <alan@linuxholdings.co.za> wrote:
> Your current compiler was built with -O3, and you want to rebuild the
> system using a compiler compiled as -O2, hence the 2 step process.

*Sigh*.  I am so tired of this completely wrong information showing up here.

1. It does not matter what -OX flag gcc is compiled with.  It has
absolutely *zero* effect on the code that gcc *generates*.

2. There is also absolutely no reason to build gcc twice.  There is no
such thing as a gcc that was built with the "system compiler", because
gcc uses itself to build itself.  It is called a 3-stage bootstrap,
and I suggest you read the gcc documentation first if you want to
debate this point.

-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 18:36   ` Adrian Frith
@ 2006-08-22 18:54     ` Dale
  2006-08-22 19:30     ` Richard Fish
  2006-08-23  7:43     ` Alan Mckinnon
  2 siblings, 0 replies; 48+ messages in thread
From: Dale @ 2006-08-22 18:54 UTC (permalink / raw
  To: gentoo-user

Adrian Frith wrote:
> On Tue, 2006-08-22 at 16:12 +0200, Alan Mckinnon wrote:
>   
>> modify CFLAGS in /etc/make.conf
>> emerge -e system
>> emerge -s world
>>
>> This will rebuild your toolchain (gcc, glibc and friends) to use -O2
>> then rebuild the entire system, including the toolchain again, with -O2.
>> Your current compiler was built with -O3, and you want to rebuild the
>> system using a compiler compiled as -O2, hence the 2 step process.
>>     
>
> Correct me if I am wrong, but doesn't the gcc ebuild in fact use the
> "make bootstrap" method of compiling gcc? - that is:
> 1. compile with installed compiler -> stage1
> 2. compile with stage1 compiler -> stage2
> 3. compile with stage2 compiler -> stage3
> 4. compare stage2 and stage3 and install stage3 if they are the same
>
> If I am right, doesn't it mean that the whole "emerge -e system" step is
> pointless? Couldn't one just do "emerge -u gcc" and then "emerge -e
> world"? Or am I being stupid?
>
> Cheers,
> Adrian
>
>   

That would be my thinking too.  Of course, I am wrong a lot too.  ;-)

Dale

:-)  :-)
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 18:36   ` Adrian Frith
  2006-08-22 18:54     ` Dale
@ 2006-08-22 19:30     ` Richard Fish
  2006-08-22 20:53       ` Bo Ørsted Andresen
  2006-08-23  7:43     ` Alan Mckinnon
  2 siblings, 1 reply; 48+ messages in thread
From: Richard Fish @ 2006-08-22 19:30 UTC (permalink / raw
  To: gentoo-user

On 8/22/06, Adrian Frith <adrian@frith.co.za> wrote:
> If I am right, doesn't it mean that the whole "emerge -e system" step is
> pointless? Couldn't one just do "emerge -u gcc" and then "emerge -e
> world"? Or am I being stupid?

You are talking about when upgrading to new versions of gcc (based on
your use of the -u flag), right?  If so, then you are essentially
correct.

Indeed what I did for the last upgrade was a slightly modified version
of the gcc upgrade guide [1]:

emerge -u gcc
gcc-config blah-blah
source /etc/profile
emerge --oneshot libtool
revdep-rebuild --library=libstdc++.so.6
emerge --prune gcc
emerge -e world

The revdep-rebuild step was to rebuild all C++ applications so they
link with the new C++ library.  After that, I could expect my system
to be sane and survive the prune of old gcc versions.  The emerge -e
world was to take advantage of whatever new optimizations were
available.

However, for someone who doesn't really know what they are doing when
upgrading gcc, there is some extra safety possible with the "emerge -e
system" step, since once that completes, you *know* your critical
system packages have been rebuilt and still work.  If you skip that
and go straight to the emerge -e world, then if something fails to
build, you might end up with some critical packages left behind.

-Richard

[1] http://www.gentoo.org/doc/en/gcc-upgrading.xml
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 15:03       ` Bo Ørsted Andresen
@ 2006-08-22 19:58         ` Stefan G. Weichinger
  0 siblings, 0 replies; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-22 19:58 UTC (permalink / raw
  To: gentoo-user

Bo Ørsted Andresen wrote:
> On Tuesday 22 August 2006 05:18, Richard Fish wrote:
>>> I see the point in this. (AFAIK there is no way to break up "emerge -e
>>> xy" into smaller pieces, something to do in several separated steps.
>> Actually there is.  You can find all packages not compiled with -Os
>> and rebuild them with something like:
> 
> [SNIP]
> 
> Just wanted to add that another approach for emerging the packages that are
> used the most could be found in [1]. Be replacing splitdebug with "\-Os" and
> FEATURES with CFLAGS the script in the sixth post will allow you to emerge all
> packages that any application that you specify belongs to or is linked against
> but which isn't already emerged with -Os.
> 
> [1] http://groups.google.com/group/linux.gentoo.user/tree/browse_frm/thread/939e2c14eb49af8f/b8731194c759d361
> 

Thanks a lot for that pointer, I will give it a try.
A very helpful thread for me, thanks ...

Stefan.

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 19:30     ` Richard Fish
@ 2006-08-22 20:53       ` Bo Ørsted Andresen
  2006-08-22 21:02         ` Richard Fish
  0 siblings, 1 reply; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-22 20:53 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

On Tuesday 22 August 2006 21:30, Richard Fish wrote:
> revdep-rebuild --library=libstdc++.so.6
> emerge --prune gcc
> emerge -e world

Am I correct that the revdep-rebuild step is redundant if you don't need any 
C++ apps for the next 48 hours (assuming the emerge -e world completes 
successfully)?

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 20:53       ` Bo Ørsted Andresen
@ 2006-08-22 21:02         ` Richard Fish
  2006-08-22 21:04           ` Richard Fish
  0 siblings, 1 reply; 48+ messages in thread
From: Richard Fish @ 2006-08-22 21:02 UTC (permalink / raw
  To: gentoo-user

On 8/22/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> Am I correct that the revdep-rebuild step is redundant if you don't need any
> C++ apps for the next 48 hours (assuming the emerge -e world completes
> successfully)?

Yep.

-Richard

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 21:02         ` Richard Fish
@ 2006-08-22 21:04           ` Richard Fish
  2006-08-22 21:19             ` Bo Ørsted Andresen
  2006-08-22 21:24             ` Stefan G. Weichinger
  0 siblings, 2 replies; 48+ messages in thread
From: Richard Fish @ 2006-08-22 21:04 UTC (permalink / raw
  To: gentoo-user

On 8/22/06, Richard Fish <bigfish@asmallpond.org> wrote:
> On 8/22/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> > Am I correct that the revdep-rebuild step is redundant if you don't need any
> > C++ apps for the next 48 hours (assuming the emerge -e world completes
> > successfully)?
>
> Yep.

Oh, except that you can prune old gcc versions in that case until
*after* the emerge -e world completes.  Just eliminating the
revdep-rebuild step from what I posted would be bad...very bad.

-Richard

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 21:04           ` Richard Fish
@ 2006-08-22 21:19             ` Bo Ørsted Andresen
  2006-08-22 21:50               ` Richard Fish
  2006-08-22 21:24             ` Stefan G. Weichinger
  1 sibling, 1 reply; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-22 21:19 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 910 bytes --]

On Tuesday 22 August 2006 23:04, Richard Fish wrote:
> On 8/22/06, Richard Fish <bigfish@asmallpond.org> wrote:
> > On 8/22/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> > > Am I correct that the revdep-rebuild step is redundant if you don't
> > > need any C++ apps for the next 48 hours (assuming the emerge -e world
> > > completes successfully)?
> >
> > Yep.
>
> Oh, except that you can prune old gcc versions in that case until
> *after* the emerge -e world completes.  Just eliminating the
> revdep-rebuild step from what I posted would be bad...very bad.

Now I'm confused.. ;) Would pruning the old gcc before running emerge -e world 
break anything that's isn't a C++ app? If no C++ apps are needed until 
emerge -e world has completed why is it bad then? I know that running e.g. 
KDE after pruning it would be... ehm.. problematic... But other than that?

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 21:04           ` Richard Fish
  2006-08-22 21:19             ` Bo Ørsted Andresen
@ 2006-08-22 21:24             ` Stefan G. Weichinger
  1 sibling, 0 replies; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-22 21:24 UTC (permalink / raw
  To: gentoo-user

Richard Fish wrote:
> On 8/22/06, Richard Fish <bigfish@asmallpond.org> wrote:
>> On 8/22/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
>> > Am I correct that the revdep-rebuild step is redundant if you don't
>> need any
>> > C++ apps for the next 48 hours (assuming the emerge -e world completes
>> > successfully)?
>>
>> Yep.
> 
> Oh, except that you can prune old gcc versions in that case until
> *after* the emerge -e world completes.  Just eliminating the
> revdep-rebuild step from what I posted would be bad...very bad.

Phew ... I am enjoying this thread and trying to distill some basic
rules out of it to learn and remember.

Currently I am running your "migrate-to-CFLAG-Os"-script on my
underpowered ;) laptop. Regarding the various postings I have also
started some "emerge -e system" on one of my desktop systems (won't post
its technical data, no no ;-) ), since this particular system refuses to
properly startx after going to modular X11.

Oh my, and while I'm writing this, Bo has already replied again, and
he's *confused* ! So no wonder, that I also am ;-)

Enjoying and learning, Stefan.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 21:19             ` Bo Ørsted Andresen
@ 2006-08-22 21:50               ` Richard Fish
  2006-08-22 21:54                 ` Bo Ørsted Andresen
  0 siblings, 1 reply; 48+ messages in thread
From: Richard Fish @ 2006-08-22 21:50 UTC (permalink / raw
  To: gentoo-user

On 8/22/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> Now I'm confused.. ;) Would pruning the old gcc before running emerge -e world
> break anything that's isn't a C++ app?

Well, technically, no.  But considering that some python modules are
implemented in C++ and link against libstdc++ (which is provided by
gcc), pruning old versions of gcc without rebuilding python against
the new version first risks breaking python, and thus portage, and
thus "would be bad....very bad." ;-)

-Richard

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 21:50               ` Richard Fish
@ 2006-08-22 21:54                 ` Bo Ørsted Andresen
  0 siblings, 0 replies; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-22 21:54 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

On Tuesday 22 August 2006 23:50, Richard Fish wrote:
> > Now I'm confused.. ;) Would pruning the old gcc before running emerge -e
> > world break anything that's isn't a C++ app?
>
> Well, technically, no.  But considering that some python modules are
> implemented in C++ and link against libstdc++ (which is provided by
> gcc), pruning old versions of gcc without rebuilding python against
> the new version first risks breaking python, and thus portage, and
> thus "would be bad....very bad." ;-)

I see. Thanks for clarifying. :)

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 18:36   ` Adrian Frith
  2006-08-22 18:54     ` Dale
  2006-08-22 19:30     ` Richard Fish
@ 2006-08-23  7:43     ` Alan Mckinnon
  2006-08-23 11:29       ` Bo Ørsted Andresen
  2 siblings, 1 reply; 48+ messages in thread
From: Alan Mckinnon @ 2006-08-23  7:43 UTC (permalink / raw
  To: gentoo-user

On Tue, 2006-08-22 at 20:36 +0200, Adrian Frith wrote:
> On Tue, 2006-08-22 at 16:12 +0200, Alan Mckinnon wrote:
> > modify CFLAGS in /etc/make.conf
> > emerge -e system
> > emerge -s world
> > 
> > This will rebuild your toolchain (gcc, glibc and friends) to use -O2
> > then rebuild the entire system, including the toolchain again, with -O2.
> > Your current compiler was built with -O3, and you want to rebuild the
> > system using a compiler compiled as -O2, hence the 2 step process.
> 
> Correct me if I am wrong, but doesn't the gcc ebuild in fact use the
> "make bootstrap" method of compiling gcc? - that is:
> 1. compile with installed compiler -> stage1
> 2. compile with stage1 compiler -> stage2
> 3. compile with stage2 compiler -> stage3
> 4. compare stage2 and stage3 and install stage3 if they are the same
> 
> If I am right, doesn't it mean that the whole "emerge -e system" step is
> pointless? Couldn't one just do "emerge -u gcc" and then "emerge -e
> world"? Or am I being stupid?

I believe the gcc ebuild does do a bootstrap compile, which does imply
that emerge -e system is redundant. 

But, we had a huge long rambling thread on this point recently which I'd
rather not rehash again :-) and IIRC the general consensus was that
'emerge -e system ; emerge -e world' was the way to go, for reasons
broader than just gcc. I forget the details, maybe we should both check
the archives.

What I do know is that 'emerge -e system ' is relatively quick compared
to 'emerge -e world', so the extra step didn't hurt much when I recently
upgraded gcc, it was something like 2 hours for the one, and 36 for the
other (!)

alan

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22 18:40   ` Richard Fish
@ 2006-08-23  8:07     ` Alan Mckinnon
  2006-08-23 19:06       ` Richard Fish
  0 siblings, 1 reply; 48+ messages in thread
From: Alan Mckinnon @ 2006-08-23  8:07 UTC (permalink / raw
  To: gentoo-user

On Tue, 2006-08-22 at 11:40 -0700, Richard Fish wrote:
> On 8/22/06, Alan Mckinnon <alan@linuxholdings.co.za> wrote:
> > Your current compiler was built with -O3, and you want to rebuild the
> > system using a compiler compiled as -O2, hence the 2 step process.
> 
> *Sigh*.  I am so tired of this completely wrong information showing up here.
> 
> 1. It does not matter what -OX flag gcc is compiled with.  It has
> absolutely *zero* effect on the code that gcc *generates*.
> 
> 2. There is also absolutely no reason to build gcc twice.  There is no
> such thing as a gcc that was built with the "system compiler", because
> gcc uses itself to build itself.  It is called a 3-stage bootstrap,
> and I suggest you read the gcc documentation first if you want to
> debate this point.

I have read the docs, several times. I was replying to a confessed
newbie so had to keep it simple so he had a chance of understanding the
big picture and also not fscking his system. You and I could probably
fix that if it happened to us, the OP probably could not. There's more
at stake here than just gcc - there's an entire toolchain which very
very few people actually understand, including most people on this list.

Incidentally, gcc cannot use itself to compile itself - that's
nonsensical and a classic bootstrap problem. It uses a binary (which
happens to be a gcc) to compile the source code for gcc which produces
another binary. That binary then compiles the same source for gcc to
produce yet another binary, etc, etc. For stage 1 to work at all, there
has to be a compiler available to compile a compiler, and that first
compiler that *must* be available is probably the compiler that the rest
of the system uses, or the one on the LiveCD. So if you want to be
pedantic about building gcc, then please be correctly pedantic and
pedantically correct :-)

alan


-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23  7:43     ` Alan Mckinnon
@ 2006-08-23 11:29       ` Bo Ørsted Andresen
  2006-08-23 14:04         ` Alan Mckinnon
  0 siblings, 1 reply; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-23 11:29 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

On Wednesday 23 August 2006 09:43, Alan Mckinnon wrote:
> I believe the gcc ebuild does do a bootstrap compile, which does imply
> that emerge -e system is redundant.
>
> But, we had a huge long rambling thread on this point recently which I'd
> rather not rehash again :-) and IIRC the general consensus was that
> 'emerge -e system ; emerge -e world' was the way to go, for reasons
> broader than just gcc. I forget the details, maybe we should both check
> the archives.

Back then we were speaking of a gcc upgrade in which case Richard doesn't 
disagree with the emerge -e system step which is also mentioned in [1]. We 
were definitely NOT talking about a minor modification of CFLAGS between -Os 
and -O3! That's where you're wrong.

[1] http://www.gentoo.org/doc/en/gcc-upgrading.xml

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 11:29       ` Bo Ørsted Andresen
@ 2006-08-23 14:04         ` Alan Mckinnon
  2006-08-23 19:40           ` Richard Fish
  0 siblings, 1 reply; 48+ messages in thread
From: Alan Mckinnon @ 2006-08-23 14:04 UTC (permalink / raw
  To: gentoo-user

On Wed, 2006-08-23 at 13:29 +0200, Bo Ørsted Andresen wrote:
> On Wednesday 23 August 2006 09:43, Alan Mckinnon wrote:
> > I believe the gcc ebuild does do a bootstrap compile, which does imply
> > that emerge -e system is redundant.
> >
> > But, we had a huge long rambling thread on this point recently which I'd
> > rather not rehash again :-) and IIRC the general consensus was that
> > 'emerge -e system ; emerge -e world' was the way to go, for reasons
> > broader than just gcc. I forget the details, maybe we should both check
> > the archives.
> 
> Back then we were speaking of a gcc upgrade in which case Richard doesn't 
> disagree with the emerge -e system step which is also mentioned in [1]. We 
> were definitely NOT talking about a minor modification of CFLAGS between -Os 
> and -O3! That's where you're wrong.

Can you be absolutely certain I'm wrong? Can you absolutely guarantee
that a recompile with a different config MUST be treated differently to
an upgrade?

As I see it the only difference I can count on is that the first just
happens to not involve a change in version number. In both cases a new
binary is made which replaces the old one, and said new binary may or
may not include features/configurations that are incompatible with other
already existing software.

The only way you could guarantee that is if the gcc sources ignore
CFLAGS and other settings when compiling gcc in an effort to build a
compiler that is always in a known state with known output. That would
be an awfully good idea for a compiler but I haven't seen a clear
statement anywhere that this is in fact what is done, so I don't assume
that it is that way.

Unless you have assumed that gcc is not to be recompiled, but only given
different options to use in the future when doing it's thing, in which
case we are both right, but talking about different things

alan


> 
> [1] http://www.gentoo.org/doc/en/gcc-upgrading.xml
> 

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23  8:07     ` Alan Mckinnon
@ 2006-08-23 19:06       ` Richard Fish
  2006-08-23 20:22         ` Michael Hennebry
  2006-08-24  7:11         ` Alan Mckinnon
  0 siblings, 2 replies; 48+ messages in thread
From: Richard Fish @ 2006-08-23 19:06 UTC (permalink / raw
  To: gentoo-user

On 8/23/06, Alan Mckinnon <alan@linuxholdings.co.za> wrote:
> Incidentally, gcc cannot use itself to compile itself - that's
> nonsensical and a classic bootstrap problem. It uses a binary (which
> happens to be a gcc) to compile the source code for gcc which produces
> another binary. That binary then compiles the same source for gcc to
> produce yet another binary, etc, etc. For stage 1 to work at all, there
> has to be a compiler available to compile a compiler, and that first
> compiler that *must* be available is probably the compiler that the rest
> of the system uses, or the one on the LiveCD. So if you want to be
> pedantic about building gcc, then please be correctly pedantic and
> pedantically correct :-)

Yes, I'm aware of how the bootstrapping process works.  And if we want
to be really pedantic about it, I'm still right, because the stage1
compiler that is built using the existing system compiler isn't called
gcc...hmm, what is it...xcc, xgcc...something with an x in it anyway!
So there is still no such thing as a "gcc built with the 'system
compiler'" :-P

More seriously, there is some really _stupid_ information about
upgrading gcc on the gentoo-wiki and forums that seems to crop up here
every few months, and it makes me really, really angry.  Stupid crap
like needing to "emerge -e system ; emerge -e system; emerge -e world;
emerge -e world".  Or needing to rebuild all binaries that link
against a library whenever you rebuild the library.  Or that you
should merge gcc twice because you want a version of gcc that is built
with the same version of gcc.  All of which is utter nonsense.

FYI, as Bo pointed out, I am _not_ saying that the emerge -e system
step is redundant.  I completely agree that "emerge -e system ; emerge
-e world" is the safe route for upgrading gcc.  I've been convinced of
that by the previous threads on this topic.

I was specifically replying to your comment: "Your current compiler
was built with -O3, and you want to rebuild the system using a
compiler compiled as -O2, hence the 2 step process."  This is very
much in the same line of thinking as those wiki pages and forum
postings, and is wrong.  Giving a newbie misinformation doesn't help
them in any way.

Oh, and BTW, on gentoo your optimization choices for gcc are -O, -O2
or nothing, because all other -O options are replaced with -O2 by
toolchain.eclass.

-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 14:04         ` Alan Mckinnon
@ 2006-08-23 19:40           ` Richard Fish
  2006-08-23 19:45             ` Stefan G. Weichinger
  2006-08-24  7:06             ` Alan Mckinnon
  0 siblings, 2 replies; 48+ messages in thread
From: Richard Fish @ 2006-08-23 19:40 UTC (permalink / raw
  To: gentoo-user

On 8/23/06, Alan Mckinnon <alan@linuxholdings.co.za> wrote:
> Can you be absolutely certain I'm wrong? Can you absolutely guarantee
> that a recompile with a different config MUST be treated differently to
> an upgrade?

We are still talking about CFLAGS here, right?  Then ok, no, it is not
_necessary_ to treat this differently than an upgrade in gcc versions.
 One can happily run "emerge -e system; emerge -e world" and get to
the same result.  But that doesn't change the fact that the emerge -e
system step is redundant _in this case_.

Why am I sure?  Because many ebuilds in the tree already replace -O3
or -Os with -O2, or add/remove -fsome-flag based on useflags and what
is known to break (or fix) something.  So on any Gentoo system, you
are practically guaranteed to have some binaries that are built with
different flags than the libraries they link against, and they all
play nicely together.  It is part of the standard C/C++ ABI that gcc
defines, and compiler flags must not have any effect on that.

> As I see it the only difference I can count on is that the first just
> happens to not involve a change in version number.

No change in version number means no change in ABI.

> The only way you could guarantee that is if the gcc sources ignore
> CFLAGS and other settings when compiling gcc in an effort to build a

Gcc is (almost) always built with -O2 on Gentoo, but it does not
matter anyway.  The CFLAGS that gcc is built with does not effect the
binaries it generates...only the code and the flags passed to gcc
during the compilation effect this.  If your model were correct, you
would need a gcc built with -Os for using -Os, a gcc built with "-Os
-fweb" for building with "-Os -fweb", "-O3" for building with -O3,
"-O3 -mmx" for ... and so on.

Think about this for a second.  What you are claiming here is that the
output of this bash script can depend upon what CFLAGS bash was built
with:

#!/bin/bash
echo -e "\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21"

Admittedly a compiler is many orders of magnitude more complex than
this, but functionally the same.  Only the code and the options passed
to the compiler can effect its output.  Or to put another way, one
could write a C compiler in java, C#, python, or even shell script
that would support the exact same flags as gcc and generate the exact
same code.  They would almost certainly be much, much slower, but the
output would be the same.  It is identical in concept to changing the
flags that _gcc_ is built with...the gcc program itself changes
(hopefully gets faster), but the output remains the same.

-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 19:40           ` Richard Fish
@ 2006-08-23 19:45             ` Stefan G. Weichinger
  2006-08-24  7:06             ` Alan Mckinnon
  1 sibling, 0 replies; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-23 19:45 UTC (permalink / raw
  To: gentoo-user

Richard Fish wrote:

> Gcc is (almost) always built with -O2 on Gentoo, but it does not
> matter anyway.  The CFLAGS that gcc is built with does not effect the
> binaries it generates...only the code and the flags passed to gcc
> during the compilation effect this.  If your model were correct, you
> would need a gcc built with -Os for using -Os, a gcc built with "-Os
> -fweb" for building with "-Os -fweb", "-O3" for building with -O3,
> "-O3 -mmx" for ... and so on.
> 
> Think about this for a second.  What you are claiming here is that the
> output of this bash script can depend upon what CFLAGS bash was built
> with:
> 
> #!/bin/bash
> echo -e "\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21"
> 
> Admittedly a compiler is many orders of magnitude more complex than
> this, but functionally the same.  Only the code and the options passed
> to the compiler can effect its output.  Or to put another way, one
> could write a C compiler in java, C#, python, or even shell script
> that would support the exact same flags as gcc and generate the exact
> same code.  They would almost certainly be much, much slower, but the
> output would be the same.  It is identical in concept to changing the
> flags that _gcc_ is built with...the gcc program itself changes
> (hopefully gets faster), but the output remains the same.

I might be a newbie in terms of this list, but this is completely clear
to *me*.

Thanks anyway,
maybe this helps in getting this to the Howtos, the Wiki, etc.

Stefan
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 19:06       ` Richard Fish
@ 2006-08-23 20:22         ` Michael Hennebry
  2006-08-23 20:29           ` Bo Ørsted Andresen
  2006-08-24  7:11         ` Alan Mckinnon
  1 sibling, 1 reply; 48+ messages in thread
From: Michael Hennebry @ 2006-08-23 20:22 UTC (permalink / raw
  To: gentoo-user

On Wed, 23 Aug 2006, Richard Fish wrote:

> Oh, and BTW, on gentoo your optimization choices for gcc are -O, -O2
> or nothing, because all other -O options are replaced with -O2 by
> toolchain.eclass.

Since the OP wanted -Os, the question remains:
How, if at all, can he get -Os ?

-- 
Mike   hennebry@web.cs.ndsu.NoDak.edu
"it stands to reason that they weren't always called the ancients."
                                                      --  Daniel Jackson

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 20:22         ` Michael Hennebry
@ 2006-08-23 20:29           ` Bo Ørsted Andresen
  2006-08-23 20:49             ` Stefan G. Weichinger
  0 siblings, 1 reply; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-23 20:29 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

On Wednesday 23 August 2006 22:22, Michael Hennebry wrote:
> > Oh, and BTW, on gentoo your optimization choices for gcc are -O, -O2
> > or nothing, because all other -O options are replaced with -O2 by
> > toolchain.eclass.
>
> Since the OP wanted -Os, the question remains:
> How, if at all, can he get -Os ?

Assuming that the OP doesn't want a broken gcc he will probably be happy 
with -Os for the packages that doesn't break with it... ;)

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 20:29           ` Bo Ørsted Andresen
@ 2006-08-23 20:49             ` Stefan G. Weichinger
  2006-08-23 21:48               ` Michael Hennebry
  0 siblings, 1 reply; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-23 20:49 UTC (permalink / raw
  To: gentoo-user

Bo Ørsted Andresen wrote:
> On Wednesday 23 August 2006 22:22, Michael Hennebry wrote:
>>> Oh, and BTW, on gentoo your optimization choices for gcc are -O, -O2
>>> or nothing, because all other -O options are replaced with -O2 by
>>> toolchain.eclass.
>> Since the OP wanted -Os, the question remains:
>> How, if at all, can he get -Os ?
> 
> Assuming that the OP doesn't want a broken gcc he will probably be happy 
> with -Os for the packages that doesn't break with it... ;)

Being the OP in this case, I want to state that I didn't want "-Os for
all pkgs". I just decided to set "-Os" inside my CFLAGS, and I am
perfectly happy with any working gcc resulting from this.

This isn't only about control, this is also about trust:
I may control which settings to use for any pkg, but then I also have to
trust the decisions of the maintainers which choices they made for
individual pkgs (apart from overriding their settings, which somehow
questions the usage of portage IMO).

In fact, from my point of view, I am *allowed* to trust in this.

Stefan

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-22  3:18     ` Richard Fish
  2006-08-22  7:23       ` Stefan G. Weichinger
  2006-08-22 15:03       ` Bo Ørsted Andresen
@ 2006-08-23 21:04       ` Bo Ørsted Andresen
  2006-08-23 22:54         ` Richard Fish
  2 siblings, 1 reply; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-23 21:04 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

On Tuesday 22 August 2006 05:18, Richard Fish wrote:
> Actually there is.  You can find all packages not compiled with -Os
> and rebuild them with something like:
>
> cd /var/db/pkg
> for pkg in */* ; do
>     grep -v -- "-Os" $pkg/CFLAGS >/dev/null
>     test $? -eq 0 && emerge --oneshot =$pkg
> done

Discussion further down this thread has made us aware that this will always 
make stuff like gcc, mozilla-firefox and openoffice become rebuilt despite 
that rebuilding them won't change their CFLAGS at all...

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 20:49             ` Stefan G. Weichinger
@ 2006-08-23 21:48               ` Michael Hennebry
  2006-08-23 21:55                 ` Stefan G. Weichinger
                                   ` (2 more replies)
  0 siblings, 3 replies; 48+ messages in thread
From: Michael Hennebry @ 2006-08-23 21:48 UTC (permalink / raw
  To: gentoo-user

On Wed, 23 Aug 2006, Stefan G. Weichinger wrote:

> Bo Ørsted Andresen wrote:
> > On Wednesday 23 August 2006 22:22, Michael Hennebry wrote:
> >>> Oh, and BTW, on gentoo your optimization choices for gcc are -O, -O2
> >>> or nothing, because all other -O options are replaced with -O2 by
> >>> toolchain.eclass.

Perhaps I misunderstood the preceeding.
I'd taken it to mean that recompiling any package with gentoo tools
would result in -Os being replaced by  -O2 .

> >> Since the OP wanted -Os, the question remains:
> >> How, if at all, can he get -Os ?
> >
> > Assuming that the OP doesn't want a broken gcc he will probably be happy
> > with -Os for the packages that doesn't break with it... ;)

What would break with -Os that wouldn't break with -O2?
I was under the impression that both flags only allowed
changes that didn't affect the output.

> Being the OP in this case, I want to state that I didn't want "-Os for
> all pkgs". I just decided to set "-Os" inside my CFLAGS, and I am
> perfectly happy with any working gcc resulting from this.

A statement quoted above suggested to me that
you were unlikely to get -Os for anything.

> This isn't only about control, this is also about trust:
> I may control which settings to use for any pkg, but then I also have to
> trust the decisions of the maintainers which choices they made for
> individual pkgs (apart from overriding their settings, which somehow
> questions the usage of portage IMO).
>
> In fact, from my point of view, I am *allowed* to trust in this.

-- 
Mike   hennebry@web.cs.ndsu.NoDak.edu
"it stands to reason that they weren't always called the ancients."
                                                      --  Daniel Jackson


-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 21:48               ` Michael Hennebry
@ 2006-08-23 21:55                 ` Stefan G. Weichinger
  2006-08-23 22:21                 ` Bo Ørsted Andresen
  2006-08-23 22:50                 ` Richard Fish
  2 siblings, 0 replies; 48+ messages in thread
From: Stefan G. Weichinger @ 2006-08-23 21:55 UTC (permalink / raw
  To: gentoo-user

Michael Hennebry wrote:

>>>>> Oh, and BTW, on gentoo your optimization choices for gcc are -O, -O2
>>>>> or nothing, because all other -O options are replaced with -O2 by
>>>>> toolchain.eclass.
> 
> Perhaps I misunderstood the preceeding.
> I'd taken it to mean that recompiling any package with gentoo tools
> would result in -Os being replaced by  -O2 .

AFAI understood the preceeding Richard wrote:

"on gentoo your optimization choices for gcc are ... "

I interpret this as:

emerge gcc with CFLAGS containing -Os
get gcc compiled with -O2

Not "any package", gcc (due to toolchain.eclass ...).

My way of seeing this, corrections welcome.

>> Being the OP in this case, I want to state that I didn't want "-Os for
>> all pkgs". I just decided to set "-Os" inside my CFLAGS, and I am
>> perfectly happy with any working gcc resulting from this.
> 
> A statement quoted above suggested to me that
> you were unlikely to get -Os for anything.

Earlier in this thread I went -O3, then -O2, now -Os ...
As I stated several times, I learn.

Greets, Stefan.

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 21:48               ` Michael Hennebry
  2006-08-23 21:55                 ` Stefan G. Weichinger
@ 2006-08-23 22:21                 ` Bo Ørsted Andresen
  2006-08-23 22:24                   ` Bo Ørsted Andresen
  2006-08-23 22:50                 ` Richard Fish
  2 siblings, 1 reply; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-23 22:21 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]

On Wednesday 23 August 2006 23:48, Michael Hennebry wrote:
> > >>> Oh, and BTW, on gentoo your optimization choices for gcc are -O, -O2
                                   note 'choices for gcc' above ^^^^^
> > >>> or nothing, because all other -O options are replaced with -O2 by
> > >>> toolchain.eclass.
>
> Perhaps I misunderstood the preceeding.
> I'd taken it to mean that recompiling any package with gentoo tools
> would result in -Os being replaced by  -O2 .

I probably should have explained it better before. If you look at the gcc 
ebuild (/usr/portage/sys-devel/gcc/gcc-YOUR_VERSION.ebuild) you will note a 
line that says:

inherit toolchain

This inherits the toolchain.eclass for the gcc ebuild. In 
the /usr/portage/eclass/toolchain.eclass you will find the following:

	# In general gcc does not like optimization, and add -O2 where
	# it is safe.  This is especially true for gcc 3.3 + 3.4
	replace-flags -O? -O2

This replaces -Os, -O3 or any other -O? with -O2. But it only applies to 
ebuilds that inherits the toolchain.eclass.

In conclusion in order to find out what packages don't use your CFLAGS you 
will either have to look at the ebuilds and any eclasses that they append or 
simply install it and look at the CFLAGS in the pkg database when it is 
installed:

# grep ^CFLAGS /etc/make.conf
CFLAGS="-O2 -march=pentium-m -pipe"

# cat /var/db/pkg/www-client/mozilla-firefox-1.5.0.6/CFLAGS
-march=pentium-m -pipe -Wno-return-type -w -freorder-blocks -fno-reorder-functions

As you can see the mozilla-firefox ebuild or any of it's eclasses has stripped 
any -O? CFLAGS entirely...

The following command should show you a complete list of packages that you 
have currently installed but which wasn't installed with your current CFLAGS:

# CFLAGS=$(source /etc/make.conf && echo "${CFLAGS}") ; \
	grep -v "${CFLAGS//\-/\\-}" /var/db/pkg/*/*/CFLAGS

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 22:21                 ` Bo Ørsted Andresen
@ 2006-08-23 22:24                   ` Bo Ørsted Andresen
  0 siblings, 0 replies; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-23 22:24 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 180 bytes --]

On Thursday 24 August 2006 00:21, Bo Ørsted Andresen wrote:
> will either have to look at the ebuilds and any eclasses that they append

s/append/inherit/

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 21:48               ` Michael Hennebry
  2006-08-23 21:55                 ` Stefan G. Weichinger
  2006-08-23 22:21                 ` Bo Ørsted Andresen
@ 2006-08-23 22:50                 ` Richard Fish
  2006-08-24 23:31                   ` Michael Hennebry
  2 siblings, 1 reply; 48+ messages in thread
From: Richard Fish @ 2006-08-23 22:50 UTC (permalink / raw
  To: gentoo-user

On 8/23/06, Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu> wrote:
> Perhaps I misunderstood the preceeding.
> I'd taken it to mean that recompiling any package with gentoo tools
> would result in -Os being replaced by  -O2 .

Sorry if I wasn't clear.  I'm only referring to the build of gcc itself here.

To try and clarify, when you set CFLAGS in make.conf, you are really
telling portage what you would /like/ to use to build programs.  They
are, in effect, just the default settings.

A particular ebuild is allowed to remove, replace, or even add its own
flags as the maintainer of that package sees fit.  There are many
packages that do this, and gcc is one of them.

> What would break with -Os that wouldn't break with -O2?
> I was under the impression that both flags only allowed
> changes that didn't affect the output.

No, the output *is* allowed to change based on -Os, -O2, or -O3.  This
is the entire point of optimizations, after all.  What is *not*
allowed to change is the ABI.

For example, glibc contains a very freqeuntly used function called
"printf".  Any program that wants to call printf needs to pass it
arguments to tell it what to print.  The method of passing those
arguments and the return value (such as the order of the arguments,
their alignment in memory, how the stack is managed, etc) is known as
an ABI (application binary interface).  And the ABI is not allowed to
change based on CFLAGS, or a program compiled with -O3 could have
trouble calling printf in a glibc compiled with -Os.

Now, the actual implementation of printf...how many processor
registers it uses, the order of the instructions within the function,
whether loops are expanded, how it calculates floating point numbers
(not really applicable to printf..but bear with me) etc...those things
are allowed to be changed by CFLAGS.

So when we talk about optimizations breaking code, we are talking
about the implementation of functions.  With unsafe flags, the
compiler can make bad choices in some cases like trying to use the
result of a calculation before the calculation is made, dereferencing
a memory address before the correct address is actually known, etc.

HTH,
-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 21:04       ` Bo Ørsted Andresen
@ 2006-08-23 22:54         ` Richard Fish
  2006-08-23 23:31           ` Bo Ørsted Andresen
  0 siblings, 1 reply; 48+ messages in thread
From: Richard Fish @ 2006-08-23 22:54 UTC (permalink / raw
  To: gentoo-user

On 8/23/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> Discussion further down this thread has made us aware that this will always
> make stuff like gcc, mozilla-firefox and openoffice become rebuilt despite
> that rebuilding them won't change their CFLAGS at all...

Um, yeah.  Definitely not perfect.  :-/

Maybe searching by mtime is better...

-Richard

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 22:54         ` Richard Fish
@ 2006-08-23 23:31           ` Bo Ørsted Andresen
  0 siblings, 0 replies; 48+ messages in thread
From: Bo Ørsted Andresen @ 2006-08-23 23:31 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

On Thursday 24 August 2006 00:54, Richard Fish wrote:
> On 8/23/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> > Discussion further down this thread has made us aware that this will
> > always make stuff like gcc, mozilla-firefox and openoffice become rebuilt
> > despite that rebuilding them won't change their CFLAGS at all...
>
> Um, yeah.  Definitely not perfect.  :-/
>
> Maybe searching by mtime is better...

In the case of the OP the best approach might be to simply grep for -O3. I at 
least don't have any packages installed that use -O3 when it isn't in the 
CFLAGS.

# emerge --verbose --ask --oneshot \
	`grep -l "\-O3" /var/db/pkg/*/*/CFLAGS | cut -d'/' -f5-6 | sed -e 's/^/=/'`

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 19:40           ` Richard Fish
  2006-08-23 19:45             ` Stefan G. Weichinger
@ 2006-08-24  7:06             ` Alan Mckinnon
  1 sibling, 0 replies; 48+ messages in thread
From: Alan Mckinnon @ 2006-08-24  7:06 UTC (permalink / raw
  To: gentoo-user

On Wed, 2006-08-23 at 12:40 -0700, Richard Fish wrote:
> On 8/23/06, Alan Mckinnon <alan@linuxholdings.co.za> wrote:
> > Can you be absolutely certain I'm wrong? Can you absolutely guarantee
> > that a recompile with a different config MUST be treated differently to
> > an upgrade?
> 
> We are still talking about CFLAGS here, right?  Then ok, no, it is not
> _necessary_ to treat this differently than an upgrade in gcc versions.
>  One can happily run "emerge -e system; emerge -e world" and get to
> the same result.  But that doesn't change the fact that the emerge -e
> system step is redundant _in this case_.

I'd like to suggest at this point that we drop this thread. Because you
and I both understand the compile process well, but we seemed to have
gotten the wires crossed a few posts back and are talking about slightly
different scenarios.

You are right in saying that in this case, emerge -e system is
redundant, but your average gentoo-newbie is in no state to understand
why, or even care :-)

Besides, I really need to get going on figuring out why Sybase ASE won't
install here and play nicely with php5....

alan

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 19:06       ` Richard Fish
  2006-08-23 20:22         ` Michael Hennebry
@ 2006-08-24  7:11         ` Alan Mckinnon
  1 sibling, 0 replies; 48+ messages in thread
From: Alan Mckinnon @ 2006-08-24  7:11 UTC (permalink / raw
  To: gentoo-user

On Wed, 2006-08-23 at 12:06 -0700, Richard Fish wrote:
> More seriously, there is some really _stupid_ information about
> upgrading gcc on the gentoo-wiki and forums that seems to crop up here
> every few months, and it makes me really, really angry.  Stupid crap
> like needing to "emerge -e system ; emerge -e system; emerge -e world;
> emerge -e world".  Or needing to rebuild all binaries that link
> against a library whenever you rebuild the library.  Or that you
> should merge gcc twice because you want a version of gcc that is built
> with the same version of gcc.  All of which is utter nonsense. 

Ah, now the thread starts to make sense. I've been the lucky one and
never run into any of that nonsense. Other crap yes, but so far not that
crap.

Cheers

alan


-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
  2006-08-23 22:50                 ` Richard Fish
@ 2006-08-24 23:31                   ` Michael Hennebry
  0 siblings, 0 replies; 48+ messages in thread
From: Michael Hennebry @ 2006-08-24 23:31 UTC (permalink / raw
  To: gentoo-user

On Wed, 23 Aug 2006, Richard Fish wrote:

> > What would break with -Os that wouldn't break with -O2?
> > I was under the impression that both flags only allowed
> > changes that didn't affect the output.
>
> No, the output *is* allowed to change based on -Os, -O2, or -O3.  This
> is the entire point of optimizations, after all.  What is *not*
> allowed to change is the ABI.

I should have been clear.  I'd meant the output of the compilee,
not the compiler, though obviously time-sensitive things will change.

-- 
Mike   hennebry@web.cs.ndsu.NoDak.edu
"it stands to reason that they weren't always called the ancients."
                                                      --  Daniel Jackson

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [gentoo-user] How to properly change CFLAGS ?
       [not found]       ` <1156978378.17760.22.camel@scarlatti.leonora.org>
@ 2006-08-31 11:15         ` Richard Fish
  0 siblings, 0 replies; 48+ messages in thread
From: Richard Fish @ 2006-08-31 11:15 UTC (permalink / raw
  To: gentoo-user

On 8/30/06, Vladimir G. Ivanovic <vgivanovic@comcast.net> wrote:
> On Mon, 2006-08-21 at 20:06 -0700, Richard Fish wrote:
> > -Os seems to take much less time and memory to compile than -O2 or -O3.  And being a
> > ~arch user, time-to-compile is a nice thing to reduce.
>
> It is possible that one of my usual CFLAGS options (-Wall -march=k8
> -msse3 -pipe -O2 -ffast-math) overwhelms any -Os/-O2 execution time

Well it looks like I'll have to retract that statement in relation to
-Os/-O2.  My current tests with -march=pentium4 -fweb -pipe
-fomit-frame-pointer for my laptop or -march=athlon64 -fweb -pipe for
my AMD box show a <5% difference in compile time between -Os and -O2.

I think there was a bigger difference in previous versions of gcc, but
I can't seem to find any notes or anything to support that belief...

Cheers,
-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2006-08-31 11:20 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-21 20:51 [gentoo-user] How to properly change CFLAGS ? Stefan G. Weichinger
2006-08-21 21:01 ` Richard Fish
2006-08-21 21:19   ` Stefan G. Weichinger
2006-08-22  3:18     ` Richard Fish
2006-08-22  7:23       ` Stefan G. Weichinger
2006-08-22 15:03       ` Bo Ørsted Andresen
2006-08-22 19:58         ` Stefan G. Weichinger
2006-08-23 21:04       ` Bo Ørsted Andresen
2006-08-23 22:54         ` Richard Fish
2006-08-23 23:31           ` Bo Ørsted Andresen
2006-08-21 21:16 ` Neil Bothwick
2006-08-21 21:27   ` Stefan G. Weichinger
     [not found]     ` <20060822003250.3daebfb0@krikkit.digimed.co.uk>
2006-08-22  2:28       ` Collins Richey
2006-08-22 14:16         ` Bo Ørsted Andresen
2006-08-22  3:06     ` Richard Fish
2006-08-22  7:26       ` Stefan G. Weichinger
     [not found]       ` <1156978378.17760.22.camel@scarlatti.leonora.org>
2006-08-31 11:15         ` Richard Fish
2006-08-22 14:12 ` Alan Mckinnon
2006-08-22 16:23   ` Dale
2006-08-22 18:36   ` Adrian Frith
2006-08-22 18:54     ` Dale
2006-08-22 19:30     ` Richard Fish
2006-08-22 20:53       ` Bo Ørsted Andresen
2006-08-22 21:02         ` Richard Fish
2006-08-22 21:04           ` Richard Fish
2006-08-22 21:19             ` Bo Ørsted Andresen
2006-08-22 21:50               ` Richard Fish
2006-08-22 21:54                 ` Bo Ørsted Andresen
2006-08-22 21:24             ` Stefan G. Weichinger
2006-08-23  7:43     ` Alan Mckinnon
2006-08-23 11:29       ` Bo Ørsted Andresen
2006-08-23 14:04         ` Alan Mckinnon
2006-08-23 19:40           ` Richard Fish
2006-08-23 19:45             ` Stefan G. Weichinger
2006-08-24  7:06             ` Alan Mckinnon
2006-08-22 18:40   ` Richard Fish
2006-08-23  8:07     ` Alan Mckinnon
2006-08-23 19:06       ` Richard Fish
2006-08-23 20:22         ` Michael Hennebry
2006-08-23 20:29           ` Bo Ørsted Andresen
2006-08-23 20:49             ` Stefan G. Weichinger
2006-08-23 21:48               ` Michael Hennebry
2006-08-23 21:55                 ` Stefan G. Weichinger
2006-08-23 22:21                 ` Bo Ørsted Andresen
2006-08-23 22:24                   ` Bo Ørsted Andresen
2006-08-23 22:50                 ` Richard Fish
2006-08-24 23:31                   ` Michael Hennebry
2006-08-24  7:11         ` Alan Mckinnon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox