[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27510: On FreeBSD 9.2 and later, shlibpath does not override runpath

From: Emmanuel Thomé
Subject: bug#27510: On FreeBSD 9.2 and later, shlibpath does not override runpath
Date: Tue, 27 Jun 2017 23:18:14 +0200
User-agent: NeoMutt/20170306 (1.8.0)


Since the following change to the FreeBSD dynamic linker (in 2012):


the LD_LIBRARY_PATH variable no longer takes precedence over the rpath.
Earliest released versions affected are freebsd 9.2 and dragonfly bsd

As a result, an installed lib may take precedence over the one in the
source tree.

In order to have the behaviour that existed on freebsd from 4.6 to 9.1,
it seems that the enviroment variable LD_LIBRARY_PATH_RPATH must be set
to 1.

An alternative could be to force the freebsd dynamic linker to emit
DT_RUNPATH instead of DT_RPATH tags by default, using
-Wl,--enable-new-dtags  (the current release, freebsd-11.0 has
ld-2.17.50, dated 2007-07-30: it does not generate new dtags by default).

A third option is to make libtool recognize freebsd and dragonfly bsd
after the commit above as shlibpath_overrides_runpath=no.

All three options provide a cure to the problem I'm facing. I've
implemented the third directly on libtool HEAD (patch attached). This has
the effect that the following test suite items now pass, while they were
failing previously.

 35: binary relinking at install time                FAILED (demo.at:759)
 53: binary relinking at install time                FAILED (depdemo.at:408)
 69: shlibpath_overrides_runpath                     FAILED (shlibpath.at:66)
 86: cwrapper and installed shared libraries         FAILED (cwrapper.at:256)

I'm attaching the tests/testsuite.dir/NNN/testsuite.log files for these
four failing tests on the unpatched libtool.

I don't know which is the "right" fix.

Best regards.


Attachment: 0001-shlibpath_overrides_runpath-no-for-freebsd-9.2-and-d.patch
Description: Text Data

Attachment: failing-tests.tar.gz
Description: application/gzip

reply via email to

[Prev in Thread] Current Thread [Next in Thread]