This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Using object lists for libf2c overflows command line length on AIX.
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: aoliva at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 22 Dec 2001 20:29:00 +0100
- Subject: Using object lists for libf2c overflows command line length on AIX.
Alexandre,
The attached patch, which you applied on December 4th, at 09:53 UTC,
has the unwanted effect of aborting the bootstrap on AIX due to
command line overflow (it probably has a similar effect on other
OS's, but I haven't received complaints yet).
I'd like to revert this patch. However, if you have an idea how
to fix the unwanted behaviour, I want to give you a chance first.
Please supply us with a fix. David Edelsohn can give you more
details about the failure mode on AIX.
Thanks in advance,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
* Makefile.in (AR, RANLIB): Add, for substitutions.
(all-unilib, $(LIBG2C)): Depend on object lists, not
convenience libraries.
(s-libe77): Renamed from libE77.la; build object list.
(install): Do not move libraries to libdir.
(mostlyclean, clean): Adjust.
* libF77/Makefile.in (RANLIB): Add.
(LINK): Remove.
(../s-libf77): Renamed from ../libF77.la; build object list.
(../libfrtbegin.a): Remove target first. Don't use $<.
(all, clean, distclean): Adjust.
* libF77/configure.in: Substitute RANLIB.
* libF77/configure: Rebuilt.
* libI77/Makefile.in (LINK): Delete.
(../s-libi77): Renamed from ../libI77.la; build object list.
(all, clean, distclean): Adjust.
* libU77/Makefile.in: Likewise.
===================================================================
RCS file: /cvs/gcc/egcs/libf2c/libF77/Makefile.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- egcs/libf2c/libF77/Makefile.in 2001/11/25 19:12:50 1.14
+++ egcs/libf2c/libF77/Makefile.in 2001/12/04 09:53:17 1.15
@@ -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-1998 Free Software Foundation, Inc.
+# Portions of this file Copyright (C) 1995-1998, 2001 Free Software Foundation, Inc.
# Contributed by Dave Love (d.love@dl.ac.uk).
#
#This file is part of GNU Fortran.
@@ -38,6 +38,7 @@
CPPFLAGS = @CPPFLAGS@
AR = @AR@
ARFLAGS = rc
+RANLIB = @RANLIB@
@SET_MAKE@
SHELL = /bin/sh
@@ -52,8 +53,6 @@
.c.lo:
@LIBTOOL@ --mode=compile $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $<
-LINK = @LIBTOOL@ --mode=link $(CC) -o $@
-
MISC = F77_aloc.lo VersionF.lo s_rnge.lo abort_.lo getarg_.lo iargc_.lo\
getenv_.lo signal_.lo s_stop.lo s_paus.lo system_.lo cabs.lo\
derf_.lo derfc_.lo erf_.lo erfc_.lo sig_die.lo exit_.lo setarg.lo setsig.lo
@@ -80,10 +79,13 @@
OBJS = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
$(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT)
-all: ../libF77.la ../libfrtbegin.a
+all: ../s-libf77 ../libfrtbegin.a
-../libF77.la: $(OBJS)
- $(LINK) $(OBJS)
+../s-libf77: $(OBJS)
+ -rm -f $@.T $@
+ objs='$(OBJS)'; for name in $$objs; do \
+ echo libF77/$${name} >> $@.T; done
+ mv $@.T $@
Makefile: Makefile.in config.status
$(SHELL) config.status
@@ -104,7 +106,8 @@
$(CC) -c $(ALL_CFLAGS) $(srcdir)/main.c -o $@
../libfrtbegin.a: frtbegin.o
- $(AR) $(ARFLAGS) $@ $<
+ -rm -f $@
+ $(AR) $(ARFLAGS) $@ frtbegin.o
$(RANLIB) $@
F77_aloc.lo: F77_aloc.c
@@ -241,10 +244,10 @@
clean: mostlyclean
rm -f config.log
- rm -f ../libF77.la
+ rm -f ../s-libf77
distclean: clean
- rm -f config.cache config.status Makefile ../libF77.la configure
+ rm -f config.cache config.status Makefile ../s-libf77 configure
maintainer-clean:
===================================================================
RCS file: /cvs/gcc/egcs/libf2c/libI77/Makefile.in,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- egcs/libf2c/libI77/Makefile.in 2001/11/13 00:55:38 1.16
+++ egcs/libf2c/libI77/Makefile.in 2001/12/04 09:53:17 1.17
@@ -51,18 +51,19 @@
.c.lo:
@LIBTOOL@ --mode=compile $(CC) -c -DSkip_f2c_Undefs -DAllow_TYQUAD $(ALL_CFLAGS) $<
-LINK = @LIBTOOL@ --mode=link $(CC) -o $@
-
OBJS = VersionI.lo backspace.lo close.lo dfe.lo dolio.lo due.lo endfile.lo err.lo \
fmt.lo fmtlib.lo iio.lo ilnw.lo inquire.lo lread.lo lwrite.lo open.lo \
rdfmt.lo rewind.lo rsfe.lo rsli.lo rsne.lo sfe.lo sue.lo typesize.lo uio.lo \
util.lo wref.lo wrtfmt.lo wsfe.lo wsle.lo wsne.lo xwsne.lo \
ftell_.lo
-all: ../libI77.la
+all: ../s-libi77
-../libI77.la: $(OBJS)
- $(LINK) $(OBJS)
+../s-libi77: $(OBJS)
+ -rm -f $@.T $@
+ objs='$(OBJS)'; for name in $$objs; do \
+ echo libI77/$${name} >> $@.T; done
+ mv $@.T $@
Makefile: Makefile.in config.status
$(SHELL) config.status
@@ -157,10 +158,10 @@
rm -rf .libs
clean: mostlyclean
- rm -f config.log ../libI77.la
+ rm -f config.log ../s-libi77
distclean: clean
- rm -f config.cache config.status Makefile ../libI77.la configure
+ rm -f config.cache config.status Makefile ../s-libi77 configure
maintainer-clean:
===================================================================
RCS file: /cvs/gcc/egcs/libf2c/libU77/Makefile.in,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- egcs/libf2c/libU77/Makefile.in 2001/11/13 00:55:38 1.18
+++ egcs/libf2c/libU77/Makefile.in 2001/12/04 09:53:18 1.19
@@ -1,5 +1,5 @@
# Makefile for GNU F77 compiler runtime, libc interface.
-# Copyright (C) 1995-1998 Free Software Foundation, Inc.
+# Copyright (C) 1995-1998, 2001 Free Software Foundation, Inc.
# Contributed by Dave Love (d.love@dl.ac.uk).
#
#This file is part of the GNU Fortran libU77 library.
@@ -55,8 +55,6 @@
.c.lo:
@LIBTOOL@ --mode=compile $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $<
-LINK = @LIBTOOL@ --mode=link $(CC) -o $@
-
OBJS = VersionU.lo gerror_.lo perror_.lo ierrno_.lo itime_.lo time_.lo \
unlink_.lo fnum_.lo getpid_.lo getuid_.lo getgid_.lo kill_.lo rand_.lo \
srand_.lo irand_.lo sleep_.lo idate_.lo ctime_.lo etime_.lo \
@@ -78,10 +76,13 @@
umask_.c sys_clock_.c date_.c second_.c flush1_.c mclock_.c \
alarm_.c datetime_.c
-all: ../libU77.la
+all: ../s-libu77
-../libU77.la: $(OBJS)
- $(LINK) $(OBJS)
+../s-libu77: $(OBJS)
+ -rm -f $@.T $@
+ objs='$(OBJS)'; for name in $$objs; do \
+ echo libU77/$${name} >> $@.T; done
+ mv $@.T $@
Makefile: Makefile.in config.status
$(SHELL) config.status
@@ -178,11 +179,11 @@
rm -rf .libs
clean: mostlyclean
- rm -f config.log ../libU77.la
+ rm -f config.log ../s-libu77
distclean: clean
rm -f config.cache config.status Makefile config.h stamp.h \
- ../libU77.la configure
+ ../s-libu77 configure
maintainer-clean:
===================================================================
RCS file: /cvs/gcc/egcs/libf2c/Makefile.in,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- egcs/libf2c/Makefile.in 2001/11/16 21:29:29 1.41
+++ egcs/libf2c/Makefile.in 2001/12/04 09:53:17 1.42
@@ -1,5 +1,5 @@
# Makefile for GNU F77 compiler runtime.
-# Copyright (C) 1995-1998 Free Software Foundation, Inc.
+# Copyright (C) 1995-1998, 2001 Free Software Foundation, Inc.
# Contributed by Dave Love (d.love@dl.ac.uk).
#
#This file is part of GNU Fortran.
@@ -61,6 +61,8 @@
LIBTOOL = @LIBTOOL@
CC = @CC@
CFLAGS = @CFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
# List of variables to pass to sub-makes.
# Quote this way so that it can be used to set shell variables too.
@@ -118,24 +120,34 @@
# meant to be invoked via multi-do for multilibs.
# Its dependencies can be satisfied in parallel. The [fiu]77 targets
-# always invoke sub makes to check dependencies in the subdirs, else we'd
+# update stamp files (object file lists, actually, see the subdir
+# makefiles) on which the $(LIBG2C) depends. The stamp files
+# s-lib[fiu]77 are intentionally not targets, since we're only meant
+# to come in at the level of this target. The [fiu]77 targets always
+# invoke sub makes to check dependencies in the subdirs, else we'd
# have to maintain them at this level; we live with the overhead of
# some recursive makes which may do nothing.
-all-unilib: i77 f77 u77 libE77.la
+all-unilib: i77 f77 u77 s-libe77
$(MAKE) $(FLAGS_TO_PASS) $(LIBG2C)
i77 f77 u77: g2c.h
# This target should normally only get invoked via `all-unilib' --
# after all's well in the subdirs -- actually to assemble the library.
+# The stamp files contain the object lists of each component of the
+# library. The point of breaking them up is to avoid command-line
+# length limitations.
-$(LIBG2C): libF77.la libI77.la libU77.la libE77.la
- rm -f $@ ;\
- set -e; \
+$(LIBG2C): s-libi77 s-libf77 s-libu77 s-libe77
$(LIBTOOL) --mode=link $(CC) -o $@ \
-version-info $(VERSION_MAJOR):$(VERSION_MINOR):$(VERSION_SUB) \
- -rpath $(prefix)/lib libE77.la libF77.la libI77.la libU77.la -lc -lm
+ -rpath $(prefix)/lib \
+ -objectlist s-libe77 \
+ -objectlist s-libf77 \
+ -objectlist s-libi77 \
+ -objectlist s-libu77 \
+ -lc -lm
i77:
cd libI77; $(MAKE) $(FLAGS_TO_PASS) all
@@ -146,18 +158,19 @@
u77:
cd libU77; $(MAKE) $(FLAGS_TO_PASS) all
-libE77.la: f2cext.c
- rm -f $@
+s-libe77: f2cext.c
if [ -d libE77 ]; then rm -f libE77/*.o libE77/*.lo; else mkdir libE77; fi
+ -rm -f $@.T $@
for name in $(F2CEXT); \
do \
echo $${name}; \
$(LIBTOOL) --mode=compile $(CC) -c -I. -I$(srcdir) -I../../include \
$(CPPFLAGS) $(CFLAGS) -DL$${name} $(srcdir)/f2cext.c \
- -o libE77/L$${name}.o ; \
+ -o libE77/L$${name}.lo ; \
if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+ echo libE77/L$${name}.lo >> $@.T; \
done
- $(LIBTOOL) --mode=link $(CC) -o libE77.la libE77/*.lo
+ mv $@.T $@
f2cext.c: g2c.h
@@ -192,7 +205,6 @@
install: all
$(LIBTOOL) --mode=install $(INSTALL_DATA) $(LIBG2C) $(libsubdir)/$(MULTISUBDIR)
- (cd $(libsubdir)/$(MULTISUBDIR) ; mv -f $(LIBG2C_BASE).* $(prefix)/lib)
$(INSTALL_DATA) libfrtbegin.a $(libsubdir)/$(MULTISUBDIR)
$(RANLIB) $(libsubdir)/$(MULTISUBDIR)/libfrtbegin.a
$(INSTALL_DATA) g2c.h $(libsubdir)/include/g2c.h
@@ -220,7 +232,7 @@
rm -f $(LIBG2C) objlist
$(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
$(MULTICLEAN) multi-clean DO=$@
- rm -fr libE77 libE77.la
+ rm -fr libE77 s-libe77
clean: mostlyclean
rm -f config.log
@@ -229,7 +241,7 @@
rm -rf .libs
distclean: clean
- rm -f g2c.h libE77.la
+ rm -f g2c.h s-libe77
$(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
$(MULTICLEAN) multi-clean DO=distclean
rm -f config.cache config.status Makefile
===================================================================
RCS file: /cvs/gcc/egcs/libf2c/libF77/configure.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- egcs/libf2c/libF77/configure.in 2001/09/30 22:06:22 1.5
+++ egcs/libf2c/libF77/configure.in 2001/12/04 09:53:17 1.6
@@ -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.
@@ -37,6 +37,11 @@
test "$AR" || AR=ar
AC_SUBST(AR)
+if test "$RANLIB"; then :
+ AC_SUBST(RANLIB)
+else
+ AC_PROG_RANLIB
+fi
AC_PROG_MAKE_SET
dnl Checks for libraries.