gcc-4.6.3 supports -march corei7
So after building the system and world I had gcc-4.5.4 installed. I then unmasked gcc-4.6.3 and emerged it. I followed the gcc upgrade guide and selected gcc-4.6.3 as active. Next I changed the CFLAGS to:

When it got to building gcc-4.5.4 it failed. config.log for libgcc complained under Core Tests that:

Code:

error: bad value (corei7) for -march= switch

I know that I can put -march=native back and the system will attempt to use the cpu flags that most closely match my architecture, but it seems to me that corei7 flag should have worked for my system. According to gcc.gnu.org:

IIRC, gcc gets built twice. First, it gets built with the already installed gcc, and then it gets built with the newly built gcc. So, if you are right about 4.5 not supporting corei7, it will fail in the second phase since it has no support for corei7._________________emerge --quiet redefined | E17 vids: I, II | Now using e from git | e18, e19, and kde4 sucks :-/

So I would expect that both gcc versions would compile via the active x86_64-pc-linux-gnu-gcc-4.6.3. The reason being is that I know you can build system/world with only one gcc installed, so that one gcc must build itself.

Would there be anyway to confirm in the logs what version of gcc was running during the failure? Everywhere I look the logs seem to just refer to the gcc command being run, but not the version of the gcc being run. I suppose I could always try to emerge -C gcc 4.5.4 and then build again with the corei7 cflags. I will have to wait until later today to do that though. My system is still building and I am heading out the door for the day now.

Am I right, isn't it possible to build system/world with only one version of gcc installed. Shouldn't only the active version build both installed versions of gcc in my case?

What I meant is the the built gcc rebuilds itself. So, the process would be

1. gcc-4.6 builds gcc-4.5 with corei7 flag
2. NOTE: gcc-4.5 is not installed yet, only built in /var/tmp/portage
3. the gcc-4.5 that is now already built and resides in /var/tmp/portage, now builds itself again with corei7 flag
4. if the compile is successful, then the final binaries are installed in /usr

I unmerged gcc-4.5.4, set march to corei7 then rebuilt system/world twice with success. I am still confused as to why gcc-4.5.4 builds itself when gcc-4.6.3 is the active gcc, but I guess I need to read up on the gcc build process to understand. Thank you for your insight.