This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Require MPC for building GCC
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: "Hans-Peter Nilsson" <hp at bitrange dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 6 Dec 2009 13:09:08 -0700
- Subject: Re: [PATCH]: Require MPC for building GCC
- References: <Pine.GSO.4.58.0911142059110.13831@caipclassic.rutgers.edu> <20091206132853.S62475@dair.pair.com>
From: "Hans-Peter Nilsson" <hp@bitrange.com>
On Sat, 14 Nov 2009, Kaveh R. GHAZI wrote:
I've verified that, with this patch, the configure script (correctly)
aborts if MPC is not found or if the version is not recent enough. I
also did three bootstraps on x86_64-unknown-linux-gnu, one with mpc
installed and found via --with-mpc=, one with mpc (only) in-tree, and
one with gmp, mpfr, and mpc all in-tree.
But I presume not one with *just* gmp and mpfr in-tree and no
mpc, as is IMHO a reasonable situation before the mpc requirement.
All three configurations
bootstrapped successfully and had no regressions.
Despite the good efforts, I didn't see the nice error message,
just the less graceful:
[...]
Yes, the pre-existing mechanism for finding GMP/MPFR (and now MPC) need the
packages to be installed somewhere in order to do existence and version
checks. If any one of these packages are in-tree, the checks are bypassed
and the user is expected to know what to do. I agree this is not desirable,
but it is not something new and I don't see a good way to fix it. Note I
just tried compiling gcc-4-4.2 with GMP in-tree but with no MPFR. I ran
into the same problem, so it's not limited to MPC.
cc -c -g -DIN_GCC -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.4.2/gcc -I../../gcc-4.4.2/gcc/.
-I../../gcc-4.4.2/gcc/../include -I../../gcc-4.4.2/gcc/../libcpp/include -I/tmp/kg/build/./gmp
-I/tmp/kg/gcc-4.4.2/gmp -I../../gcc-4.4.2/gcc/../libdecnumber -I../../gcc-4.4.2/gcc/../libdecnumber/dpd
-I../libdecnumber ../../gcc-4.4.2/gcc/attribs.c -o attribs.o
"../../gcc-4.4.2/gcc/real.h", line 26: cannot find include file: <mpfr.h>
"../../gcc-4.4.2/gcc/real.h", line 474: syntax error before or at:
mpfr_srcptr
[etc]
I believe the original rationale for this started with the fact that the
configure tests are based on a compile check which includes gmp.h. Note for
the GMP package, gmp.h is *generated* during the build process. So if GMP
is in-tree, you cannot include gmp.h during a top-level configure because it
hasn't been created yet. Since mpfr.h requires gmp.h, and mpc.h requires
mpfr.h, you cannot do tests for these packages either if GMP is in-tree.
Were this issue to be bypassed, we also perform link tests to ensure that
the library version matches the header. These again cannot be done if any
package is in-tree.
--Kaveh