This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Two build != host fixes
- From: Jeff Law <law at redhat dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, DJ Delorie <dj at redhat dot com>
- Date: Wed, 22 Jan 2014 21:21:46 -0700
- Subject: Re: Two build != host fixes
- Authentication-results: sourceware.org; auth=none
- References: <20131212010230 dot GB16770 at bubble dot grove dot modra dot org> <DUB122-W155981D9FD99E5FCA83795E4DB0 at phx dot gbl> <20131217232839 dot GB1864 at bubble dot grove dot modra dot org> <DUB122-W1783A4BB2C927FBBE08176E4DA0 at phx dot gbl> <20131219101143 dot GA7521 at bubble dot grove dot modra dot org> <DUB122-W329B01E20BD93DF4401BD2E4C50 at phx dot gbl> <20131219212702 dot GB7521 at bubble dot grove dot modra dot org> <DUB122-W421BF5D762C9D8CF12B1E3E4C40 at phx dot gbl> <DUB122-W1771B2F0A0E683E63302B7E4B60 at phx dot gbl> <DUB129-W12ECA02F1F2020BD37357DE4A70 at phx dot gbl> <20140123034620 dot GY5390 at bubble dot grove dot modra dot org>
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