Flags that are passed to newly built gcc when compiling code for target system during are determined by value of `CFLAGS_FOR_TARGET' makefile variable as defined in top level `Makefile'. `CFLAGS' in that `Makefile' are passed on for use with old compiler used to bootstrap gcc.
Can not configure `CFLAGS_FOR_TARGET' value at all, that is, can not change its value and nothing more by passing arguments to / setting variables in `configure'. Top level `Makefile.in' just unconditionally duplicates `$(CFLAGS)' into it. Thus the same flags are passed to completely different compilers. If old compiler is not a gnu one, its flags does not have to be recognized by newly built gcc at all. In this case target code does not build at all like this. checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. gmake: *** [configure-intl] Error 1 checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. gmake: *** [configure-libiberty] Error 1 The worst is sometimes gcc maintainers themselves tell users to specify weird flags to native compiler - like pinskia at gcc dot gnu dot org did on 2005-11-23 15:04 in <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25002>: > the problem is that you need to supply -ieee to the > compiler. gcc does not recognize it. How-To-Repeat: That particular case of needing `-ieee' flag not recognized by gcc is described in <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16787>. ------- Comment #1 from gin at mo dot msk dot ru 2005-12-28 15:53 ------- Fix: One workaround is described in that same <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16787#c6>: to put these weird flags in `CC' value as passed to `configure', and leave in `CFLAGS' only those recognized by gcc, if any. If put all flags in `CC', why have separate `CFLAGS' variable at all? The other is explicitly set `CFLAGS_FOR_TARGET' in `make' command line. gmake CFLAGS_FOR_TARGET='-O2 -pthread -g -mieee' bootstrap; -- Summary: can not configure CFLAGS_FOR_TARGET Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gin at mo dot msk dot ru http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25589