installing "ed"

Rudolf Floers r.floers at web.de
Wed Dec 27 07:51:19 PST 2000


On Wed, Dec 27, 2000 at 10:21:12AM -0500, Simon Perreault wrote:
> On Tuesday 26 December 2000 16:36, Lab Monkey wrote:
> > i have not tried that. how do i do that?
> 
> A great many compilation errors are caused by optimization. At the beginning 
> of chapter 6, you are told about "Debugging symbols and compiler 
> optimizations". You are told to put
> 
> CFLAGS="-O3 -march=xxx"
> CXXFLAGS=$CFLAGS
> 
> in your .bash_profile. These are the optimization flags. What they do is 
> define two environment variables, CFLAGS and CXXFLAGS. They are used by 
> configure scripts to determine what flags to pass to the compiler. In this 
> case, the flags "-O3" and "-march=xxx" (where "xxx" depends on the system 
> architecture) are used when compiling software. "-O3" means to enable the 
> third level of optimization (0 being non-optimized and 6 being quite a bit 
> optimized), and "-march=xxx" means to optimize for a specific processor 
> architecture.
> 
> You can disable extra optimization by commenting out these two lines in your 
> .bash_profile (commenting out means putting a "#" at the beginning of each 
> line), and logout/login. This will make the compilation default to the 
> package-approved compilation level (often this is -O2). Sometimes this is not 
> enough, and you must remove all optimization flags. You can do that by 
> changing the "-O3 -march=xxx" in ".bash_profile" to "-O", and logout/login 
> again (don't forget to uncomment these two lines).
> 
> Sometimes, if the package doesn't use a "configure" script, that means that 
> it won't check for you environment variables. You can force "make" to use the 
> environment variables by using the "-e" flag when running "make", but this is 
> often leads to disaster, as environment variables are often redefined in the 
> "Makefile". To really change optimization flags when not using a "configure" 
> script, you must edit the "Makefile", find the variable that defines compiler 
> options (it's not always named "CFLAGS") and edit it so that you have a "-O" 
> at the end.

i don't want to say the above is wrong, but i have successfully compiled every package with -O3 and -march=i686 so far. (but i would recommend using -march=xxx only, because the package authors may have thought of sth when deciding to use -O2, etc.) 
would really like to know, why some guys can compile a package with -O3 -march=xxx, while others can't. any ideas? what does it depend of?

i have compiled the 2.2 kernel with -march=i686, too. did you notice that by default it's compiled with -m486, even if you configure for sth better than an i486? but perhaps the -DCPU=686 flag it uses overrides that. 
2.4 kernel however uses -march=i686 by default (only on i686 machines of course).
see arch/i386/Makefile for the details.

RF



-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message




More information about the lfs-dev mailing list