This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ct-ng: compiling ldd with glibc


Dan, All,

On Sunday 18 July 2010 17:54:00 Dan Jordan wrote:
> I'm trying to find a way to compile ldd to using crosstool-NG and glibc.
> I'm compiling a toolchain using version 1.7.0 of crosstool-NG, with glibc to arm 
> architechture. (for example, to the arm-unknown-linux-eabi configuration).

ldd is a run-time tool, not a build-time tool.

What ldd does can *not* be done on the build host, as it requires the
actual dynamic linker to be able to _run_.

So, simple hope to have a _real_ cross-ldd is desperate, there's no such thing
as a _real_ cross-ldd.

> I've seen that you can configure crosstool-NG to build ldd if you are using 
> uClibc, but not if you're using glibc.

Yes, but I'm not sure how it behaves, and what it does...

> I've seen a post?(http://sourceware.org/ml/crossgcc/2008-11/msg00010.html)? that 
> supplied some sort of a workaround using readelf, but does not supply a full 
> solution.

Yes, basically, what such a script would do is:
- expect to be given a directory to treat as the rootfs
  - from that directory, scan /etc/ld.co.conf et al.
  - extract a library search path from that
- scan the specified file with readelf, and extract the NEEDED tags
  - scan the library search path (above) for those NEEDED libs
  - for each library found
    - print the (relative?) path
    - recurse with readelf for NEEDED tags
  - for missing libs, say so

The script could (try to) interprt LD_LIBRARY_PATH, LD_PRELOAD and
all the fuss. That's non-trivial, but not impossible (except for the
LD_PRELOAD, maybe). And it will *not* be a true replacement for a
reall ldd that runs on the target.

Maybe I bang on such a beast tonight, the issue comes up often, and
it is time that we have such script. But if it turns out to be too
complex, then f*ck, we'll live with out that, and it's going in
docs/known-issues.txt...

> My question is: is there a way to build a full-featured cross-ldd using glibc 
> using crosstool-NG? If so, how? If not, why?

I hope I was clear enough in the above to answer those questions. ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]