Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 323387 - sys-devel/gcc-{3.3.6-r1,3.4.6-r2} - cc1: error: bad value (native) for -march= switch
Summary: sys-devel/gcc-{3.3.6-r1,3.4.6-r2} - cc1: error: bad value (native) for -march...
Status: RESOLVED DUPLICATE of bug 180184
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 01:31 UTC by Thomas Capricelli
Modified: 2011-12-27 02:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2010-06-10 01:31:49 UTC
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
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-06-10 02:29:45 UTC
Yes, the `native' value for -march et al. was introduced in version 4.2.
Comment 2 Thomas Capricelli 2010-06-10 08:38:38 UTC
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 ?
Comment 3 Patrick Lauer gentoo-dev 2010-06-10 11:37:23 UTC
Don't use bad CFLAGS :)
what might work is:

CFLAGS="-O2 -pipe" emerge gcc
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2011-12-27 02:21:15 UTC

*** This bug has been marked as a duplicate of bug 180184 ***