Bug 38014 - [4.4 Regression] in-tree gmp and mpfr libraries no longer work
Summary: [4.4 Regression] in-tree gmp and mpfr libraries no longer work
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.4.0
: P2 normal
Target Milestone: 4.4.0
Assignee: Daniel Jacobowitz
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2008-11-04 22:02 UTC by Ian Lance Taylor
Modified: 2008-11-14 15:37 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Lance Taylor 2008-11-04 22:02:02 UTC
In gcc 4.3, you can unpack the gmp and mpfr libraries into your source tree, and gcc will build, even if gmp and mpfr are not installed on the host system.  That appears to be broken in mainline as of 2008-10-22.  The problem is that the top level configury passes --with-gmp-build when configuring mpfr.  The mpfr library records that in its Makefile using CPPFLAGS.  Now the top level Makefile overrides CPPFLAGS.  The effect:

make[4]: Entering directory `/home/jingyu/projects/gcc/obj-gcc-i686/mpfr'
/bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_INTTYPES_H=1
-DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1
-DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1
-DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1
-DHAVE_LDOUBLE_IEEE_EXT_LITTLE=1 -DHAVE_ATTRIBUTE_MODE=1
-DHAVE_ALLOCA_H=1 -I. -I../../gcc_src/mpfr     -g
-fkeep-inline-functions -MT exceptions.lo -MD -MP -MF
.deps/exceptions.Tpo -c -o exceptions.lo
../../gcc_src/mpfr/exceptions.c
 gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1
-DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1
-DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1
-DHAVE_CEIL=1 -DHAVE_LDOUBLE_IEEE_EXT_LITTLE=1 -DHAVE_ATTRIBUTE_MODE=1
-DHAVE_ALLOCA_H=1 -I. -I../../gcc_src/mpfr -g -fkeep-inline-functions
-MT exceptions.lo -MD -MP -MF .deps/exceptions.Tpo -c
../../gcc_src/mpfr/exceptions.c -o exceptions.o
In file included from ../../gcc_src/mpfr/exceptions.c:23:
../../gcc_src/mpfr/mpfr-impl.h:74:19: error: gmp.h: No such file or directory
In file included from ../../gcc_src/mpfr/mpfr-impl.h:77,
                 from ../../gcc_src/mpfr/exceptions.c:23:
../../gcc_src/mpfr/mpfr.h:39:18: error: gmp.h: No such file or directory
Comment 1 Hans-Peter Nilsson 2008-11-04 22:15:34 UTC
Is something missing from the description?
In-tree gmp and mpfr seems to work for me as of r141574, for cris-elf, on a Fedora 8 system.
Dunno if it matters that there's also:
mpfr-2.3.0-1.fc8
gmp-4.2.2-4.fc8
gmp-4.2.2-4.fc8
package mpfr-devel is not installed
gmp-devel-4.2.2-4.fc8
gmp-devel-4.2.2-4.fc8

Maybe you configured with a relative configure-path, or is it the nativeness of your build?
grep exception.c build-log gives
ARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_LDOUBLE_IEEE_EXT_LITTLE=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I/tmp/hpautotest-gcc1/gcc/mpfr     -g -O2 -MT exceptions.lo -MD -MP -MF ".deps/exceptions.Tpo" -c -o exceptions.lo /tmp/hpautotest-gcc1/gcc/mpfr/exceptions.c; \
 gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_LDOUBLE_IEEE_EXT_LITTLE=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I/tmp/hpautotest-gcc1/gcc/mpfr -g -O2 -MT exceptions.lo -MD -MP -MF .deps/exceptions.Tpo -c /tmp/hpautotest-gcc1/gcc/mpfr/exceptions.c -o exceptions.o
if gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_LDOUBLE_IEEE_EXT_LITTLE=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I/tmp/hpautotest-gcc1/gcc/mpfr/tests -I/tmp/hpautotest-gcc1/gcc/mpfr -I..    -g -O2 -MT texceptions.o -MD -MP -MF ".deps/texceptions.Tpo" -c -o texceptions.o /tmp/hpautotest-gcc1/gcc/mpfr/tests/texceptions.c; \
Comment 2 davidxl 2008-11-05 01:26:17 UTC
The problem reproduces for me -- for both i686 native 32 bit compiler build and x86_64 cross compiler build.

David
Comment 3 Ian Lance Taylor 2008-11-05 06:58:17 UTC
hp: It will work if gmp is installed on the system.  The problem is that mpfr can't find gmp.h.  If gmp is installed, then it can, and everything works.
Comment 4 Daniel Jacobowitz 2008-11-14 14:53:02 UTC
Subject: Bug 38014

Author: drow
Date: Fri Nov 14 14:51:38 2008
New Revision: 141859

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141859
Log:
	PR bootstrap/38014
	PR bootstrap/37923

	Revert:

	2008-10-24  Daniel Jacobowitz  <dan@codesourcery.com>

	* Makefile.tpl (HOST_EXPORTS): Correct CPPFLAGS typo.
	* Makefile.in: Regenerated.

	2008-10-22  Daniel Jacobowitz  <dan@codesourcery.com>

	* Makefile.def (flags_to_pass): Add CPPFLAGS_FOR_BUILD and CPPFLAGS.
	* Makefile.tpl (BUILD_EXPORTS): Set CPPFLAGS.
	(EXTRA_BUILD_FLAGS): Correct typo.  Pass CPPFLAGS.
	(HOST_EXPORTS): Pass CPPFLAGS.
	(CPPFLAGS_FOR_BUILD, CPPFLAGS, CPPFLAGS_FOR_TARGET): Define.
	(LDFLAGS_FOR_TARGET): Initialize from configure script.
	(EXTRA_TARGET_FLAGS): Set CPPFLAGS.
	* Makefile.in, configure: Regenerated.
	* configure.ac: Set CPPFLAGS_FOR_TARGET, LDFLAGS_FOR_TARGET,
	and CPPFLAGS_FOR_BUILD.

Modified:
    trunk/ChangeLog
    trunk/Makefile.def
    trunk/Makefile.in
    trunk/Makefile.tpl
    trunk/configure
    trunk/configure.ac

Comment 5 Daniel Jacobowitz 2008-11-14 15:37:54 UTC
Patches reverted.  This is really a bug in gmp/mpfr/intl, but no point triggering it.