Talk:Safe CFLAGS

The aim of this page is to create an alternative to this. Since we can not directly copy, I would suggest that users instead check their own CFLAGS and put them into this page so that we can build up a solid list of CPUs and their suggested CFLAGS.

= --march=native =

I think this page should include a chapter explaining why --march= would be better than --march=native, because it's confusing for new users to find these two different recommendations without any explanation which one is the "proper" way.
 * Although the page now mentions march=native, it still doesn't explain, why march=corei7 would be preferred (what are the benefits) over march=native, which may confuse many people. Smartass 15:54, 11 December 2012 (UTC)

I just added a section for the Core 2 Duo, and ran into a problem that touched on your comment. Apparently setting the "-march" explicitly vs using native might effect your ability to cross compile, and it may effect what processor optimizations are enabled:

Setting -march=core2 tells gcc to enable MMX, SSE, SSE2, SSE3, SSSE3 instruction set support. (Citation: http://gcc.gnu.org/onlinedocs/gcc-4.4.4/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options  ) Would then setting the USE variable to include "MMX, SSE, SSE2, SSE3" be redundant?

Some core 2 solo/duo/quad processors support sse4, sse4a, and sse4_1. (Including mine..) I'd like to find a safe and correct way of enabling support for sse4 sse4a, and sse4.1 in the CFLAGS and/or USE for a core 2 duo that supports them.

I don't think seting these in the USE flags is the correct way. Unless I'm mistaken, only packages that support those use flags would benefit; or am I wrong about that? Also I noticed that the sse4, sse4a, and sse4_1 USE flags are not included in the global use flag list at: http://www.gentoo.org/dyn/use-index.xml  Does there abscence from that list mean those use flags would have no effect?

One person who made a nice page about optimizing for the Core 2 solo/duo/quad (Citation: http://wiki.gentoo.org/wiki/Intel_Core_2 ) suggested just setting -march=native. GCC seems to recognize the sse4 instruction sets when I run "gcc -march=native -E -v - &1 | grep cc1" so setting -march=native would seem to solve the problem. However sometimes I cross compile; and according to the Gentoo GCC optimization guide (  http://www.gentoo.org/doc/en/gcc-optimization.xml ) using native will cause problems when trying to cross compile. So many questions raised.... I should turn this into a forum post - It kind of got out of hand... To sum up: I'd like to add to this page a safe and correct way of enabling support for sse4 sse4a, and sse4.1 in the CFLAGS/USE for a core 2 duo that supports them. Any one know how? Thank you! Aries97 (talk) 04:45, 15 May 2013 (UTC)