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

All ideas are welcome!

FX

Reply via email to