This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch] PR31546 - add --enable-intermodule
- From: Bernhard Fischer <rep dot dot dot nop at gmail dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, rep dot dot dot nop at gmail dot com
- Date: Tue, 30 Oct 2007 20:10:55 +0100
- Subject: Re: [patch] PR31546 - add --enable-intermodule
- References: <20070822205913.GZ11697@aon.at> <46CD2399.4060703@gnu.org>
On Thu, Aug 23, 2007 at 08:05:13AM +0200, Paolo Bonzini wrote:
> Bernhard Fischer wrote:
>> Hi,
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31546#c5
>> add option to build libgfortran and fortran with -combine.
>> This creates a smaller binary and may also create a faster binary. The
>> former is the main motivation from my POV.
>> This is completely optional and is not enabled if you do not configure
>> gcc with '--enable-intermodule'.
>
> The libgfortran part is ok. For the front-end part I would like to see
> code size figures too; since the other front-ends do not support it, I
> would prefer to do it for all-or-none (except Ada of course).
Meanwhile i have switched libgcc too.
The FE parts are a bit irritating -- from my perspective -- How would i
e.g. the fortran FE itself to use --combine?
Specifically (copy'n paste ATM) i'd need(?) to alter the t_files(sp?)
since this doesn't use combine:
Any hints?
TIA,
PS: Please let me know if hinting off a current, real patch is easier
for you.
Index: gcc/fortran/Make-lang.in
===================================================================
--- gcc/fortran/Make-lang.in (revision 129131)
+++ gcc/fortran/Make-lang.in (working copy)
@@ -67,6 +67,8 @@
fortran/trans-intrinsic.o fortran/trans-io.o fortran/trans-openmp.o
\
fortran/trans-stmt.o fortran/trans-types.o
+F95_OBJS-onestep = f951_frontend.o
+
#^L
# Define the names for selecting gfortran in LANGUAGES.
fortran: f951$(exeext)
@@ -90,11 +92,22 @@
-rm -f gfortran-cross$(exeext)
cp gfortran$(exeext) gfortran-cross$(exeext)
+f951_frontend.o: $(F95_OBJS:.o=.c)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -c $(filter %.c,$^) -o $@ -combine
+
# The compiler itself is called f951.
+# Make-lang.in is not generated via configure, so we cannot use @onestep@
+ifeq ($(onestep),)
f951$(exeext): $(F95_OBJS) \
$(BACKEND) $(LIBDEPS) attribs.o
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
$(F95_OBJS) $(BACKEND) $(LIBS) attribs.o
+else
+f951$(exeext): $(F95_OBJS-onestep) \
+ $(BACKEND) $(LIBDEPS) attribs.o
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
+ $(F95_OBJS-onestep) $(BACKEND) $(LIBS) attribs.o
+endif
gt-fortran-trans.h : s-gtype; @true
#^L