This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [RFC] Full float128, third iteration


* FX wrote on Fri, Sep 10, 2010 at 07:08:10PM CEST:
> I'm CC'ing the gcc list so I can get insight from people who
> understand correctly how static libraries should be handled by the
> driver...
> 
> > I'm seeing a similar issue with -static linkage.
> > 
> > % gfc4x -o z norm2_3.f90 -L/usr/home/sgk/work/lib -lquad -static
> 
> OK, I see the same thing. It's due to the fact that when you call:
> 
>   gfortran mycode.f90 -lquad -static
> 
> the linker is called with the following order for the libraries:
> 
>   -lquad -lgfortran -lm --start-group -lgcc -lgcc_eh -lc --end-group
> 
> while libgfortran depends on libquad, so it should be "-lgfortran -lquad".
> 
> I'm not very knowledgeable about that, but I think what we can have
> the driver recognized "-lquad" and  move it after "-lgfortran". That
> won't handle all cases (what if libquad is called something else on
> your computer? what if you link to a specific version, -lquad1.0? what
> if you link directly by specifying the archive file,
> /path/to/libquad.a?)

I don't think you should move it.  Just make sure that it *also* appears
after -lgfortran if you need that.  Specifying libraries more than once
is not uncommon, when static libraries are involved.

One exception to the above technique is when there are weird symbol
override games to be played between shared libquad and libgfortran
(which I don't think is the case).

Cheers,
Ralf


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