mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Lorenz Hipp <jHhvLtwZki@irdisch.de>, musl@lists.openwall.com
Subject: Re: [musl] Add musl-ldd for user convenience and to avoid naming conflict
Date: Mon, 17 Apr 2023 18:37:51 -0400	[thread overview]
Message-ID: <20230417223750.GP4163@brightrain.aerifal.cx> (raw)
In-Reply-To: <20230417203109.GO3630668@port70.net>

On Mon, Apr 17, 2023 at 10:31:09PM +0200, Szabolcs Nagy wrote:
> * Lorenz Hipp <jHhvLtwZki@irdisch.de> [2023-04-17 04:36:24 +0200]:
> > The default "ldd" program on most Linux systems is surely the script
> > provided by the gnu libc implementation.
> > 
> > Unfortunately, (for reasons I won't go into detail) their program
> > cannot work properly with programs linked with musl, as it prints an
> > error message :
> > 
> >     musl-gcc -o Test-musl Test-musl.c
> >     ldd Test-musl
> > 
> >     ./Test-musl: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header
> > 
> > Since the mentioned file is of course a linker script and just text, it
> > cannot have a valid ELF header.
> > 
> > 
> > Following the FAQ on the musl website at
> > 
> >     https://wiki.musl-libc.org/faq.html#Q:-Where-is-%3Ccode%3Eldd%3C/code%3E?
> > 
> > the musl linker actually has 'ldd' functionality, which is used when
> > it is called as "ldd".
> > 
> > Quote :
> > 
> >     Just create a symlink from ld-musl-$ARCH.so to /bin/ldd.
> > 
> > At least on machines where software is developed, it would not be
> > a good idea to replace the glibc ldd script with a link to the musl
> > linker, because of .. reasons (such as slightly different output behaviour).
> 
> i think the faq should be updated to use
> 
>  /lib/ld-musl-$arch.so.1 --list path/to/exe
> 
> which you can put in a script and name it ldd if you want.

Agreed. The argv0 thing should be considered deprecated since it
precludes showing the right "libc.so =>" and has other issues.

Rich

      reply	other threads:[~2023-04-17 22:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17  2:36 Lorenz Hipp
2023-04-17 15:28 ` Markus Wichmann
2023-04-17 20:31 ` Szabolcs Nagy
2023-04-17 22:37   ` Rich Felker [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=20230417223750.GP4163@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=jHhvLtwZki@irdisch.de \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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