FreeBSD links wrong library for tests if one is installed in $prefix

Vincent Lefevre vincent at vinc17.net
Wed Jun 28 00:09:54 UTC 2017


On 2017-06-27 23:11:02 +0200, Emmanuel Thome wrote:
> On Tue, Jun 27, 2017 at 08:01:50PM +0200, Vincent Lefevre wrote:
> > On 2017-06-27 19:21:00 +0200, Emmanuel Thome wrote:
> > > gf2x-freebsd-110-amd64-test2 ~/gmp-6.1.2 $ objdump -x ./tests/mpn/.libs/t-mul | egrep "(R.*PATH|NEEDED)"    
> > >   NEEDED      libgmp.so.10
> > >   NEEDED      libc.so.7
> > >   RPATH       /tmp/inst/lib
> > 
> > libtool should have put the local dir in the run path too.
> > It's strange that it didn't do that.
> 
> freebsd's ld, which is a venerable GNU binutils 2.17.50 dated 2007-07-50
> (yes, I'm talking about the current freebsd), does not emit new dtags
> (runpath vs rpath) by default.

I meant either RPATH or RUNPATH (whatever is used by ld). Here it
would be RPATH. Under Debian jessie, here's what I got for MPFR:

  RPATH  /home/vlefevre/software/mpfr-3.1/src/.libs:/home/vlefevre/debian8/gmp/k10/lib

/home/vlefevre/debian8/gmp/k10/lib was the current installation
in my home dir, and /home/vlefevre/software/mpfr-3.1/src/.libs is
the directory from the build tree. You should have got something
similar, i.e.

  RPATH  /home/ci/gmp-6.1.2/.libs:/tmp/inst/lib

> I'm skeptical about the intent to mention the current directory as a
> r(un)path as well. Are you sure it's ever done that way ?

Not the current directory, but the directory that contains the
library that has just been built.

> > > Prepending "env LD_LIBRARY_PATH_RPATH=1" before running scripts in e.g.
> > > make check or make tune would be a workaround, I suppose.
> > 
> > Generating a right RPATH would be a better solution.
> 
> What's your definition of "right" ?

See above.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list