More on What is G77?

(This page continues the explanation from What is G77?.)

The g77 compiler (originally called "GNU Fortran") is a combination of a front end that translates Fortran source programs and a back end that uses the results of the translation to make an object or executable file that performs the actions specified by the source programs when run. The back end is the same back end used by GNU C, C++, and Objective-C, which have their own front ends to translate their respective languages. Other front ends for Pascal and ADA are available or in progress. (Note: g77 does not translate Fortran to C code at any point. It is a native portable compiler, just like gcc. They share the same back end.)

The run-time libraries for g77 are currently whatever is compatible with the libraries used by the f2c program, a public-domain Fortran-to-C converter from AT&T Bell Laboratories and Bellcore. f2c comes with its own libraries (written in C) for systems that don't already have compatible libraries. By using the same libraries, procedures compiled by g77 and f2c can be freely mixed to create an executable program. However, g77 is unable to offer some popular extensions that aren't supported by f2c-compatible libraries, and the interface to the libraries isn't necessarily a high-performance design. Thus, use of the f2c library interface is not expected to be a long-term default.

Debugger support for g77 consists of compiler code to output the appropriate debugging information when -g is specified at compile time plus code in the GNU Debugger, gdb, to support evaluation of Fortran expressions.

One powerful capability that can be used, frankly with some effort (but nothing compared to doing it some other way), is to configure and build the GNU compiler suite as a cross-compiler. g77 can be built this way. Around late 1995, I did a criss-cross build of g77, which entailed building a version of g77 on a Linux/Intel platform that ran on a DOS/Intel platform and generated code for an ecoff/i960 machine. It was about a weeks' work, but some of the problems I ran into have been fixed since then in g77, gcc, and the cross-platform development tools provided (generously) by Cygnus Support. (Cygnus and others use the term Canadian Cross to mean what I call criss-cross, that is, three-system, builds, where a compiler for machine C is built to run on B from machine A.)


C -----------------------------------------------------------------------
C                   ----- GNU Fortran (g77) -----
C -----------------------------------------------------------------------
C
      PROGRAM G77
C
      COMMON/QUICKY/QNEWS,QWHAT,QWHO,QHOW,QWHERE,QRLEAS,QSTAT,QWANT,
     1  QY2K,QALIGN,QFUND,QF2C,QMAIL
C
      REAL BOF
C
      WHAT() = 2. * 3.14 * QWHAT
C
      READ *,STATUS,NEXT
      CALL GIMME(FUNDS,*999)
      PRINT *,'Goodies For Contributors!!'
      GO TO (999),NEXT
      CONTINUE
      INQUIRE (UNIT=99,NAME=WANTED)
      CALL WHO(CRUNCH)
999   STOP 3HWHY
      END
C
C -----------------------------------------------------------------------
C
C Copyright (C) 1999 James Craig Burley
C
C Last modified 1999-07-08
C
C -----------------------------------------------------------------------