[patch] PR31546 - add --enable-intermodule
Bernhard Fischer
rep.dot.nop@gmail.com
Tue Oct 30 19:11:00 GMT 2007
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
More information about the Fortran
mailing list