Informations about gcc optimization

Tushar T tush at
Fri Oct 11 19:05:18 PDT 2002

Ken Moffat wrote:

>On Fri, 11 Oct 2002, Simon Comeau Martel wrote:
>>I am running LFS 3.3 and I'll rebuild my system this weekend following the LFS CVS book.  When I built my current system, I didn't use any optimization at all.  But this time, I want to.  But I am not sure what I should use...  My processor is a Celeron 500 MHz.
>>Should I use something like
>>CFLAGS="-O3 -s -march=i686" OR
>>CFLAGS="-O3 -s -march=pentium???"
> I'd be wary of using -O3 in the LFS system, but it might be useful for
>any graphics programs and libraries you're planning to use. These days I
>normally build LFS with -Os (on a K6-2/450) and I can't see that
>fiddling with these flags makes a noticeable speed difference. The
>possible problems with -O3 are that reputedly some of the packages such
>as binutils and glibc don't get on with exotic CFLAGS, and ( more
>likely ) you will bloat the size of everything.
Yep, it would be better to use -O2 on the core packages. Also 
-fomit-frame-pointer is supposed to be good. I would also suggest a -w 
unless you like seeing all the warnings. Also check out the gcc install 
file, it gives you flags to optimize gcc compilation. I have been using 
those without problems. BTW, never never optimize binutils.

>>Does adding the -mcpu option is of any use?  Most of the time, I saw both of them, but from the GCC site: "Moreover, specifying -march=cpu-type implies -mcpu=cpu-type"
>>If the pentium choice is "better", witch one fit my CPU?
>>pentium, pentium-mmx, pentiumpro, pentium2, pentium3 ??
-march does imply -mcpu so -mcpu is redundant. -march works with glibc also.

Tushar Teredesai
LFS ID: 1377

Unsubscribe: send email to listar at
and put 'unsubscribe lfs-support' in the subject header of the message

More information about the lfs-support mailing list