g77 (was *.f *.c linking problem)

Dr H. T. Leung htl10@cus.cam.ac.uk
Tue Jul 14 07:29:00 GMT 1998


Yes, I found that I had to put in the `xargc' and `xargv' globals into the
original C wrapper even after stripping out main.o from libf2c. It is not
much really (just a few lines, two globals and two within main. to map
xargc=argc inside main), it doesn't break the portability of the program
so I left them there... just thought it would be nice to have the egcs
compiler working in the same way as the proprietary sun compilers... 

So which is more "recent/up-to-date"? I thought egcs is more up-to-date
(more bug-fixes) than 2.8.1? But it sounds like the g77 0.5.23 (or 0.5.24)
which works with gcc 2.8.1 is more recent than the g77 part of egcs
1.0.3a?

On Mon, 13 Jul 1998, Craig Burley wrote:

> In particular, this fixes the problem whereby GETARG or IARGC was
> called in Fortran code (compiled by g77 or f2c), which caused the
> linker to try and link in `xargc' and `xargv' globals, which in
> turn were defined only in libf2c's main.o object file.
> 
> So, wait for egcs 1.1 and upgrade to that; or obtain an egcs snapshot
> and either use it or apply just the relevant differences to your own
> copy of egcs (the latter requires some compiler/library programming
> experience, but it's not too hard); or switch to g77 0.5.23 and gcc 2.8.1
> for now, until egcs 1.1 comes out.
> 
> The long-term fix is to eliminate the kludge whereby a Fortran
> main program is compiled as MAIN__ instead of main, along with
> the main.o entry in the library, entirely.  That probably won't
> happen until it is part of the libg77 project.
> 
> For more info on g77 issues like this, start by reviewing the g77
> docs and also check out:
> 
>   < ftp://alpha.gnu.org/g77.plan >
> 
>         tq vm, (burley)




More information about the Gcc-bugs mailing list