This is the mail archive of the
mailing list for the GCC project.
Re: [Fortran] where is -lfrtbegin?
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: "Steven G. Kargl" <kargl at troutmask dot apl dot washington dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 27 May 2002 21:28:13 +0200
- Subject: Re: [Fortran] where is -lfrtbegin?
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <200205262123.g4QLN4rp034357@troutmask.apl.washington.edu>
"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
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 - mailto:firstname.lastname@example.org - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)