Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CFLAGS wiki page questions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jamtat
Apprentice
Apprentice


Joined: 09 Aug 2003
Posts: 155

PostPosted: Tue Mar 24, 2015 7:24 pm    Post subject: CFLAGS wiki page questions Reply with quote

Now that I've begun in earnest setting up my system, I began to look more closely into system tuning options. One such option, as I understand it, is the CFLAGS option. The handbook recommends using -march=native, but the wiki page at https://wiki.gentoo.org/wiki/Safe_CFLAGS seems to offer a means for setting a more restricted CFLAG which, I'm guessing, might better compiling time/performance: have I understood correctly what this page is about?

I took a stab at following instructions there but understand rather poorly what's being done. Matters were not helped by the fact that the writer of that page clearly was not a native English speaker. I also got the impression that the information at that page might be somewhat out of date: is it really necessary anymore to set the -march= option to something other than native?

Essentially, I'm wondering whether it will be worthwhile for me to keep attemtping to understand and implement that information, or just to stick with what I have. Input will be appreciated.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10263
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Mar 24, 2015 7:33 pm    Post subject: Reply with quote

The Safe CFLAGS site came about before the -march=native option existed and has gotten somewhat out of date. The -march=native option is generally pretty accurate, especially if you have a mainstream, not absolutely brand new to the market CPU.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10306
Location: Córdoba (Spain)

PostPosted: Tue Mar 24, 2015 7:35 pm    Post subject: Reply with quote

Simply put: don't do it.

You don't usually need to tinker with CFLAGS nowadays unless you know you do. And that's mostly for cross-compiling environments and a few other things.

Since the introduction of the gcc -march=native flag, that's the best you will get, even for cpus that are not completely supported since that feature is able to autodetect all the instructions set that your cpu supports and will activate the needed compiler flags to use them.

So, -march=native is the most you'll get from your cpu.

When you use anything else is usually to product binaries for a given target architecture, which can be for the purpose of reusing them across many machines with a common base denominator or, as said, for cross-compiling.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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