GNU bug report logs - #26048
Use absolute file names in NEED instead of adding many entries to RUNPATH

Previous Next

Package: guix;

Reported by: ludo <at> gnu.org (Ludovic Courtès)

Date: Fri, 10 Mar 2017 15:02:02 UTC

Severity: normal

Tags: wontfix

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


Message #8 received at 26048 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Andy Wingo <wingo <at> igalia.com>, guix-devel <guix-devel <at> gnu.org>,
 26048 <at> debbugs.gnu.org
Subject: Re: ‘core-updates’ is back!
Date: Tue, 05 Sep 2017 16:57:40 +0200
Ricardo Wurmus <rekado <at> elephly.net> skribis:

> Andy wrote:
>
>> It would be pretty cool if we could fix our O(n^2) problems in search
>> paths in this core-updates -- basically whenever you go to create an
>> environment, instead of making e.g. VAR=A:B:C:..., for all VARs
>> (LIBRARY_PATH, PKG_CONFIG_PATH, etc), instead we make a union directory
>> Z containing the union of A, B, C, etc and set VAR=Z.  The goal would be
>> to fix quadratic run-time lookup costs by replacing it with a
>> compile-time computation.  This applies to many lookups: PATH, -rpath,
>> etc.
>
> Ludo wrote:
>
>> A possible alternative solution for ld.so is at
>> <https://bugs.gnu.org/26048>.
>
> Do you know of any negative side effects this would have?  For example,
> would it not become impossible to override libraries at runtime with
> LD_LIBRARY_PATH or LD_PRELOAD when “-lfoo” is replaced by the absolute
> file name of the “foo” library?

Good question.  Per the ELF v1.2 spec¹ (page 82), setting DT_NEEDED to
an absolute file name would prevent overriding via LD_LIBRARY_PATH,
which is not desirable.

It turns out we cannot even set DT_NEEDED to an absolute file name in
the first place, because ld records the DT_SONAME of the library, when
it’s available (which is the case most of the time), rather than its
file name.

IOW, the approach suggested in <https://bugs.gnu.org/26048> isn’t really
applicable.  :-/

Ludo’.

¹ http://refspecs.linuxbase.org/elf/elf.pdf




This bug report was last modified 7 years and 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.