LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Using CFLAGS and other options (https://www.linuxquestions.org/questions/linux-from-scratch-13/using-cflags-and-other-options-117808/)

vexer 11-19-2003 10:05 AM

Using CFLAGS and other options
 
When would you start using the CLFAGS and other options to have your lfs geared closer to your system?

I've done the whole chapter 5 without any optimizations. I know gcc and glibc shouldn't have any, but when can I?

I would like my programs to be set with some Athlon XP options and the like.


So when should you compile with optimizations? Chapter 5, 6?


+vexer

druuna 11-19-2003 11:45 AM

Chapter 6, but.........

There are some apps that don't like these flags. If I remember correctly they are mentioned in the documentation.

You can also look at the readme/install files that are in the sourcetree of the packages.

vexer 11-19-2003 02:13 PM

Yeah, i read all the relevant FAQ and other files during class today instead of doing work.

For the lazy people, the files mentioned were Binutils, gcc and glibc.
They said that setting optimization flags for these could either make them
not compile correctly or cause problems that would make other programs,
who are dependent of the afor mentioned, break.


+vexer
PS: Thank you for the chapter part, the faq nor book doesn't tell you when
you should start using them if you wanted to.

druuna 11-19-2003 02:38 PM

You could use the flags in chapter 5 too (excepts where mentioned not to), that's probably why they only mention flag settings if it is 'not advised'.
But what's the point of optimizing in chap. 5, it's a temporary environment.

dibblethewrecke 08-01-2004 08:02 AM

my thoughts exactly! anyone know a good resource that explains the optimization flags in a non-technical way? i.e. what is and isn't worth using and why, rather than what the flags actually do? cos to be honest what the flags actually do doesn't mean as much as what the results are! Of course i like to know what they do but only broadly - i'm never going to actually understand the COMPLETE picture!

dibblethewrecke 08-01-2004 08:03 AM

sorry just found it in this thread which was open in another window from my search :D

http://www.linuxquestions.org/questi...mization+flags

Andrew Benton 08-01-2004 03:22 PM

For what it's worth, my experience with optimisation is that it isn't worth the risk. Some things (xine-libs, mplayer) won't compile at all if you try to optimise them.
The benefit is that some apps may run faster but generally the difference is so slight that you can't see a difference. The risk is it makes apps crashy. I don't like crashy apps. It reminds me of Mandrake...I would recommend caution.

HLVS 08-18-2004 09:04 AM

Hi,

my experiences are that optimizations are really something lfs user should go for. At least -march option with -O2 is worth trying. O2 implies IMHO all relevant options and setting other doesn't change much. On my box I've all programs (including gcc/glibc, etc.) compiled with -march=athlon-tbird and I've never had stability problem. But (as I've read somewhere), fact that it works for me doesn't mean it will work for you.


All times are GMT -5. The time now is 06:01 AM.