Fwd: Re: optimization

Gerard Beekmans gerard at linuxfromscratch.org
Mon May 29 17:11:43 PDT 2000

Justin, this would be for you:

----- Forwarded message from Nemmy <forever at subdimension.com> -----

X-POP3-Rcpt: chaser at lfs1
Date: Mon, 08 May 2000 17:18:20 
From: Nemmy <forever at subdimension.com>
To: lfs-discuss at linuxfromscratch.org
Subject: Re: optimization
X-Mailer: Spruce 0.6.2 for X11 w/smtpio 0.7.6
Precedence: bulk
Reply-To: lfs-discuss at linuxfromscratch.org

> I've heard mention from time to time about optimizing a src package for
> a particular system.  I've also heard it is too large a topic for the
> LFS book.  I've seen there is an -O option for gcc.  Is this what people
> are talking about?  Would I just edit the makefile so that each line
> containing gcc to 'gcc -O'?  I guess I'm not sure what factors are
> optimized.  I've also read on other lists that it really isn't worth the
> time.  Where could I do further reading on how to do this?
> Thanks,
> kent

This was posted already:

If you find sources that have to be build in the following sequence:
/configure ; make ; make install

Then I use the following.
   +The optimize flags are the same mandrake uses for compiling i586 binary rpm
files, I think.
   +(I found them somewhere in a discussion archive on the net) 
   +Originaly some flags like this.
   + -mcpu=i586
   + -march=i586
   +Best is to check man gcc and search the net for some examples. Check out
pgcc page: it's
   +about optimizing stuff: http://goof.com/pcg/index.html
   +Actually to be honest I used the optimization flags because it LOOKED fast
to me.
   +I even used -O3 on some packages and I even don't know what it does.
Create a new file (This is an one liner!):
vi MyConfigure

---<snip>---( modify this to your needs )

CFLAGS='-O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s -mcpu=k6
-march=k6 -ffast-math -mieee-fp -fexpensive-optimizations -malign-loops=2
-malign-jumps=2 -malign-functions=2' ./configure


Save it and: chmod 755 MyConfigure ( make it executable)
cp MyConfigure /usr/bin or /bin
Now you can compile some sources with some optimization, like this.
Normally you would do ./configure etc...
Now do: MyConfigure ; make ; make install

You have to see for yourself what is the best optimization:
   +Sometimes optimization for speed will result in bigger files due to loop
   +I did for myself compiled most of the source packages like this But I can't
really say
   +if a program runs faster or not. Well it looks like if X programs run
"snappier" compared to
   +the programs  I used to run on my old system (RH 6.1 i386 binaries) 
   +X, I did not try to compile it this way...yet. 


Mail archive: http://www.pcrdallas.com/mail-archives/lfs-discuss
Unsubscribe: email lfs-discuss-request at linuxfromscratch.org and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)

----- End forwarded message -----

Gerard Beekmans

-*- If Linux doesn't have the solution, you have the wrong problem -*-
Mail archive: http://www.pcrdallas.com/mail-archives/lfs-discuss
IRC access: server: irc.linuxfromscratch.org port: 6667 channel: #LFS
Unsubscribe: email lfs-discuss-request at linuxfromscratch.org and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)

More information about the lfs-dev mailing list