This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Two build != host fixes


On 01/22/14 20:46, Alan Modra wrote:
I was hoping for a reply from someone who could OK the previous patches
submitted.  Admittedly, I didn't tick all the boxes (no changelog entry),
so here they are again.
It's been in my stack of patches, others may be shying away from the insanity that is our build system.



The Makefile.in BUILD_CPPFLAGS change is for exactly the same reason
as my 2013-12-05 change.  When GMPINC points at an installed host gmp,
it results in picking up other host headers, which might be wrong for
the build machine.  We found this to be true even for very similar
build and host machines, in our case a powerpc64-linux build,
powerpc64le-linux host and target configuration, where differences in
glibc version between the build and host were enough to cause errors.

The configure.ac change is to fix a bug Bernd found when gmp is
in-tree but not installed.  In that case the recursive configure fails
due to system.h wanting to include gmp.h and not finding it:

/* Do not introduce a gmp.h dependency on the build system.  */
#ifndef GENERATOR_FILE
#include <gmp.h>
#endif

So, define GENERATOR_FILE for configure as we do when actually running
the build compiler.  The other changes are for consistency, but are
not strictly necessary.  I left them in this patch because they make
sense to me, and that's the way both Bernd and I tested this patch.

OK for mainline?

Bernd, if this isn't approved then I'll revert my previous change.
I believe I can do that without approval.

	* Makefile.in (BUILD_CPPFLAGS): Do not use ALL_CPPFLAGS.
	* configure.ac <recursive call for build != host>: Define
	GENERATOR_FILE.  Comment.  Use CXX_FOR_BUILD, CXXFLAGS_FOR_BUILD
	and LD_FOR_BUILD too.
	* configure: Regenerate.
The configure.ac changes look fine to me.

Not sure about the Makefile.in changes, probably because I simply don't understand this mess anymore. Is it the $INCLUDES or $CPPFLAGS from ALL_CPPFLAGS that causes the problem? I'm guessing the latter since it's substituted via @CPPFLAGS@.

If so, shouldn't we use BUILD_CPPFLAGS=$INCLUDES $(CPPINC)?

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]