[PATCH] Fix IRIX bootstrap failure

Roger Sayle roger@eyesopen.com
Tue Jan 3 23:03:00 GMT 2006


I think I've now managed to analyse the core cause of the
boostrap failure on mips-sgi-irix6.5.  The reason why we're
seeing conflicting type definitions in gstdint.h when
building libgfortran, is because we're probing the system
headers with one set of compiler flags, but compiling the
source code with a different/incompatable set of flags.

On IRIX, the system headers contain #ifdef __c99 guards to
protect the the ISO C99 type definitions.  But the ac_compile
macro probes the system headers with just default options and
many of the tests for the presence of C99 functionality fail:

configure:5452: checking for stdint.h
In file included from conftest.c:52:
/usr/include/stdint.h:5:2: error: #error This header file is to be used
only for c99 mode compilations

But then when building the source code, we specify -std=gnu99 and
end up with a completely different environment (symbol wise) from
the one that we autoconf'd.

The problem is the discrepancy between CFLAGS and AM_CFLAGS.  I
believe the patch below is the correct solution to the problem.

The following patch has been tested with a top-level "make bootstrap",
including fortran, on both mips-sgi-irix6.5 (where it fixes the
bootstrap failure), and i686-pc-linux-gnu (where it does no harm).

Ok for mainline?


2006-01-03  Roger Sayle  <roger@eyesopen.com>

	* configure.ac (CFLAGS): Update to include -std=gnu99 so that
	the configure tests will be run with the same environment as
	used to compile the libgfortran source code.
	* configure: Regenerate.


Index: configure.ac
===================================================================
*** configure.ac	(revision 109225)
--- configure.ac	(working copy)
*************** if test "x$GCC" = "xyes"; then
*** 116,121 ****
--- 116,124 ----
    ## We like to use C99 routines when available.  This makes sure that
    ## __STDC_VERSION__ is set such that libc includes make them available.
    AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
+   ## Compile the following tests with the same system header contents
+   ## that we'll encounter when compiling our own source files.
+   CFLAGS="-std=gnu99 $CFLAGS"
  fi
  AC_SUBST(AM_FCFLAGS)
  AC_SUBST(AM_CFLAGS)


Roger
--




More information about the Gcc-patches mailing list