Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Emerge and Cflags - general question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
s003apr
Apprentice
Apprentice


Joined: 04 Oct 2002
Posts: 162

PostPosted: Wed Jan 15, 2003 2:32 pm    Post subject: Emerge and Cflags - general question Reply with quote

I'm pretty much a newbie when it comes to compiling and programming so if you answer my question, it's ok to talk to me like I'm stupid, because I really am in this area.

BACKGROUND

I've only recently realized that the CFLAGS are the options we are giving gcc for compiling c code and C++FLAGS are for compiling C++ (correct?).

Since I went with a stage 3 gentoo install, I have the default flags for my athlon-xp in make.conf
Code:
CFLAGS='-march=athlon-xp -mcpu=athlon-xp -O3 -pipe'
CXXFLAGS='-march=athlon-xp -mcpu=athlon-xp -O3 -pipe'

I also checked make.defaults and make.globals and there was no additional options in them.


However, when I emerged something I noticed that it says the following on screen:
Code:
... -I/usr/X11R6/include -DI386_ASSEM -I../../intl -march=athlon-xp -mcpu=athlon-xp -O3 -pipe -Wall -Wpointer-arith -finline-functions -ffast-math -fomit-frame-pointer -funroll-all-loops -c configure.c  -fPIC


This is of course only a small portion of all the output when building a program. From my newbie standpoint, I'd gather that this is where the file configure.c is being built.

The important thing I notice is that there are a lot of other options here that were never in my CFLAGS
ie.
Code:
-Wall -Wpointer-arith -finline-functions -ffast-math -fomit-frame-pointer -funroll-all-loops


QUESTION

why is it compiling with these options if I never specified these in the CFLAGS?[/code]
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Wed Jan 15, 2003 4:38 pm    Post subject: Reply with quote

Because the package can add or subtract options if it thinks it will help performance or stability in some way.

For example, some packages rollback from O3 to O2 because they are known to be broken if compiled with O3. Other packages add flags that developers think will boost performance.

I am not a developer myself, but it is this AFAIK.
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum