sys-devel/gcc-4.6.4 fails to build on Haswell or newer if -march=native is used: /tmp/portage/portage/sys-devel/gcc-4.6.4/work/gcc-4.6.4/gcc/cp/pt.c: In function ‘tsubst_copy_and_build’: /tmp/portage/portage/sys-devel/gcc-4.6.4/work/gcc-4.6.4/gcc/cp/pt.c:12620:4: warning: format not a string literal and no format arguments [-Wformat-security] {standard input}: Assembler messages: {standard input}:862: Error: no such instruction: `vfmadd312ss .LC21(%rip),%xmm1,%xmm0' Makefile:1105: recipe for target 'gcov.o' failed Apparently, the compiler will schedule instructions that are not known to the assembler if too new CPUs are used. However, gcc-4.6.4 is the newest that can be used with nvidia's nvcc for CUDA programs, so for some users it is necessary to keep this version. Reproducible: Always This can be worked around with echo 'CFLAGS="-O2 -pipe -march=corei7"' > /etc/portage/env/gcc-4.6.conf echo '=sys-devel/gcc-4.6* gcc-4.6.conf' > /etc/portage/package.env/gcc-4.6 However, this problem does not only affect gcc itself, but also potentially programs compiled with a gcc-4.6 with -march=native. See also: http://sourceforge.net/apps/mediawiki/ltilib/index.php?title=Compilation_hints https://groups.google.com/forum/#!msg/moveit-users/GOvN3MOaXJ4/Xy7cxFllj3kJ
GCC can't build a toolchain with CFLAGS it doesn't know about.
Ignore Jeroen. Yes this usually always happens with -march=native and new cpus on old versions. Unfortunately the 4.6 branch is closed upstream and I can't track down whatever fix didn't get backported along with FMA3 support, so you'll have to forgo -march=native on 4.6. Another work around might be -march=native -mno-fma.
Found it.
Created attachment 373792 [details, diff] 85_all_fma-instruction-typo.patch
Fixed in 4.6.4 p1.2.