mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Kai Peter <>
Subject: Re: [musl] Search path for shared libs
Date: Wed, 20 Apr 2022 18:03:49 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 2022-04-20 15:12, Rich Felker wrote:
> On Wed, Apr 20, 2022 at 09:15:43AM +0200, Kai Peter wrote:
>> Hi,
>> I did run in an issue with the search path of shared objects. I'm on
>> a real custom system, so the pathes below are correct. There is no
>> glibc at all, the gcc was modified to build with the loader in
>> /qlnx/lib. curl was build with shared openssl libs as a dependency
>> for git. Then I issue
>> $ ldd /misc/bin/curl
>>         /qlnx/lib/ (0x7f1e1df97000)
>> => /misc/lib/ (0x7f1e1df0f000)
>> => /libs/lib/ (0x7f1e1de79000)
>> => /libs/lib/ 
>> (0x7f1e1dbb0000)
>> => /qlnx/lib/ (0x7f1e1db93000)
>> => /qlnx/lib/ (0x7f1e1df97000)
>> => /qlnx/lib/ (0x7f1e1da81000)
>> All fine, pathes are correct and working. Then:
>> $ ldd /misc/lib/ 2>&1 | grep -v reloc
>>         ldd (0x7f122b691000)
>> Error loading shared library No such file or
>> directory (needed by /misc/lib/
>> Error loading shared library No such file or
>> directory (needed by /misc/lib/
>> => /qlnx/lib/ (0x7f122b4f7000)
>> => /qlnx/lib/ (0x7f122b4da000)
>> => ldd (0x7f122b691000)
>> As a workaround I can create symlinks of the missing ssl libs in
>> /qlnx/lib. The ld-musl-x86_64.path contains all pathes and it is
>> read. So the question is: Why does not find
>> libssl/libcrypto? Any insight?
> Is the ldd you're invoking a symlink to ldso? If so, that's deprecated
> usage which has problems using the right path (because the pathname
> comes from what was used to invoke ldd) and you should replace it with
> a shell script:
> #!/bin/sh
> exec /qlnx/lib/ --list "$@"
> Then ldso will have the right base pathname to look for its .path file
> relative to.


ldd is a symlink to ../lib/ However, I found a 
solution in another thread (where I accidentally replied to). I did 
remember that I changed the sys_path in dynlink.c. At this time I didn't 
know all lib pathes. I did add the missing ones and all is working fine 
for me. The root cause was that libcurl was used by git and didn't  find 
libssl. This is working now. As suggested I have replaced the link with 
the script too.


      reply	other threads:[~2022-04-20 16:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  7:15 Kai Peter
2022-04-20 13:12 ` Rich Felker
2022-04-20 16:03   ` Kai Peter [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:

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

  git send-email \ \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

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 NNTP newsgroup(s).