This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix bootstrap failure (both branches) with libI77/endfile for glibc 2.2.2 systems
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: Fix bootstrap failure (both branches) with libI77/endfile for glibc 2.2.2 systems
- From: Andreas Jaeger <aj at suse dot de>
- Date: 16 May 2001 09:30:25 +0200
- Cc: <ljrittle at acm dot org>, gcc-patches at gcc dot gnu dot org
- References: <u8r8xpbxzn.fsf@gromit.moeb><or66f1srws.fsf@guarana.lsd.ic.unicamp.br>
Alexandre Oliva <aoliva@redhat.com> writes:
> On May 16, 2001, Andreas Jaeger <aj@suse.de> wrote:
>
> > I've used the following patch to get this working. Please advise
> > whether I should commit this to branch and mainline or whether you see
> > a superior solution.
>
> I'd rather have a test for off_t, and fallback to long if it isn't
> available. There's no guarantee that _GNU_SOURCE will introduce
> off_t, after all.
Autoconf contains the AC_TYPE_OFF_T macro for testing this but then we
also need a config.h file in libI77.
Looking at the configure script I see that the test include
<sys/types.h> - and that's the right place to get off_t. We include
<sys/types.h> already in a number of files in libI77.
Here's a patch, what do you think?
Ok to commit on both branches after a full bootstrap passes (I just
verified that it works for the problematic file)?
Andreas
2001-05-16 Andreas Jaeger <aj@suse.de>
* libI77/Makefile.in (endfile.o): Add dependency on config.h.
* libI77/endfile.c: Include config.h and sys/types for off_t.
* libI77/config.h.in: New file.
* libI77/configure.in: Add test for off_t, create config.h file.
* libI77/configure: Regenerated.
============================================================
Index: libf2c/libI77/endfile.c
--- libf2c/libI77/endfile.c 2001/05/15 21:24:41 1.6
+++ libf2c/libI77/endfile.c 2001/05/16 07:28:31
@@ -1,6 +1,8 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
+#include <sys/types.h>
#include <unistd.h>
#ifdef KR_headers
============================================================
Index: libf2c/libI77/configure.in
--- libf2c/libI77/configure.in 2001/02/26 20:23:41 1.5
+++ libf2c/libI77/configure.in 2001/05/16 07:28:32
@@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1995, 1997, 1998, 2001 Free Software Foundation, Inc.
# Contributed by Dave Love (d.love@dl.ac.uk).
#
#This file is part of GNU Fortran.
@@ -21,6 +21,7 @@
AC_PREREQ(2.12.1)
AC_INIT(ftell_.c)
+AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
@@ -192,6 +193,8 @@
# This EOF_CHAR is a misfeature on unix.
AC_DEFINE(NO_EOF_CHAR_CHECK)
+
+AC_TYPE_OFF_T
AC_DEFINE(Skip_f2c_Undefs)
============================================================
Index: libf2c/libI77/config.h.in
--- libf2c/libI77/config.h.in created
+++ libf2c/libI77/config.h.in Wed May 16 09:20:14 2001 1.1
@@ -0,0 +1,3 @@
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
============================================================
Index: libf2c/libI77/Makefile.in
--- libf2c/libI77/Makefile.in 1999/03/06 00:02:53 1.6
+++ libf2c/libI77/Makefile.in 2001/05/16 07:30:08
@@ -1,7 +1,7 @@
# Makefile for GNU F77 compiler runtime.
# Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the
# file `Notice').
-# Portions of this file Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
+# Portions of this file Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc.
# Contributed by Dave Love (d.love@dl.ac.uk).
#
#This file is part of GNU Fortran.
@@ -90,7 +90,7 @@
dfe.o: dfe.c fmt.h
dolio.o: dolio.c
due.o: due.c fio.h
-endfile.o: endfile.c fio.h rawio.h
+endfile.o: endfile.c fio.h rawio.h config.h
err.o: err.c fio.h rawio.h
fmt.o: fio.h
fmt.o: fmt.c fmt.h
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj