------- Comment #3 from fxcoudert at gcc dot gnu dot org 2010-01-02 19:53 ------- OK, I can reproduce the issue.
1. I have a GCC trunk (rev. 155544). In there I put symlinks to gmp-4.3.1, mpfr-2.4.2 and mpc-0.8.1 2. From an empty build directory, I configure with: ../trunk/configure --prefix=/Users/fx/devel/gcc/irun --enable-languages=c 3. "make" fails with: checking for __gmpz_init in -lgmp... no configure: error: libgmp not found or uses a different ABI. make[2]: *** [configure-stage1-mpc] Error 1 make[1]: *** [stage1-bubble] Error 2 make: *** [all] Error 2 The problem is actually not an ABI one, but that the mpc configure fails with: configure:10805: checking for __gmpz_init in -lgmp configure:10830: gcc -o conftest -g -fkeep-inline-functions -I/Users/fx/devel/gcc/ibin-intree/./gmp -I/Users/fx/devel/gcc/trunk/mpfr conftest.c -lgmp >&5 ld: library not found for -lgmp The problem is that mpc isn't told where to find the gmp and mpfr libraries. It is confirmed by the mpc configure command-line (from mpc/config.log): /Users/fx/devel/gcc/trunk/mpc/configure --cache-file=./config.cache --prefix=/Users/fx/devel/gcc/irun --enable-languages=c --program-transform-name=s,y,y, --disable-option-checking --build=x86_64-apple-darwin10.2.0 --host=x86_64-apple-darwin10.2.0 --target=x86_64-apple-darwin10.2.0 --srcdir=../../trunk/mpc --disable-intermodule --enable-checking=yes,types --disable-coverage --enable-languages=c --disable-shared --with-gmp-include=/Users/fx/devel/gcc/ibin-intree/./gmp --with-mpfr-include=/Users/fx/devel/gcc/trunk/mpfr This can be contrasted with mpfr, which is configured with '--with-gmp-build=/Users/fx/devel/gcc/ibin-intree/./gmp', and thus knows where to find libgmp. So it seems that the following patch should be applied to configure.ac: Index: configure.ac =================================================================== --- configure.ac (revision 155544) +++ configure.ac (working copy) @@ -1287,7 +1287,7 @@ if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpfr/_libs '"$gmplibs" gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc" - extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr' + extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/.libs' # Do not test the mpfr version. Assume that it is sufficient, since # it is in the source tree, and the library has not been built yet # but it would be included on the link line in the version check below @@ -1321,7 +1321,7 @@ gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/gmp/_libs '"$gmplibs" gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" extra_mpfr_configure_flags='--with-gmp-build=$$r/$(HOST_SUBDIR)/gmp' - extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp' + extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/.libs' # Do not test the gmp version. Assume that it is sufficient, since # it is in the source tree, and the library has not been built yet # but it would be included on the link line in the version check below Except that on some targets, ".libs" is actually called "_libs". I don't know how to deal with that. -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2010-01-02 19:53:42 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42424