public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/30306] ld.so.conf could easily / should support binary specific LD_PATH directory search path settings ?
Date: Wed, 12 Apr 2023 17:59:10 +0000	[thread overview]
Message-ID: <bug-30306-131-Z0wsZrmGOH@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30306-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30306

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg

--- Comment #4 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(In reply to Jason Vas Dias from comment #3)
> RE: Comment #2: 
> > Why can't you just add /usr/local/lib64 unconditionally to /etc/ld.so.conf?
> 
> Thanks, Andreas - 
> 
> Because there may be many other libraries in /usr/local/lib64 - in fact,
> there is a libgcc-shared.so and a libstdc++.so.6 in /usr/local/lib64,
> which I'd rather not pick up at all - I want to be able to move
> libbpf's libraries to some /usr/local/libbpf-v1.1.0/lib64 directory ,
> and specify that they apply ONLY to links needed for /usr/bin/perf,
> I do NOT want these updated libbpf* links to update the system
> libbpf at all, which MUST remain at v0.7.0, else everything that
> uses libbpf (except perf) will break .
> 
> It just seems to me that having some very simple extra config
> in ld.so.conf, to apply a LD_PATH only to certain executables,
> would prevent a whole host of error prone disasters involved 
> with binary patching in of a DT_RUNPATH ELF note .

We already have RPATH, which has precedence over the loader cache and it is not
subject to DF_1_NODEFLIB.  RPATH also accepts $ORIGIN, which does not tie where
the binary is installed; and it is also simpler to use since do not need admin
credential (to update ld.so.config and run ldconfig).

I don't have a strong opinion, but this seems to just replicate a subset of
RPATH and it will add an extra complexity on loader cache (which will need to
keep track of whether the entry has a path associated, and add a new type to
handle the directory suggestion).  

It also adds some corner cases: 

  - should it just support ET_EXEC? 
  - For ET_DYN, should it tie to the filesystem name or with its SONAME? 
  - The LD_LIBRARY_PATH is handled earlier than the cache and it is not subject
to DF_1_NODEFLIB, however your suggestion ties with LD_LIBRARY_PATH.

So I am not sure if this will be really an improvement.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2023-04-12 17:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 13:47 [Bug libc/30306] New: " jason.vas.dias at gmail dot com
2023-04-03 13:57 ` [Bug libc/30306] " jason.vas.dias at gmail dot com
2023-04-03 16:41 ` schwab@linux-m68k.org
2023-04-03 19:09 ` jason.vas.dias at gmail dot com
2023-04-12 17:59 ` adhemerval.zanella at linaro dot org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30306-131-Z0wsZrmGOH@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).