This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fortran] where is -lfrtbegin?

> > WRT to frtbegin : there is no frtbegin.c.
> > To support shared libraries, the libF77/main.c must not be linked into
> > the archive because it contains a main() entrypoint. So I compile main.c
> > but save the object as frtbegin.o and modified the g77 driver program to
> > put a frtbegin.o on the commandline if you want to link a Fortran main
> > program.
> Because I'm not well versed at shared libraries and their limitations I
> left it that way, until we discovered that you cannot link main programs
> written in other languages than Fortran with Fortran code this way. 
> Hence the libfrtbegin.a library, which solves *that* problem.
> Obviously, you have evidence that including a main program in a shared
> library is not a problem - do you think I should revert the
> libfrtbegin.a thingie ?

Do not revert GCC.  I have submitted a patch to FreeBSD to follow
the GCC convention of linking a libfrtbegin.  I'm guessing that
either FreeBSD's run-time linker could automagically deal
with main() in libg2c or there is some name mangling with
underscores attached to main() that covered up any problems.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]