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 patch: Add libquadmath - and use it in gfortran (round two)


On Mon, Nov 08, 2010 at 04:29:22PM -0500, Jack Howarth wrote:
> On Mon, Nov 08, 2010 at 10:20:42PM +0100, Ralf Wildenhues wrote:
> > Hello,
> > 
> > * Jack Howarth wrote on Mon, Nov 08, 2010 at 10:14:14PM CET:
> > > ...is still passing...
> > > 
> > >  -L/Users/howarth/gcc-4.6-20101108/libquadmath
> > > 
> > > which should be...
> > > 
> > >  -L/Users/howarth/work/x86_64-apple-darwin10.5.0/i386/libquadmath/.libs
> > > 
> > > for the i386 multilib build and 
> > > 
> > >  -L/Users/howarth/work/x86_64-apple-darwin10.5.0/libquadmath/.libs
> > > 
> > > for the -m64 multilib build. We need to figure out what construction
> > > of variables will provide those properly in each case during the mulilib
> > > build of libgfortran.
> > 
> > The key with libtool is usually to *not* pass
> >   -L../foo/.libs -lfoo
> > 
> > but to pass
> >   ../foo/libfoo.la
> > 
> > in libbar_la_LIBADD.  That will set the paths for linking against
> > uninstalled libraries right, and also do TRT when optionally relinking
> > at 'make install' time.
> > 
> > Hope that helps, I didn't check for any further details.  ;-)
> 
> Manually changing the Makefile in /Users/howarth/work/x86_64-apple-darwin10.5.0/libgfortran
> and /Users/howarth/work/x86_64-apple-darwin10.5.0/i386/libgfortran from...
> 
> libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) -L$(top_srcdir)/../libquadmath LIBQUADLIB -lm $(extra_ldflags_libgfortran) $(version_arg)
> 
> to
> 
> libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) ../libquadmath/libquadmath.la -lm $(extra_ldflags_libgfortran) $(version_arg)
> 
> solves the linkage problems in both cases. Thanks.
>                        Jack

I am finding that while 'make install' succeeds on x86_64-apple-darwin10, that the testcode...

$ cat test_qp.f90
program test_qp
  implicit none
  integer, parameter :: QP = 16
  real(QP), parameter :: Z1 = 1,HALF_PI = asin(Z1),PI = HALF_PI+HALF_PI
  real(QP) :: x = 0.124_QP
  print *, x
  print *, PI
  print *, 16*atan(0.2_QP)-4*atan(Z1/239)
  print *, sin(PI)
  print *, cos(HALF_PI)
  print *, asinh(PI)
  print *, erfc(Z1)
  print *, epsilon(x)
  print *, precision(x)
  print *, digits(x)
end program test_qp

produces...

[MacPro:~] howarth% dist/bin/gfortran test_qp.f90 -o test_qp
Undefined symbols:
  "__gfortran_transfer_real_write128", referenced from:
      _MAIN__ in cciK5SKB.o
      _MAIN__ in cciK5SKB.o
      _MAIN__ in cciK5SKB.o
      _MAIN__ in cciK5SKB.o
      _MAIN__ in cciK5SKB.o
      _MAIN__ in cciK5SKB.o
      _MAIN__ in cciK5SKB.o
      _MAIN__ in cciK5SKB.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

and attempting to link statically fails with the error...

dist/bin/gfortran -static-libgfortran test_qp.f90 -o test_qp
ld: unknown option: --as-needed
collect2: ld returned 1 exit status

These patches seem to break -static-libgfortran in general on darwin
as a simple hello.f90 fails to link as well whereas stock gcc trunk
accepts this flag without complaint.
          Jack

> 
> > 
> > Cheers,
> > Ralf


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