public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Vincent Fortier <th0ma7@gmail.com>, libc-help <libc-help@sourceware.org>
Subject: Re: tools only installation?
Date: Tue, 1 Aug 2023 17:52:48 -0300	[thread overview]
Message-ID: <0b7f50a0-84ca-b518-5af2-351ef35c46f5@linaro.org> (raw)
In-Reply-To: <CALAySuL4qcDLG8uQMnzO+F9AofLWXo97gNkgMpFRBL2+Kh4cgw@mail.gmail.com>



On 30/07/23 08:58, Vincent Fortier via Libc-help wrote:
> Hi,
> 
> Currently maintaining a SynoCommunity development package with a set
> of various tools including compilers.  One thing I'd really much like
> to add is ldd, as everything being cross-compiled, having a native ldd
> would be helpful to check shared libraries relationships directly from
> its installed destination.
> 
> So I've been playing with glibc to cross-compile it, which now works.
> Although I now have two remaining issues:
> 1. I can't find a way to install only the set of glibc tools, without
> the entire library or any include files?  Focus being in particular to
> ldd.
> 2. Presumably in lack of a solution for item 1, when invoking glibc
> build after my other set of tools already built in planning to
> generate a resulting package, glibc ends-up colliding with the already
> installed gmp.h include file, coming from binutils who required gmp as
> dependency.  I'm presuming I should not build glibc first as
> everything else will be bound to that newer version of glibc instead
> of the one provided by the Synology toolchain.
> 
> github PR: https://github.com/SynoCommunity/spksrc/pull/5824
> 
> Help or pointers would be really much appreciated.

The ldd is essentially a script that issues the loader, you can also issue
this direct:

$ LD_TRACE_LOADED_OBJECTS=1 /lib64/ld-linux-x86-64.so.2 /usr/bin/ls
        linux-vdso.so.1 (0x00007ffd6efaf000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007ff78e8d8000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff78e600000)
        libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007ff78e841000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff78e948000)

The only limitation is it does not resolve the interpreter, so you
must issues the one define in the ELF file. A normal cross-compile 
installation would have it.

Also glibc uses an internal only gmp.h which is not installed in the system 
so it is not clear to me what you referring for the gmp.h collision. The
glibc provides a handy script to build cross-compile toolchain 
(build-many-glibcs.py), so it should be a matter to target the proper
architecture along with the expected versions (the build-many-glibcs.py
does not provide a way to define specific version, but you can easily
setup manually).

Another option would be use a different tool instead of ldd, as the
suggested libtree cited on the PR. I have also created a similar
tool [1] which should works slight better (it supports more architectures,
support more ld.so.cache version and parses it directly instead of
parsing ld.so.conf, it supports the new hwcap selection added on 
recent glibc).

It is different than ldd because it parses the ELF file and mimic the loader,
which is different than actually starting the loading process (as ldd does).

[1] https://github.com/zatrazz/rldd

      reply	other threads:[~2023-08-01 20:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-30 11:58 Vincent Fortier
2023-08-01 20:52 ` Adhemerval Zanella Netto [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=0b7f50a0-84ca-b518-5af2-351ef35c46f5@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-help@sourceware.org \
    --cc=th0ma7@gmail.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.
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).