http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47571

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-01 
16:08:10 UTC ---
(In reply to comment #6)
> > clock_gettime is defined in librt, so if libgfortran started using librt
> > symbols, it needs to a) link against it dynamically for libgfortran.so
> 
> Yes, that's what it does

But why doesn't it work then, cf. comment 4? openSUSE 11.3 is neither old nor
very special.

> > b)
> > arrange for gfortran driver to pass in -lrt when linking libgfortran
> > statically.
> Right, I haven't considered this part. Anyone have any idea how that could be
> done?

Via libgfortran/libgfortran.spec.in and some configure script?

Cf. libgomp and libgomp/configure.ac's

# Set up the set of libraries that we need to link against for libgomp.
# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp,
# which will force linkage against -lpthread (or equivalent for the system).
# That's not 100% ideal, but about the best we can do easily.
if test $enable_shared = yes; then
  link_gomp="-lgomp %{static: $LIBS}"
else
  link_gomp="-lgomp $LIBS"
fi
AC_SUBST(link_gomp)


By the way, there is also -lrt added via libgomp/configure.tgt for HPUX.

Reply via email to