On Fri, Sep 12, 2003 at 10:32:06AM -0700, Paul Eggert wrote: > Daniel Jacobowitz <drow@xxxxxxxxx> writes: > > > GCC is built (in bootstrap mode at least, where we know the compiler > > will be GCC) using -Werror. > > OK. Then it should be configured with -Werror too. In general, you > can't configure with one set of options, and build with a different > set of options, without running into problems like this. One of many problems with this is shared config.cache. Not all directories can be built with -Werror. It happens that libiberty does not use -Werror, and is always configured first, so _that_ finds malloc.h. The gcc/ directory hasn't converted to autoconf 2.57 yet, but it's still being bitten by this change, because of this. There appears to be no way around this. > In general, if you're going to use two different compilers in > different stages of thebuild, you to have to do the equivalent of > running 'configure' twice. Once for the native compiler, and once for > the bootstrap mode where you know the compiler is GCC. This is > because the two compilers won't necessarily be compatible. > > If I recall correctly, GCC doesn't run 'configure' twice; instead, it > uses 'configure' to determine the characteristics of the native > compiler, and then overrides that determination when it knows that it > is compiling itself. You can do this with something like the > following: > > #include <config.h> > > /* Do not include <memory.h> if compiling with GCC, even if 'configure' > found it available with the native compiler. GCC never needs > <memory.h>, and since we use -Werror in bootstrap mode, including > <memory.h> here might cause a compilation failure. */ > #ifdef __GNU_C__ > # undef HAVE_MEMORY_H > #endif Unless there's a platform where malloc.h is in fact necessary. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer