public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* tools only installation?
@ 2023-07-30 11:58 Vincent Fortier
  2023-08-01 20:52 ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Fortier @ 2023-07-30 11:58 UTC (permalink / raw)
  To: libc-help

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.

Thnx in advance.

Vincent Fortier

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tools only installation?
  2023-07-30 11:58 tools only installation? Vincent Fortier
@ 2023-08-01 20:52 ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella Netto @ 2023-08-01 20:52 UTC (permalink / raw)
  To: Vincent Fortier, libc-help



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-01 20:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-30 11:58 tools only installation? Vincent Fortier
2023-08-01 20:52 ` Adhemerval Zanella Netto

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