Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GCC CFLAGS forum
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Forums Feedback
View previous topic :: View next topic  

Different CFLAGS part in the forum?
YEAH!!
61%
 61%  [ 19 ]
Nehh, I'd never use 31337 settings anyway
29%
 29%  [ 9 ]
I have another solution and that is....
9%
 9%  [ 3 ]
Total Votes : 31

Author Message
Rroet
Apprentice
Apprentice


Joined: 27 May 2002
Posts: 176
Location: The Hague, The Netherlands

PostPosted: Sun Sep 29, 2002 12:50 pm    Post subject: GCC CFLAGS forum Reply with quote

Would this be a good idea?

Now these CFLAGS threads are flying arround, somewhat centralized into 1 thread.. somehow I find talking about ALL them different cpu-types in 1 thread a bit confusing.

This is why I'm now asking if it's possible to have a seperate part in the forum for CFLAGS. Then we can split the threads up into about 6 or 7 different or maybe <in the future> 20 different threads on how you use your specific cpu-type with CFLAGS.
I know in the main installation you'll use a GENERIC cflags that will work on your any system of that cpu-type. <it's for noobs, I know> but after all the more advanced users would like to use some more 31337 settings to tweak their system to the max.

Different cpu's I can allready think of are:
i586
pentium2
pentium3
celeron
athlon-xp
athlon-mp
athlon-tbird
duron
sparc
sparc64
alpha

and so on and on...
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Sun Sep 29, 2002 5:32 pm    Post subject: Reply with quote

When I decide to learn about CFLAGS, I'm certain I will dislike a cumbersome thread with eight pages of posts. I'm not sure I like the idea of a new forum just for CFLAGS though. Perhaps splicing the current eight page behemoth into architecture based threads would be more useful.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Sep 29, 2002 5:35 pm    Post subject: Reply with quote

The current policy is to centralize all CFLAGS discussion in CFLAGS Central. The goals of the moderators include making the forums easy to read and use for everyone, and trying to keep duplicate information to a minimum. Keeping that in mind, the CFLAGS policy is not set in stone, and we will monitor this discussion and take all your input into consideration.

One other thing I would like people to remember is that during discussion of the recent forum reorganization (like here) the consensus was that we had too many forums before.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
phong
Bodhisattva
Bodhisattva


Joined: 16 Jul 2002
Posts: 778
Location: Michigan - 15 & Ryan

PostPosted: Mon Sep 30, 2002 5:30 pm    Post subject: Reply with quote

I think there's the mistaken idea that CFLAGS need to vary significantly from system to system. Unless you're gonna split hairs, everyone can use "-march=[your cpu] -O3 -pipe". All that's really needed is a web page that tells you what to put in for [your cpu], and that actually exists already. For those who want to push it, it would be cool to have a table that cross references which flags are known to work with certain packages and which break them (and which are uncertain).

Also, if people would take 10 seconds to do:
Code:
# gcc -v -Q -O3 -march=[whatever] hello_world.c

They would save themselves TONS of time fretting over what flags to use. Half the people out there are turning on options that are already turned on by -O3. The reality is, if it's not turned on by -O3, it's probably because there's a drawback - either it breaks some programs, bloats code excessively or actually makes it run _slower_ much of the time.

Not every "optimization" that gets implemented turns out to be a winner. For example, -funroll-loops might be a big win on packages with small tight loops (where the overhead of the loop itself is a significant fraction of its execution time), or on processors with big instruction caches, but it can be a big loss in the opposite situations. Heck, the difference betwen -O2 and -O3 isn't _that_ big most of the time (-O2 can even be faster in some circumstances.) I turn on -fomit-frame-pointer because it is usually safe, but it does break debugging and apparently a few packages need to mask it (some versions of gcc actually turn it on with -O3 too apparently).

I've come to the conclusion that one properly designed page of documentation on CFLAGS is all that is necessary to answer 95% of the CFLAGS questions and having a whole forum would be a waste.
_________________
"An empty head is not really empty; it is stuffed with rubbish. Hence the difficulty of forcing anything into an empty head."
-- Eric Hoffer
Back to top
View user's profile Send private message
santi___
n00b
n00b


Joined: 20 Jun 2002
Posts: 38
Location: Santa Fe, Argentina

PostPosted: Thu Oct 03, 2002 3:37 am    Post subject: Reply with quote

phong wrote:
I've come to the conclusion that one properly designed page of documentation on CFLAGS is all that is necessary to answer 95% of the CFLAGS questions and having a whole forum would be a waste.


I think this is the page you were looking for.
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Thu Oct 03, 2002 4:24 am    Post subject: Reply with quote

santi___ wrote:
I think this is the page you were looking for.

This link should get advertised in HUGE red letters over the CFLAGS thread, together with one pointing to the other options, like CPU types.
CFLAGS Central is impossible to read, but what would you want to talk about that fills an entire forum?[1]
___________________
[1] This is not a rhetorical question, I assume there is stuff people find fascinating about compiler flags, I just don't know what it is...
Back to top
View user's profile Send private message
Rroet
Apprentice
Apprentice


Joined: 27 May 2002
Posts: 176
Location: The Hague, The Netherlands

PostPosted: Thu Oct 03, 2002 12:39 pm    Post subject: Reply with quote

You can advertise and external site and say "look there.. rtfm" but nobody will understand ALL the settings.

Better to make a thread per processor and explain what would be best for every CPU and explain what's best for the little bugger.. This will teach all the readers more then what they would just reading the dry manual.
Back to top
View user's profile Send private message
masseya
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 2602
Location: Baltimore, MD

PostPosted: Thu Oct 03, 2002 10:27 pm    Post subject: Reply with quote

Rroet wrote:
Better to make a thread per processor and explain what would be best for every CPU and explain what's best for the little bugger.. This will teach all the readers more then what they would just reading the dry manual.
I don't think those threads would get much traffic. I certainly don't think that the topic deserves its own forum. I like the idea of describing this topic in depth, but I don't like the idea of doing that when it's already documented elsewhere.
_________________
if i never try anything, i never learn anything..
if i never take a risk, i stay where i am..
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Fri Oct 04, 2002 5:29 pm    Post subject: Reply with quote

Basically, I think a good/useable solution is not capable within the forums. Having said that, people interested in a project involving Gentoo Documentation may want to read this post.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
aardvark
Guru
Guru


Joined: 30 Jun 2002
Posts: 576

PostPosted: Sat Oct 05, 2002 9:48 am    Post subject: Reply with quote

plate wrote:
santi___ wrote:
I think this is the page you were looking for.

This link should get advertised in HUGE red letters over the CFLAGS thread, together with one pointing to the other options, like CPU types.
CFLAGS Central is impossible to read, but what would you want to talk about that fills an entire forum?[1]
___________________
[1] This is not a rhetorical question, I assume there is stuff people find fascinating about compiler flags, I just don't know what it is...


That guide is (very) unclear on certain things. An example:
Quote:
about -ffast-math:
This option should never be turned on by any -O option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions.

Ok, as if I , as a user, can determine what is included in (turned on by) -O options!
This look more like a guideline for people working on future versions of gcc. I don't get it...
Another one about the options include in -O2 and above:
Quote:

The -O2 option turns on all of these optimizations except -funroll-loops and -funroll-all-loops. On most machines, the -O option turns on the -fthread-jumps and -fdelayed-branch options, but specific machines may handle it differently.

Somewhere under the above description:
Quote:

-falign-functions
-falign-functions=n
Align the start of functions to the next power-of-two greater than n, skipping up to n bytes. For instance, -falign-functions=32 aligns functions to the next 32-byte boundary, but -falign-functions=24 would align to the next 32-byte boundary only if this can be done by skipping 23 bytes or less.

-fno-align-functions and -falign-functions=1 are equivalent and mean that functions will not be aligned.


Some assemblers only support this flag when n is a power of two; in that case, it is rounded up.


If n is not specified, use a machine-dependent default.

So what is actually included by -O2 and above?
Pointing us to the gcc guide will not answer all of our questions as you can see.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sat Oct 05, 2002 5:25 pm    Post subject: Reply with quote

aardvark wrote:
Quote:
about -ffast-math:
This option should never be turned on by any -O option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions.

Ok, as if I , as a user, can determine what is included in (turned on by) -O options!
This look more like a guideline for people working on future versions of gcc. I don't get it...

I take it to mean "you, programmer, don't have to worry about -Ox turning on -ffast-math and making your math functions return inaccurate results".

Quote:
So what is actually included by -O2 and above?

It varies by architecture and compiler version, but as phong suggested above, you can always find out by simply running:
Code:
$ gcc -v -Q -O2 -march=[whatever] hello_world.c
...on any C program.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
mooman
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 175
Location: Vancouver, WA

PostPosted: Tue Nov 19, 2002 11:43 pm    Post subject: Reply with quote

How about a forum for CFLAGs and USE Flags...?
We seem to get enough questions about both...
_________________
Linux user off and on since circa 1995
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Forums Feedback 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