Created attachment 29155 [details] output gcc/system.h:639:17: fatal error: gmp.h: No such file or directory when building ARM native compiler by cross-compiler trunc revision 195120
Basically a candian cross will fail if you don't have gmp.h installed on the build machine. system.h includes gmp.h but system.h is included for build and not just target
Btw, previously we'd have #ifndef GENERATOR_FILE around gmp.h includes. I didn't see the point of this, but if it's not really required there we can re-instantiate it. Not sure if it's a good idea to change effective system.h behavior though - system.h is included in configure tests. I doubt we "properly" separate tests for build vs. host. Do we?
We run configure for the build system in a subdirectory, when build != host. # auto-host.h is the file containing items generated by autoconf and is # the first file included by config.h. # If host=build, it is correct to have bconfig include auto-host.h # as well. If host!=build, we are in error and need to do more # work to find out the build config parameters. if test x$host = x$build then build_auto=auto-host.h else # We create a subdir, then run autoconf in the subdir. # To prevent recursion we set host and build for the new # invocation of configure to the build for this invocation # of configure. [...]
Index: gcc/system.h =================================================================== --- gcc/system.h (revision 195194) +++ gcc/system.h (working copy) @@ -636,7 +636,10 @@ extern int vsnprintf(char *, size_t, con #include <dlfcn.h> #endif +/* Do not introduce a gmp.h dependency on the build system. */ +#ifndef GENERATOR_FILE #include <gmp.h> +#endif /* Get libiberty declarations. */ #include "libiberty.h" should restore previous behavior. I'm not sure if any configure check for the build system includes system.h and does _not_ define GENERATOR_FILE. So, does the build configury define GENERATOR_FILE?
Author: rguenth Date: Tue Jan 15 15:54:05 2013 New Revision: 195205 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195205 Log: 2013-01-15 Richard Biener <rguenther@suse.de> PR bootstrap/55961 * system.h: Do not include gmp.h for building host tools. Modified: trunk/gcc/ChangeLog trunk/gcc/system.h
Fixed.