[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pthreads and etrax 100 LX



> From: "Pieter Grimmerink" <mailinglists@xxxxxxx.nl>
> Date: Sun, 18 Nov 2001 00:18:55 +0100

> But when I try to run the application on the target, I still get a missing
> libpthread.so.0 reported.

How did the application get to the devboard_lx?  As part of the
flash image, or "manually" uploaded (for example via ftp)?  I'll
assume you manually uploaded it during development, and that you
eventually want to put it there as part of the flash image.

If you're copying manually, a few more steps are needed.
Whenever debugging a program which is the unique user of a DSO
(like in this case, with libpthread.so.0), it might be useful to
know that you can copy the DSO manually too and access it
outside of /lib.  For example, ftp the program and the DSO to
/tmp and after chmod'ing the executable bit on the program (that
ftp incorrectly strips off), run the program with
"LD_LIBRARY_PATH=/tmp ./program".

> What would be the exact way to get pthreads working without having to
> statically
> link glibc as well?

You need to make the "install" rule in your application put the
program somewhere in the directory hierarchy rooted at
(devboard_lx-R2_0_0/axis/)devboard_lx/eroot, like
devboard_lx/eroot/bin.

Then the images rule (or rather, the cramfs.img rule executed
when doing "make images") in devboard_lx/Makefile will inspect
the program and find the dependency on libpthread.so.0 and
automatically add libpthread.so.0 in devboard_lx/eroot/lib.  See
for example the install rule in devboard_lx/apps/ipsetd/Makefile.

brgds, H-P