summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gcc/f/install.texi
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/gcc/f/install.texi')
-rw-r--r--gnu/usr.bin/gcc/f/install.texi797
1 files changed, 278 insertions, 519 deletions
diff --git a/gnu/usr.bin/gcc/f/install.texi b/gnu/usr.bin/gcc/f/install.texi
index 04e498517e6..08ee8003ffc 100644
--- a/gnu/usr.bin/gcc/f/install.texi
+++ b/gnu/usr.bin/gcc/f/install.texi
@@ -1,11 +1,11 @@
-@c Copyright (C) 1995-1997 Free Software Foundation, Inc.
+@c Copyright (C) 1995, 1996 Free Software Foundation, Inc.
@c This is part of the G77 manual.
@c For copying conditions, see the file g77.texi.
@c The text of this file appears in the file INSTALL
@c in the G77 distribution, as well as in the G77 manual.
-@c 1997-02-25
+@c 1996-12-01
@ifclear INSTALLONLY
@node Installation
@@ -13,6 +13,15 @@
@end ifclear
@cindex installing GNU Fortran
+@menu
+* Prerequisites:: Make sure your system is ready for @code{g77}.
+* Problems Installing:: Known trouble areas.
+* Quick Start:: The easier procedure for non-experts.
+* Complete Installation:: For experts, or those who want to be: the details.
+* Distributing Binaries:: If you plan on distributing your @code{g77}.
+* Settings:: Some notes on @code{g77} internals.
+@end menu
+
The following information describes how to install @code{g77}.
The information in this file generally pertains to dealing
@@ -27,15 +36,6 @@ Nevertheless, efforts to make @code{g77} easier to both build
and install from source and package up as a binary distribution
are ongoing.
-@menu
-* Prerequisites:: Make sure your system is ready for @code{g77}.
-* Problems Installing:: Known trouble areas.
-* Settings:: Changing @code{g77} internals before building.
-* Quick Start:: The easier procedure for non-experts.
-* Complete Installation:: For experts, or those who want to be: the details.
-* Distributing Binaries:: If you plan on distributing your @code{g77}.
-@end menu
-
@node Prerequisites
@section Prerequisites
@cindex prerequisites
@@ -61,15 +61,15 @@ There are GNU versions of all these available---in fact,
a complete GNU UNIX system can be put together on
most systems, if desired.
-@item @file{gcc-2.7.2.2.tar.gz}
+@item @file{gcc-2.7.2.tar.gz}
You need to have this, or some other applicable, version
of @code{gcc} on your system.
The version should be an exact copy of a distribution
from the FSF.
It is approximately 7MB large.
-If you've already unpacked @file{gcc-2.7.2.2.tar.gz} into a
-directory (named @file{gcc-2.7.2.2}) called the @dfn{source tree}
+If you've already unpacked @file{gcc-2.7.2.tar.gz} into a
+directory (named @file{gcc-2.7.2}) called the @dfn{source tree}
for @code{gcc}, you can delete the distribution
itself, but you'll need to remember to skip any instructions to unpack
this distribution.
@@ -78,7 +78,7 @@ Without an applicable @code{gcc} source tree, you cannot
build @code{g77}.
You can obtain an FSF distribution of @code{gcc} from the FSF.
-@item @file{g77-0.5.20.tar.gz}
+@item @file{g77-0.5.19.tar.gz}
You probably have already unpacked this distribution,
or you are reading an advanced copy of this manual,
which is contained in this distribution.
@@ -187,79 +187,15 @@ either @code{gcc} or @code{g77}.
@node General Problems
@subsection General Problems
-These problems can occur on most or all systems.
-
-@menu
-* GNU C Required:: Why even ANSI C is not enough.
-* Patching GNU CC Necessary:: Why @code{gcc} must be patched first.
-* Building GNU CC Necessary:: Why you can't build @emph{just} Fortran.
-* Missing strtoul:: If linking @code{f771} fails due to an
- unresolved reference to @code{strtoul}.
-* Object File Differences:: It's okay that @samp{make compare} will
- flag @file{f/zzz.o}.
-* Cleanup Kills Stage Directories:: A minor nit for @code{g77} developers.
-@end menu
-
-@node GNU C Required
-@subsubsection GNU C Required
-@cindex GNU C required
-@cindex requirements, GNU C
-
-Compiling @code{g77} requires GNU C, not just ANSI C.
-Fixing this wouldn't
-be very hard (just tedious), but the code using GNU extensions to
-the C language is expected to be rewritten for 0.6 anyway,
-so there are no plans for an interim fix.
-
-This requirement does not mean you must already have @code{gcc}
-installed to build @code{g77}.
-As long as you have a working C compiler, you can use a
-bootstrap build to automate the process of first building
-@code{gcc} using the working C compiler you have, then building
-@code{g77} and rebuilding @code{gcc} using that just-built @code{gcc},
-and so on.
-
-@node Patching GNU CC Necessary
-@subsubsection Patching GNU CC Necessary
-@cindex patch files
-@cindex GBE
-
-@code{g77} currently requires application of a patch file to the gcc compiler
-tree.
-The necessary patches should be folded in to the mainline gcc distribution.
-
-Some combinations
-of versions of @code{g77} and @code{gcc} might actually @emph{require} no
-patches, but the patch files will be provided anyway as long as
-there are more changes expected in subsequent releases.
-These patch files might contain
-unnecessary, but possibly helpful, patches.
-As a result, it is possible this issue might never be
-resolved, except by eliminating the need for the person
-configuring @code{g77} to apply a patch by hand, by going
-to a more automated approach (such as configure-time patching).
-
-@node Building GNU CC Necessary
-@subsubsection Building GNU CC Necessary
-@cindex gcc, building
-@cindex building gcc
-
-It should be possible to build the runtime without building @code{cc1}
-and other non-Fortran items, but, for now, an easy way to do that
-is not yet established.
-
-@node Missing strtoul
-@subsubsection Missing strtoul
-@cindex strtoul
+@itemize @bullet
+@item
@cindex _strtoul
@cindex undefined reference (_strtoul)
@cindex f771, linking error for
@cindex linking error for f771
@cindex ld error for f771
@cindex ld can't find _strtoul
-@cindex SunOS4
-
-On SunOS4 systems, linking the @code{f771} program produces
+On SunOS systems, linking the @code{f771} program produces
an error message concerning an undefined symbol named
@samp{_strtoul}.
@@ -281,45 +217,60 @@ that appeared to have conforming ANSI C environments, and it
was decided that, lacking resources to more fully investigate
the problem, it was better to not punish users of those systems
either by requiring them to work around the problem by hand or
-by always substituting an incomplete @code{strtoul()} implementation
+by always substituting an incomplete @samp{strtoul()} implementation
when their systems had a complete, working one.
Unfortunately, this meant inconveniencing users of systems not
-having @code{strtoul()}, but they're using obsolete (and generally
+having @samp{strtoul()}, but they're using obsolete (and generally
unsupported) systems anyway.
-@node Object File Differences
-@subsubsection Object File Differences
-@cindex zzz.o
-@cindex zzz.c
-@cindex object file, differences
-@cindex differences between object files
-@cindex make compare
-
-A comparison of object files after building Stage 3 during a
-bootstrap build will result in @file{gcc/f/zzz.o} being flagged
-as different from the Stage 2 version.
-That is because it
-contains a string with an expansion of the @code{__TIME__} macro,
-which expands to the current time of day.
-It is nothing to worry about, since
-@file{gcc/f/zzz.c} doesn't contain any actual code.
-It does allow you to override its use of @code{__DATE__} and
-@code{__TIME__} by defining macros for the compilation---see the
-source code for details.
-
-@node Cleanup Kills Stage Directories
-@subsubsection Cleanup Kills Stage Directories
-@cindex stage directories
-@cindex make clean
-
+@item
It'd be helpful if @code{g77}'s @file{Makefile.in} or @file{Make-lang.in}
would create the various @file{stage@var{n}} directories and their
-subdirectories, so developers and expert installers wouldn't have to
-reconfigure after cleaning up.
+subdirectories, so expert installers wouldn't have to reconfigure
+after cleaning up.
+
+@item
+Improvements to the way @code{libf2c} is built could make
+building @code{g77} as a cross-compiler easier---for example,
+passing and using @samp{LD} and @samp{AR} in the appropriate
+ways.
+
+@cindex patch files
+@cindex GBE
+@item
+@code{g77} currently requires application of a patch file to the gcc compiler
+tree.
+The necessary patches should be folded in to the mainline gcc distribution.
+
+Some combinations
+of versions of @code{g77} and @code{gcc} might actually @emph{require} no
+patches, but the patch files will be provided anyway as long as
+there are more changes expected in subsequent releases.
+These patch files might contain
+unnecessary, but possibly helpful, patches.
+As a result, it is possible this issue might never be
+resolved, except by eliminating the need for the person
+configuring @code{g77} to apply a patch by hand, by going
+to a more automated approach (such as configure-time patching).
+
+@item
+It should be possible to build the runtime without building @code{cc1}
+and other non-Fortran items, but, for now, an easy way to do that
+is not yet established.
+
+@cindex GNU C required
+@cindex requirements, GNU C
+@item
+Compiling @code{g77} requires GNU C, not just ANSI C.
+Fixing this wouldn't
+be very hard (just tedious), but the code using GNU extensions to
+the C language is expected to be rewritten for 0.6 anyway,
+so there are no plans for an interim fix.
+@end itemize
@node Cross-compiler Problems
@subsection Cross-compiler Problems
-@cindex cross-compiler, problems
+@cindex cross-compilation
@code{g77} has been in alpha testing since September of
1992, and in public beta testing since February of 1995.
@@ -361,12 +312,6 @@ For example, it might not know how to handle floating-point
constants.
@item
-Improvements to the way @code{libf2c} is built could make
-building @code{g77} as a cross-compiler easier---for example,
-passing and using @samp{LD} and @samp{AR} in the appropriate
-ways.
-
-@item
There are still some challenges putting together the right
run-time libraries (needed by @code{libf2c}) for a target
system, depending on the systems involved in the configuration.
@@ -374,235 +319,6 @@ system, depending on the systems involved in the configuration.
@code{gcc} in particular.)
@end itemize
-@node Settings
-@section Changing Settings Before Building
-
-Here are some internal @code{g77} settings that can be changed
-by editing source files in @file{gcc/f/} before building.
-
-This information, and perhaps even these settings, represent
-stop-gap solutions to problems people doing various ports
-of @code{g77} have encountered.
-As such, none of the following information is expected to
-be pertinent in future versions of @code{g77}.
-
-@menu
-* Larger File Unit Numbers:: Raising @samp{MXUNIT}.
-* Always Flush Output:: Synchronizing write errors.
-* Maximum Stackable Size:: Large arrays are forced off the stack frame.
-* Floating-point Bit Patterns:: Possible programs building cross-compiler.
-* Large Initialization:: Large arrays with @code{DATA} initialization.
-* Alpha Problems Fixed:: Problems 64-bit systems like Alphas now fixed?
-@end menu
-
-@node Larger File Unit Numbers
-@subsection Larger File Unit Numbers
-@cindex MXUNIT
-@cindex unit numbers
-@cindex maximum unit number
-@cindex illegal unit number
-@cindex increasing maximum unit number
-
-As distributed, whether as part of @code{f2c} or @code{g77},
-@code{libf2c} accepts file unit numbers only in the range
-0 through 99.
-For example, a statement such as @samp{WRITE (UNIT=100)} causes
-a run-time crash in @code{libf2c}, because the unit number,
-100, is out of range.
-
-If you know that Fortran programs at your installation require
-the use of unit numbers higher than 99, you can change the
-value of the @samp{MXUNIT} macro, which represents the maximum unit
-number, to an appropriately higher value.
-
-To do this, edit the file @file{f/runtime/libI77/fio.h} in your
-@code{g77} source tree, changing the following line:
-
-@example
-#define MXUNIT 100
-@end example
-
-Change the line so that the value of @samp{MXUNIT} is defined to be
-at least one @emph{greater} than the maximum unit number used by
-the Fortran programs on your system.
-
-(For example, a program that does @samp{WRITE (UNIT=255)} would require
-@samp{MXUNIT} set to at least 256 to avoid crashing.)
-
-Then build or rebuild @code{g77} as appropriate.
-
-@emph{Note:} Changing this macro has @emph{no} effect on other limits
-your system might place on the number of files open at the same time.
-That is, the macro might allow a program to do @samp{WRITE (UNIT=100)},
-but the library and operating system underlying @code{libf2c} might
-disallow it if many other files have already been opened (via @code{OPEN} or
-implicitly via @code{READ}, @code{WRITE}, and so on).
-Information on how to increase these other limits should be found
-in your system's documentation.
-
-@node Always Flush Output
-@subsection Always Flush Output
-@cindex ALWAYS_FLUSH
-@cindex synchronous write errors
-@cindex disk full
-@cindex flushing output
-@cindex fflush()
-@cindex I/O, flushing
-@cindex output, flushing
-@cindex writes, flushing
-@cindex NFS
-@cindex network file system
-
-Some Fortran programs require output
-(writes) to be flushed to the operating system (under UNIX,
-via the @code{fflush()} library call) so that errors,
-such as disk full, are immediately flagged via the relevant
-@code{ERR=} and @code{IOSTAT=} mechanism, instead of such
-errors being flagged later as subsequent writes occur, forcing
-the previously written data to disk, or when the file is
-closed.
-
-Essentially, the difference can be viewed as synchronous error
-reporting (immediate flagging of errors during writes) versus
-asynchronous, or, more precisely, buffered error reporting
-(detection of errors might be delayed).
-
-@code{libf2c} supports flagging write errors immediately when
-it is built with the @samp{ALWAYS_FLUSH} macro defined.
-This results in a @code{libf2c} that runs slower, sometimes
-quite a bit slower, under certain circumstances---for example,
-accessing files via the networked file system NFS---but the
-effect can be more reliable, robust file I/O.
-
-If you know that Fortran programs requiring this level of precision
-of error reporting are to be compiled using the
-version of @code{g77} you are building, you might wish to
-modify the @code{g77} source tree so that the version of
-@code{libf2c} is built with the @samp{ALWAYS_FLUSH} macro
-defined, enabling this behavior.
-
-To do this, find this line in @file{f/runtime/configure.in} in
-your @code{g77} source tree:
-
-@example
-dnl AC_DEFINE(ALWAYS_FLUSH)
-@end example
-
-Remove the leading @samp{dnl@w{ }}, so the line begins with
-@samp{AC_DEFINE(}, and run @code{autoconf} in that file's directory.
-(Or, if you don't have @code{autoconf}, you can modify @file{f2c.h.in}
-in the same directory to include the line @samp{#define ALWAYS_FLUSH}
-after @samp{#define F2C_INCLUDE}.)
-
-Then build or rebuild @code{g77} as appropriate.
-
-@node Maximum Stackable Size
-@subsection Maximum Stackable Size
-@vindex FFECOM_sizeMAXSTACKITEM
-@cindex code, stack variables
-@cindex maximum stackable size
-@cindex stack allocation
-@cindex segmentation violation
-@code{g77}, on most machines, puts many variables and arrays on the stack
-where possible, and can be configured (by changing
-@samp{FFECOM_sizeMAXSTACKITEM} in @file{gcc/f/com.c}) to force
-smaller-sized entities into static storage (saving
-on stack space) or permit larger-sized entities to be put on the
-stack (which can improve run-time performance, as it presents
-more opportunities for the GBE to optimize the generated code).
-
-@emph{Note:} Putting more variables and arrays on the stack
-might cause problems due to system-dependent limits on stack size.
-Also, the value of @samp{FFECOM_sizeMAXSTACKITEM} has no
-effect on automatic variables and arrays.
-@xref{But-bugs}, for more information.
-
-@node Floating-point Bit Patterns
-@subsection Floating-point Bit Patterns
-
-@cindex cross-compiler, building
-@cindex floating-point bit patterns
-@cindex bit patterns
-The @code{g77} build will crash if an attempt is made to build
-it as a cross-compiler
-for a target when @code{g77} cannot reliably determine the bit pattern of
-floating-point constants for the target.
-Planned improvements for g77-0.6
-will give it the capabilities it needs to not have to crash the build
-but rather generate correct code for the target.
-(Currently, @code{g77}
-would generate bad code under such circumstances if it didn't crash
-during the build, e.g. when compiling a source file that does
-something like @samp{EQUIVALENCE (I,R)} and @samp{DATA R/9.43578/}.)
-
-@node Large Initialization
-@subsection Initialization of Large Aggregate Areas
-
-@cindex speed, compiler
-@cindex slow compiler
-@cindex memory utilization
-@cindex large initialization
-@cindex aggregate initialization
-A warning message is issued when @code{g77} sees code that provides
-initial values (e.g. via @code{DATA}) to an aggregate area (@code{COMMON}
-or @code{EQUIVALENCE}, or even a large enough array or @code{CHARACTER}
-variable)
-that is large enough to increase @code{g77}'s compile time by roughly
-a factor of 10.
-
-This size currently is quite small, since @code{g77}
-currently has a known bug requiring too much memory
-and time to handle such cases.
-In @file{gcc/f/data.c}, the macro
-@samp{FFEDATA_sizeTOO_BIG_INIT_} is defined
-to the minimum size for the warning to appear.
-The size is specified in storage units,
-which can be bytes, words, or whatever, on a case-by-case basis.
-
-After changing this macro definition, you must
-(of course) rebuild and reinstall @code{g77} for
-the change to take effect.
-
-Note that, as of version 0.5.18, improvements have
-reduced the scope of the problem for @emph{sparse}
-initialization of large arrays, especially those
-with large, contiguous uninitialized areas.
-However, the warning is issued at a point prior to
-when @code{g77} knows whether the initialization is sparse,
-and delaying the warning could mean it is produced
-too late to be helpful.
-
-Therefore, the macro definition should not be adjusted to
-reflect sparse cases.
-Instead, adjust it to generate the warning when densely
-initialized arrays begin to cause responses noticeably slower
-than linear performance would suggest.
-
-@node Alpha Problems Fixed
-@subsection Alpha Problems Fixed
-
-@cindex Alpha, support
-@cindex 64-bit systems
-@code{g77} used to warn when it was used to compile Fortran code
-for a target configuration that is not basically a 32-bit
-machine (such as an Alpha, which is a 64-bit machine, especially
-if it has a 64-bit operating system running on it).
-That was because @code{g77} was known to not work
-properly on such configurations.
-
-As of version 0.5.20, @code{g77} is believed to work well
-enough on such systems.
-So, the warning is no longer needed or provided.
-
-However, support for 64-bit systems, especially in
-areas such as cross-compilation and handling of
-intrinsics, is still incomplete.
-The symptoms
-are believed to be compile-time diagnostics rather
-than the generation of bad code.
-It is hoped that version 0.6 will completely support 64-bit
-systems.
-
@node Quick Start
@section Quick Start
@cindex quick start
@@ -629,18 +345,10 @@ already reside in @file{/usr/FSF}, a naming convention
used by the author of @code{g77} on his own system:
@example
-/usr/FSF/gcc-2.7.2.2.tar.gz
-/usr/FSF/g77-0.5.20.tar.gz
+/usr/FSF/gcc-2.7.2.tar.gz
+/usr/FSF/g77-0.5.19.tar.gz
@end example
-@c (You can use @file{gcc-2.7.2.1.tar.gz} instead, or
-@c the equivalent of it obtained by applying the
-@c patch distributed as @file{gcc-2.7.2-2.7.2.1.diff.gz}
-@c to version 2.7.2 of @code{gcc},
-@c if you remember to make the appropriate adjustments in the
-@c instructions below.)
-
-@cindex SunOS4
Users of the following systems should not blindly follow
these quick-start instructions, because of problems their
systems have coping with straightforward installation of
@@ -648,7 +356,9 @@ systems have coping with straightforward installation of
@itemize @bullet
@item
-SunOS4
+SunOS
+@item
+Alpha
@end itemize
Instead, see @ref{Complete Installation}, for detailed information
@@ -671,49 +381,49 @@ These explanations follow this list of steps.
@example
sh[ 1]# @kbd{cd /usr/src}
@set source-dir 1
-sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-2.7.2.2.tar.gz | tar xf -}
-[Might say "Broken pipe"...that is normal on some systems.]
+sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-2.7.2.tar.gz | tar xf -}
@set unpack-gcc 2
-sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-0.5.20.tar.gz | tar xf -}
-["Broken pipe" again possible.]
+[Might say "Broken pipe"...that is normal on some systems.]
+sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-0.5.19.tar.gz | tar xf -}
@set unpack-g77 3
-sh[ 4]# @kbd{ln -s gcc-2.7.2.2 gcc}
+["Broken pipe" again possible.]
+sh[ 4]# @kbd{ln -s gcc-2.7.2 gcc}
@set link-gcc 4
-sh[ 5]# @kbd{ln -s g77-0.5.20 g77}
+sh[ 5]# @kbd{ln -s g77-0.5.19 g77}
@set link-g77 5
sh[ 6]# @kbd{mv -i g77/* gcc}
-[No questions should be asked by mv here; or, you made a mistake.]
@set merge-g77 6
-sh[ 7]# @kbd{patch -p1 -V t -d gcc < gcc/f/gbe/2.7.2.2.diff}
-[Unless patch complains about rejected patches, this step worked.]
+[No questions should be asked by mv here; or, you made a mistake.]
+sh[ 7]# @kbd{patch -p1 -V t -d gcc-2.7.2 < gcc-2.7.2/f/gbe/2.7.2.diff}
@set apply-patch 7
+[Unless patch complains about rejected patches, this step worked.]
sh[ 8]# @kbd{cd gcc}
sh[ 9]# @kbd{touch f77-install-ok}
+@set f77-install-ok 9
[Do not do the above if your system already has an f77
command, unless you've checked that overwriting it
is okay.]
-@set f77-install-ok 9
sh[10]# @kbd{touch f2c-install-ok}
+@set f2c-install-ok 10
[Do not do the above if your system already has an f2c
command, unless you've checked that overwriting it
is okay. Else, @kbd{touch f2c-exists-ok}.]
-@set f2c-install-ok 10
sh[11]# @kbd{./configure --prefix=/usr}
+@set configure-gcc 11
[Do not do the above if gcc is not installed in /usr/bin.
You might need a different @kbd{--prefix=@dots{}}, as
described below.]
-@set configure-gcc 11
sh[12]# @kbd{make bootstrap}
-[This takes a long time, and is where most problems occur.]
@set build-gcc 12
+[This takes a long time, and is where most problems occur.]
sh[13]# @kbd{rm -fr stage1}
@set rm-stage1 13
sh[14]# @kbd{make -k install}
-[The actual installation.]
@set install-g77 14
+[The actual installation.]
sh[15]# @kbd{g77 -v}
-[Verify that g77 is installed, obtain version info.]
@set show-version 15
+[Verify that g77 is installed, obtain version info.]
sh[16]#
@set end-procedure 16
@end example
@@ -733,37 +443,26 @@ By convention, this manual assumes @file{/usr/src}.
It might be helpful if other users on your system
knew where to look for the source code for the
installed version of @code{g77} and @code{gcc} in any case.
-
+@c
@c @item Step @value{unpack-gcc}: @kbd{gunzip -d @dots{}}
-@c Here, you might wish to use @file{gcc-2.7.2.1.tar.gz}
-@c instead, or apply @file{gcc-2.7.2-2.7.2.1.diff.gz} to achieve
-@c similar results.
-
-@item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-0.5.20.tar.gz | tar xf -}
-It is not always necessary to obtain the latest version of
-@code{g77} as a complete @file{.tar.gz} file if you have
-a complete, earlier distribution of @code{g77}.
-If appropriate, you can unpack that earlier
-version of @code{g77}, and then apply the appropriate patches
-to achieve the same result---a source tree containing version
-0.5.20 of @code{g77}.
-
-@item Step @value{link-gcc}: @kbd{ln -s gcc-2.7.2.2 gcc}
-@item Step @value{link-g77}: @kbd{ln -s g77-0.5.20 g77}
+@c Some systems have a version of @code{tar} that support
+@c uncompressing @code{gzip} files.
+@c
+@c @item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-0.5.19.tar.gz | tar xf -}
+
+@item Step @value{link-gcc}: @kbd{ln -s gcc-2.7.2 gcc}
+@item Step @value{link-g77}: @kbd{ln -s g77-0.5.19 g77}
These commands mainly help reduce typing,
and help reduce visual clutter in examples
in this manual showing what to type to install @code{g77}.
-@c Of course, if appropriate, @kbd{ln -s gcc-2.7.2.1 gcc} or
-@c similar.
-
@xref{Unpacking}, for information on
using distributions of @code{g77} made by organizations
other than the FSF.
@item Step @value{merge-g77}: @kbd{mv -i g77/* gcc}
After doing this, you can, if you like, type
-@samp{rm g77} and @samp{rmdir g77-0.5.20} to remove
+@samp{rm g77} and @samp{rmdir g77-0.5.19} to remove
the empty directory and the symbol link to it.
But, it might be helpful to leave them around as
quick reminders of which version(s) of @code{g77} are
@@ -774,8 +473,6 @@ on the contents of the @file{g77} directory (as merged
into the @file{gcc} directory).
@item Step @value{apply-patch}: @kbd{patch -p1 @dots{}}
-@c (Or `@kbd{@dots{} < gcc/f/gbe/2.7.2.1.diff}', if appropriate.)
-@c
This can produce a wide variety of printed output,
from @samp{Hmm, I can't seem to find a patch in there anywhere...}
to long lists of messages indicated that patches are
@@ -827,7 +524,7 @@ Otherwise, installing @code{g77} so that it does not fully
replace the existing installation of @code{gcc} is likely
to result in the inability to compile Fortran programs.
-@xref{Where to Install,,Where in the World Does Fortran (and GNU CC) Go?},
+@xref{Where to Install,,Where in the World Does Fortran (and GNU C) Go?},
for more information on determining where to install @code{g77}.
@xref{Configuring gcc}, for more information on the
configuration process triggered by invoking the @file{./configure}
@@ -857,53 +554,8 @@ make -k install install-libf77 install-f2c-all
@xref{Updating Documentation,,Updating Your Info Directory},
for information on entering this manual into your
system's list of texinfo manuals.
-
-@item Step @value{show-version}: @kbd{g77 -v}
-If this command prints approximately 25 lines of output,
-including the GNU Fortran Front End version number (which
-should be the same as the version number for the version
-of @code{g77} you just built and installed) and the
-version numbers for the three parts of the @code{libf2c}
-library (@code{libF77}, @code{libI77}, @code{libU77}), and
-those version numbers are all in agreement, then there is
-a high likelihood that the installation has been successfully
-completed.
-
-You might consider doing further testing.
-For example, log in as a non-privileged user, then create
-a small Fortran program, such as:
-
-@example
- PROGRAM SMTEST
- DO 10 I=1, 10
- PRINT *, 'Hello World #', I
-10 CONTINUE
- END
-@end example
-
-Compile, link, and run the above program, and, assuming you named
-the source file @file{smtest.f}, the session should look like this:
-
-@example
-sh# @kbd{g77 -o smtest smtest.f}
-sh# @kbd{./smtest}
- Hello World # 1
- Hello World # 2
- Hello World # 3
- Hello World # 4
- Hello World # 5
- Hello World # 6
- Hello World # 7
- Hello World # 8
- Hello World # 9
- Hello World # 10
-sh#
-@end example
-
-After proper installation, you don't
-need to keep your gcc and g77 source and build directories
-around anymore.
-Removing them can free up a lot of disk space.
+@c
+@c @item Step @value{show-version}: @kbd{g77 -v}
@end table
@node Complete Installation
@@ -962,10 +614,10 @@ and @code{g77} is:
@example
sh# @kbd{cd /usr/src}
-sh# @kbd{gunzip -d < /usr/FSF/gcc-2.7.2.2.tar.gz | tar xf -}
-sh# @kbd{gunzip -d < /usr/FSF/g77-0.5.20.tar.gz | tar xf -}
-sh# @kbd{ln -s gcc-2.7.2.2 gcc}
-sh# @kbd{ln -s g77-0.5.20 g77}
+sh# @kbd{gunzip -d < /usr/FSF/gcc-2.7.2.tar.gz | tar xf -}
+sh# @kbd{gunzip -d < /usr/FSF/g77-0.5.19.tar.gz | tar xf -}
+sh# @kbd{ln -s gcc-2.7.2 gcc}
+sh# @kbd{ln -s g77-0.5.19 g77}
sh# @kbd{mv -i g77/* gcc}
@end example
@@ -990,7 +642,7 @@ g77/f
All three entries should be moved (or copied) into a @code{gcc}
source tree (typically named after its version number and
-as it appears in the FSF distributions---e.g. @file{gcc-2.7.2.2}).
+as it appears in the FSF distributions---e.g. @file{gcc-2.7.2}).
@file{g77/f} is the subdirectory containing all of the
code, documentation, and other information that is specific
@@ -1057,7 +709,7 @@ The format is,
generally, @var{major}.@var{minor}.@var{patch}, with
each field being a decimal number.
(You can safely ignore
-leading zeros; for example, 1.5.3 is the same as 1.5.03.)@
+leading zeros; for example, 1.5.3 is the same as 1.5.03.)
The @var{major} field only increases with time.
The other two fields are reset to 0 when the field to
their left is incremented; otherwise, they, too, only
@@ -1190,7 +842,7 @@ When you enable installation of @code{f77}, either a link to or a
direct copy of the @code{g77} command is made.
Similarly, @file{f77.1} is installed as a man page.
-(The @code{uninstall} target in the @file{gcc/Makefile} also tests
+(The @samp{uninstall} target in the @file{gcc/Makefile} also tests
this macro and file, when invoked, to determine whether to delete the
installed copies of @code{f77} and @file{f77.1}.)
@@ -1275,7 +927,7 @@ or edit @file{gcc/f/Make-lang.in} and change the definition of the
@node Patching GNU Fortran
@subsection Patching GNU Fortran
-If you're using a SunOS4 system, you'll need to make the following
+If you're using a SunOS system, you'll need to make the following
change to @file{gcc/f/proj.h}: edit the line reading
@example
@@ -1286,21 +938,21 @@ change to @file{gcc/f/proj.h}: edit the line reading
by replacing the @samp{1} with @samp{0}.
Or, you can avoid editing the source by adding
@example
-CFLAGS='-DFFEPROJ_STRTOUL=0 -g -O'
+CFLAGS='-DFFEPROJ_STRTOUL=0 -g'
@end example
to the command line for @code{make} when you invoke it.
(@samp{-g} is the default for @samp{CFLAGS}.)
-This causes a minimal version of @code{strtoul()} provided
+This causes a minimal version of @samp{strtoul()} provided
as part of the @code{g77} distribution to be compiled and
linked into whatever @code{g77} programs need it, since
-some systems (like SunOS4 with only the bundled compiler and its
-runtime) do not provide this function in their system libraries.
+some systems (like SunOS) do not provide this function
+in their system libraries.
-Similarly, a minimal version of @code{bsearch()} is available
+Similarly, a minimal version of @samp{bsearch()} is available
and can be enabled by editing a line similar to the one
-for @code{strtoul()} above in @file{gcc/f/proj.h}, if
-your system libraries lack @code{bsearch()}.
+for @samp{strtoul()} above in @file{gcc/f/proj.h}, if
+your system libraries lack @samp{bsearch()}.
The method of overriding @samp{X_CFLAGS} may also be used.
These are not problems with @code{g77}, which requires an
@@ -1311,11 +963,11 @@ of @code{gcc} to provide one to all @code{gcc}-based
compilers in future @code{gcc} distributions.
@xref{Problems Installing}, for more information on
-why @code{strtoul()} comes up missing and on approaches
+why @samp{strtoul()} comes up missing and on approaches
to dealing with this problem that have already been tried.
@node Where to Install
-@subsection Where in the World Does Fortran (and GNU CC) Go?
+@subsection Where in the World Does Fortran (and GNU C) Go?
Before configuring, you should make sure you know
where you want the @code{g77} and @code{gcc}
@@ -1335,7 +987,7 @@ version of @code{gcc} on the system.
Sometimes people make the mistake of installing @code{gcc} as
@file{/usr/local/bin/gcc},
leaving an older, non-Fortran-aware version in @file{/usr/bin/gcc}.
-(Or, the opposite happens.)@
+(Or, the opposite happens.)
This can result in @code{g77} being unable to compile Fortran
source files, because when it calls on @code{gcc} to do the
actual compilation, @code{gcc} complains that it does not
@@ -1427,9 +1079,9 @@ has been configured.
If it does not, there is a problem.
@emph{Note:} Configuring with the @samp{--srcdir} argument is known
-to work with GNU @code{make}, but it is not known to work with
-other variants of @code{make}.
-Irix5.2 and SunOS4.1 versions of @code{make} definitely
+to work with GNU @samp{make}, but it is not known to work with
+other variants of @samp{make}.
+Irix5.2 and SunOS4.1 versions of @samp{make} definitely
won't work outside the source directory at present.
@code{g77}'s
portion of the @file{configure} script issues a warning message
@@ -1528,14 +1180,21 @@ To save some disk space during installation, after Stage 2
is built, you can type @samp{rm -fr stage1} to remove the
binaries built during Stage 1.
-@emph{Note:} @xref{Object File Differences}, for information on
-expected differences in object files produced during Stage 2 and
-Stage 3 of a bootstrap build.
-These differences will be encountered as a result of using
-the @samp{make compare} or similar command sequence recommended
-by the GNU CC installation documentation.
+@pindex zzz.o
+@pindex zzz.c
+@emph{Note:} If you do build Stage 3
+and you compare the object files produced by various stages,
+the file @file{gcc/f/zzz.o} @strong{will} be different.
+That is because it
+contains a string with an expansion of the @samp{__TIME__} macro,
+which expands to the current time of day.
+It is nothing to worry about, since
+@file{gcc/f/zzz.c} doesn't contain any actual code.
+It does allow you to override its use of @samp{__DATE__} and
+@samp{__TIME__} by defining macros for the compilation---see the
+source code for details.
-Also, @xref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC},
+@xref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC},
for important information on building @code{gcc} that is
not described in this @code{g77} manual.
For example, explanations of diagnostic messages
@@ -1606,51 +1265,43 @@ printed by them when they work:
@example
sh# @kbd{cd /usr/src/gcc}
sh# @kbd{./g77 --driver=./xgcc -B./ -v}
-g77 version 0.5.20
- ./xgcc -B./ -v -fnull-version -o /tmp/gfa18047 @dots{}
+ ./xgcc -B./ -v -fnull-version -o /tmp/gfa03648 @dots{}
Reading specs from ./specs
-gcc version 2.7.2.2.f.2
+gcc version 2.7.1
./cpp -lang-c -v -isystem ./include -undef @dots{}
-GNU CPP version 2.7.2.2.f.2 (Linux/Alpha)
+GNU CPP version 2.7.1 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
./include
- /usr/local/include
- /usr/alpha-unknown-linux/include
- /usr/lib/gcc-lib/alpha-unknown-linux/2.7.2.2.f.2/include
+ /usr/include
+ /usr/i486-unknown-linuxaout/include
+ /usr/lib/gcc-lib/i486-unknown-linuxaout/2.7.1/include
/usr/include
End of search list.
- ./f771 /tmp/cca18048.i -fset-g77-defaults -quiet -dumpbase @dots{}
-GNU F77 version 2.7.2.2.f.2 (Linux/Alpha) compiled @dots{}
-GNU Fortran Front End version 0.5.20-970224 compiled: @dots{}
- as -nocpp -o /tmp/cca180481.o /tmp/cca18048.s
- ld -G 8 -O1 -o /tmp/gfa18047 /usr/lib/crt0.o -L. @dots{}
-__G77_LIBF77_VERSION__: 0.5.20
-@@(#)LIBF77 VERSION 19960619
-__G77_LIBI77_VERSION__: 0.5.20
-@@(#) LIBI77 VERSION pjw,dmg-mods 19961209
-__G77_LIBU77_VERSION__: 0.5.20
-@@(#) LIBU77 VERSION 19970204
+ ./f771 /tmp/cca03648.i -quiet -dumpbase null.F -version @dots{}
+GNU F77 version 2.7.1 (80386, BSD syntax) compiled @dots{}
+GNU Fortran Front End version 0.5.19 compiled: @dots{}
+ as -o /tmp/cca036481.o /tmp/cca03648.s
+ ld -m i386linux -o /tmp/gfa03648 /usr/lib/crt0.o -L. @dots{}
+/usr/lib/crt0.o(.text+0x35): undefined reference to `main'
sh# @kbd{./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone}
Reading specs from ./specs
-gcc version 2.7.2.2.f.2
+gcc version 2.7.1
./cpp -lang-c -v -isystem ./include -undef @dots{}
-GNU CPP version 2.7.2.2.f.2 (Linux/Alpha)
+GNU CPP version 2.7.1 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
./include
- /usr/local/include
- /usr/alpha-unknown-linux/include
- /usr/lib/gcc-lib/alpha-unknown-linux/2.7.2.2.f.2/include
+ /usr/include
+ /usr/i486-unknown-linuxaout/include
+ /usr/lib/gcc-lib/i486-unknown-linuxaout/2.7.1/include
/usr/include
End of search list.
- ./cc1 /tmp/cca18063.i -quiet -dumpbase null.c -version @dots{}
-GNU C version 2.7.2.2.f.2 (Linux/Alpha) compiled @dots{}
- as -nocpp -o /tmp/cca180631.o /tmp/cca18063.s
- ld -G 8 -O1 -o /tmp/delete-me /usr/lib/crt0.o -L. @dots{}
-/usr/lib/crt0.o: In function `__start':
-crt0.S:110: undefined reference to `main'
-/usr/lib/crt0.o(.lita+0x28): undefined reference to `main'
+ ./cc1 /tmp/cca03659.i -quiet -dumpbase null.c -version @dots{}
+GNU C version 2.7.1 (80386, BSD syntax) compiled @dots{}
+ as -o /tmp/cca036591.o /tmp/cca03659.s
+ ld -m i386linux -o /tmp/delete-me /usr/lib/crt0.o -L. @dots{}
+/usr/lib/crt0.o(.text+0x35): undefined reference to `main'
sh#
@end example
@@ -1660,10 +1311,11 @@ used to indicate such truncations.)
The above two commands test whether @code{g77} and @code{gcc},
respectively, are able to compile empty (null) source files,
whether invocation of the C preprocessor works, whether libraries
-can be linked, and so on.
+can be linked (even though there is an undefined reference due
+to there being no main program unit), and so on.
If the output you get from either of the above two commands
-is noticeably different, especially if it is shorter or longer
+is noticably different, especially if it is shorter or longer
in ways that do not look consistent with the above sample
output, you probably should not install @code{gcc} and @code{g77}
until you have investigated further.
@@ -1729,7 +1381,7 @@ require this alternate command, but they do.
Note that using the @samp{-k} option tells @code{make} to
continue after some installation problems, like not having
@code{makeinfo} installed on your system.
-It might not be necessary for your system.
+It might not be necessary.
@node Updating Documentation
@subsection Updating Your Info Directory
@@ -1753,25 +1405,17 @@ file in the @code{info} directory on your system (perhaps
@end example
If the menu in @file{dir} is organized into sections, @code{g77}
-probably belongs in a section with a name such as one of
-the following:
+probably belongs in a section with a name such as the following:
@itemize @bullet
@item
-Fortran Programming
-
-@item
Writing Programs
-
@item
Programming Languages
-
@item
Languages Other Than C
-
@item
Scientific/Engineering Tools
-
@item
GNU Compilers
@end itemize
@@ -1899,9 +1543,6 @@ not get overwritten.
@item info/g77.info*
This is the documentation for @code{g77}.
-If it is not included, users will have trouble understanding
-diagnostics messages and other such things, and will send
-you a lot of email asking questions.
Please edit this documentation (by editing @file{gcc/f/*.texi}
and doing @samp{make doc} from the @file{/usr/src/gcc} directory)
@@ -1919,8 +1560,6 @@ easily.
@item man/man1/g77.1
This is the short man page for @code{g77}.
-It is out of date, but you might as well include it
-for people who really like man pages.
@item man/man1/f77.1
In installations where @code{f77} is the same as @code{g77},
@@ -1965,9 +1604,129 @@ until you're sure your distribution is widely used and has been
well tested.
This especially goes for those of you making any
changes to the @code{g77} sources to port @code{g77}, e.g. to OS/2.
-@email{fortran@@gnu.ai.mit.edu} has received a fair number of bug
+@samp{fortran@@gnu.ai.mit.edu} has received a fair amount of bug
reports that turned out to be problems with other peoples' ports
and distributions, about which nothing could be done for the
user.
Once you are quite certain a bug report does not involve
your efforts, you can forward it to us.
+
+@node Settings
+@section Changing Settings Before Building
+
+Here are some internal @code{g77} settings that can be changed
+by editing source files in @file{gcc/f/} before building.
+
+This information, and perhaps even these settings, represent
+stop-gap solutions to problems people doing various ports
+of @code{g77} have encountered.
+As such, none of the following information is expected to
+be pertinent in future versions of @code{g77}.
+
+@menu
+* Maximum Stackable Size:: Large arrays are forced off the stack frame.
+* Floating-point Bit Patterns:: Possible programs building cross-compiler.
+* Large Initialization:: Large arrays with @samp{DATA} initialization.
+* Alpha Problems:: Problems with 64-bit systems like Alphas.
+@end menu
+
+@node Maximum Stackable Size
+@subsection Maximum Stackable Size
+
+@vindex FFECOM_sizeMAXSTACKITEM
+@cindex code, stack variables
+@cindex maximum stackable size
+@cindex stack allocation
+@cindex segmentation violation
+@code{g77}, on most machines, puts many variables and arrays on the stack
+where possible, and can be configured (by changing
+@samp{FFECOM_sizeMAXSTACKITEM} in @file{gcc/f/com.c}) to force
+smaller-sized entities into static storage (saving
+on stack space) or permit larger-sized entities to be put on the
+stack (which can improve run-time performance, as it presents
+more opportunities for the GBE to optimize the generated code).
+
+@emph{Note:} Putting more variables and arrays on the stack
+might cause problems due to system-dependent limits on stack size.
+Also, the value of @samp{FFECOM_sizeMAXSTACKITEM} has no
+effect on automatic variables and arrays.
+@xref{But-bugs}, for more information.
+
+@node Floating-point Bit Patterns
+@subsection Floating-point Bit Patterns
+
+@cindex cross-compiler, building
+@cindex floating-point bit patterns
+@cindex bit patterns
+The @code{g77} build will crash if an attempt is made to build
+it as a cross-compiler
+for a target when @code{g77} cannot reliably determine the bit pattern of
+floating-point constants for the target.
+Planned improvements for g77-0.6
+will give it the capabilities it needs to not have to crash the build
+but rather generate correct code for the target.
+(Currently, @code{g77}
+would generate bad code under such circumstances if it didn't crash
+during the build, e.g. when compiling a source file that does
+something like @samp{EQUIVALENCE (I,R)} and @samp{DATA R/9.43578/}.)
+
+@node Large Initialization
+@subsection Initialization of Large Aggregate Areas
+
+@cindex speed, compiler
+@cindex slow compiler
+@cindex memory utilization
+@cindex large initialization
+@cindex aggregate initialization
+A warning message is issued when @code{g77} sees code that provides
+initial values (e.g. via @samp{DATA}) to an aggregate area (@samp{COMMON}
+or @samp{EQUIVALENCE}, or even a large enough array or @samp{CHARACTER}
+variable)
+that is large enough to increase @code{g77}'s compile time by roughly
+a factor of 10.
+
+This size currently is quite small, since @code{g77}
+currently has a known bug requiring too much memory
+and time to handle such cases.
+In @file{gcc/f/data.c}, the macro
+@samp{FFEDATA_sizeTOO_BIG_INIT_} is defined
+to the minimum size for the warning to appear.
+The size is specified in storage units,
+which can be bytes, words, or whatever, on a case-by-case basis.
+
+After changing this macro definition, you must
+(of course) rebuild and reinstall @code{g77} for
+the change to take effect.
+
+Note that, as of version 0.5.18, improvements have
+reduced the scope of the problem for @emph{sparse}
+initialization of large arrays, especially those
+with large, contiguous uninitialized areas.
+However, the warning is issued at a point prior to
+when @code{g77} knows whether the initialization is sparse,
+and delaying the warning could mean it is produced
+too late to be helpful.
+
+Therefore, the macro definition should not be adjusted to
+reflect sparse cases.
+Instead, adjust it to generate the warning when densely
+initialized arrays begin to cause responses noticably slower
+than linear performance would suggest.
+
+@node Alpha Problems
+@subsection Alpha Problems
+
+@cindex Alpha, bugs
+@cindex 64-bit systems
+@code{g77} might warn when it is used to compile Fortran code
+for a target configuration that is not basically a 32-bit
+machine (such as an Alpha, which is a 64-bit machine, especially
+if it has a 64-bit operating system running on it).
+This is because @code{g77} is known to not work
+properly on such configurations.
+This is expected to be completely fixed
+at 0.6, at which point the warning would be dropped.
+
+(Version 0.5.20 is expected to solve most of these
+problems, though, as of this writing, work is still
+progressing in this area.)