[Top][All Lists]

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

Re: LD_LIBRARY_PATH set by wrapper on Ubuntu, not on Rocky (Redhat)

From: Vincent Lefevre
Subject: Re: LD_LIBRARY_PATH set by wrapper on Ubuntu, not on Rocky (Redhat)
Date: Tue, 6 Sep 2022 11:34:17 +0200
User-agent: Mutt/2.2.7+37 (a90f69b9) vl-149028 (2022-09-02)

On 2022-09-06 11:17:27 +0200, Vincent Lefevre wrote:
> On 2022-09-06 10:12:23 +0200, Frederic Berat wrote:
> > The behavior is likely not due to patches on libtool (at least I
> > couldn't find anything obviously relevant), but more probably to the
> > default behavior of gnu ld.
> > From the behavior described in the thread earlier, it looks like
> > Debian has the "--enable-dtags" option set to ld, while Redhat doesn't
> > have it. That leads to RUNPATH being set on Debian while RPATH is set
> > on REDHAT, which by side effect modifies the behavior of libtool, if I
> > get it right.
> > 
> > Interestingly, Vincent opened a bug report in Debian a few years ago
> > [1], complaining that "--enable-dtags" was breaking tests generated by
> > libtool. I wonder if there was any follow-up on this, and what was the
> > conclusion.
> > 
> > [1]
> Unfortunately, as you can see, there were no answers. So I ended up
> by explicitly disabling dtags for GNU MPFR (when supported):

I forgot to say that MPFR does not use wrappers, in particular
because it makes debugging a bit less easy, so that it is not
possible to get rid of LD_LIBRARY_PATH in "make check". Anyway,
getting rid of it would be incorrect, because this is where the
GMP library (which MPFR uses) may be found.

The main issue comes from the fact that LD_LIBRARY_PATH has 2 meanings:
  1. just add some path to the search path, typically based on
     the user's home directory, so that the user can install
     libraries in his homedir, and avoid the use of -L, etc.
     (possibly with a higher precedence than the system paths).
  2. override hardcoded runpath in some particular binaries.

It seems that RUNPATH was introduced to solve (2), while it should
have been much better to introduce something like LD_LIBRARY_PATH
but with a higher precedence (a bit like LD_PRELOAD, which can
already be used to solve (2), but maybe with some drawbacks).

Vincent Lefèvre <> - Web: <>
100% accessible validated (X)HTML - Blog: <>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

reply via email to

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