[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:17:27 +0200
User-agent: Mutt/2.2.7+37 (a90f69b9) vl-149028 (2022-09-02)

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):

dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH
dnl is defined. The issue is that with the new dtags, LD_LIBRARY_PATH has
dnl the precedence over the run path, so that if a compatible MPFR library
dnl is installed in some directory from $LD_LIBRARY_PATH, then the tested
dnl MPFR library will be this library instead of the MPFR library from the
dnl build tree. Other OS with the same issue might be added later.
dnl References:
dnl We need to check whether --disable-new-dtags is supported as alternate
dnl linkers may be used (e.g., with tcc: CC=tcc LD=tcc).
case $host in
    if test -n "$LD_LIBRARY_PATH"; then
      LDFLAGS="$LDFLAGS -Wl,--disable-new-dtags"
      AC_MSG_CHECKING(whether --disable-new-dtags is supported by the linker)
int main (void) { return 0; }
      [AC_MSG_RESULT(yes (use it since LD_LIBRARY_PATH is set))],

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]