LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 11-19-2003, 10:05 AM   #1
vexer
Member
 
Registered: Jan 2003
Location: Sudbury Ontario, Canada
Distribution: Slackware
Posts: 388

Rep: Reputation: 30
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
 
Old 11-19-2003, 11:45 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
Old 11-19-2003, 02:13 PM   #3
vexer
Member
 
Registered: Jan 2003
Location: Sudbury Ontario, Canada
Distribution: Slackware
Posts: 388

Original Poster
Rep: Reputation: 30
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.
 
Old 11-19-2003, 02:38 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
Old 08-01-2004, 08:02 AM   #5
dibblethewrecke
Member
 
Registered: Nov 2003
Location: UK
Distribution: Arch Linux
Posts: 210

Rep: Reputation: 30
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!
 
Old 08-01-2004, 08:03 AM   #6
dibblethewrecke
Member
 
Registered: Nov 2003
Location: UK
Distribution: Arch Linux
Posts: 210

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

http://www.linuxquestions.org/questi...mization+flags
 
Old 08-01-2004, 03:22 PM   #7
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
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.
 
Old 08-18-2004, 09:04 AM   #8
HLVS
Member
 
Registered: Oct 2003
Location: Prague, Czech Republic
Distribution: Gentoo, FreeBSD
Posts: 37

Rep: Reputation: 15
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
export CFLAGS GCC help TieN Programming 2 06-17-2005 03:24 AM
Default/Undefined CFLAGS? jong357 Slackware 6 03-11-2005 01:59 PM
cflags exodist Linux - Software 2 01-14-2005 07:44 PM
CFLAGS library -l and -i abs Programming 2 04-11-2004 10:03 PM
how to unset cflags? shanenin Linux - Software 4 01-25-2004 09:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration