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

Emmanuel Thomé Emmanuel.Thome at
Tue Jun 27 21:11:02 UTC 2017

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
> >   NEEDED
> >   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'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 ?

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

> > > MPFR instructs libtool *not* to use temporary wrapper scripts, as
> > > they should be useless for the tests (as documented in the libtool
> > > manual). This means that it completely relies on the run path.
> > 
> > ok -- but then you're forcing libtool to relink before make install,
> > right ? (with respect to my problem, it's perhaps less error-prone, but
> > that's merely a question of trade-off. relinking surely has downsides
> > too).
> No need: the test programs are not installed.

of course.


More information about the gmp-bugs mailing list