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?

"Steven G. Kargl" wrote:

> Toon Moene said:

> > "Steven G. Kargl" wrote:

> > > Why was main.o split out into a separate library?  The
> > > ChangeLog entry for libfrtbegin.a doesn't contain
> > > any info about why this change was required.

> > It was necessary to get libg2c.a flying as a shared library.  It was
> > done during a flurry of updates as we found errors with this
> > change-over.  This might explain (but not justify) the shallow 
> > ChangeLog entry.

> Now, I'm really confused.  FreeBSD has been building a
> shared libg2c for more than 3 years.  main.o lives/lived in
> libg2c without a problem.  I also was the maintainer of
> the f2c port in FreeBSD's port collection, and I had f2c
> using shared libraries without splitting main.o into a
> separate library.

Well, the original author of the "shared libf2c library" patch wrote me:

> 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 ?

Thanks in advance,

Toon Moene - - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77:
Join GNU Fortran 95: (under construction)

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