i've tried to emerge =sys-devel/gcc-3.3.6-r1 and =sys-devel/gcc-3.4.6-r2 for testing purpose. They both fail my CFLAGS is CFLAGS="-march=native -pipe -O2" my 'normal' compiler is gcc-4.5 3.3.6-r1 fails with -------------------------------------------------------------------- cc1: error: bad value (native) for -march= switch cc1: error: bad value (native) for -mcpu= switch cc1: error: bad value (native) for -march= switch cc1: error: bad value (native) for -mcpu= switch echo "static const char *srcdir = " >> tmp-gtyp.h make[2]: *** [gengtype-lex.o] Error 1 make[2]: *** Waiting for unfinished jobs.... echo "\"/var/tmp/portage/sys-devel/gcc-3.3.6-r1/work/gcc-3.3.6/gcc\"" >> tmp-gtyp.h echo ";" >> tmp-gtyp.h make[2]: *** [gengtype-yacc.o] Error 1 -------------------------------------------------------------------- and 3.4.6 with -------------------------------------------------------------------- stage1/xgcc -Bstage1/ -B/usr/x86_64-pc-linux-gnu/bin/ -c -march=native -pipe -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wold-style-definition -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/gcc-3.4.6/gcc -I/var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/gcc-3.4.6/gcc/. -I/var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/gcc-3.4.6/gcc/../include /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/gcc-3.4.6/gcc/gengenrtl.c -o gengenrtl.o /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/gcc-3.4.6/gcc/errors.c:1: error: bad value (native) for -march= switch /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/gcc-3.4.6/gcc/errors.c:1: error: bad value (native) for -mtune= switch echo "/* This file is machine generated. Do not edit. */" > tmp-gtyp.h /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/gcc-3.4.6/gcc/gengenrtl.c:1: error: bad value (native) for -march= switch /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/gcc-3.4.6/gcc/gengenrtl.c:1: error: bad value (native) for -mtune= switch -------------------------------------------------------------------- Reproducible: Always It seems weird to me that the compiler tries to compile itself with my very own CFLAGS. I have tried to set CFLAGS before emerging, but this does the same errors: setenv CFLAGS "-pipe -O2" emerge =sys-devel/gcc-3.3.6-r1 =sys-devel/gcc-3.4.6-r2
Yes, the `native' value for -march et al. was introduced in version 4.2.
Yes, i had understood about the native... There were two sentences at the bottom of my report ------------------------------------------------------------------------ It seems weird to me that the compiler tries to compile itself with my very own CFLAGS. I have tried to set CFLAGS before emerging, but this does the same errors: setenv CFLAGS "-pipe -O2" emerge =sys-devel/gcc-3.3.6-r1 =sys-devel/gcc-3.4.6-r2 ------------------------------------------------------------------------ So, basically, i'm asking: * Why is the CFLAGS used by all stages ? Shouldn't it be used only with the local compiler, not the one being compiled ? * Why does setting CFLAGS this way does not solve the problem ?
Don't use bad CFLAGS :) what might work is: CFLAGS="-O2 -pipe" emerge gcc
*** This bug has been marked as a duplicate of bug 180184 ***