Confusion about threadlibs?

walt wa1ter at
Sun Jan 20 10:35:48 PST 2008

On Thu, 17 Jan 2008, Simon 'corecode' Schubert wrote:

> walt wrote:
> > > > Loaded symbols for /usr/lib/    <========== huh?
> > > >
> > > > Wait just a minute -- what is libthread_xu doing there?  I'm using
> > > > libc_r, not xu:

> > > somebody insists to link to libthread_xu.  maybe one of the libs, maybe
> > > the
> > > perl build itself.  try a ldd on all involved binaries.
> >
> > # readelf -d /usr/lib/
> > Dynamic section at offset 0x620 contains 20 entries:
> >   Tag        Type                         Name/Value
> >  0x00000001 (NEEDED)                     Shared library: []
> >
> > Maybe?

> No, that's okay.  Nobody is using on execution, but only
>, so keep searching :)

Hmm.  Let me explain why I don't quite believe that.

The miniperl compiled during the build and the previously installed
/usr/pkg/bin/perl were *both* linked against lib_xu, even though was symlinked to libc_r.  (The only way I got perl
installed in the first place was to have linked to
lib_xu, and afterwards I switched the link back to libc_r.)

As an experiment I symlinked to and then
moved lib_xu out of the way so the loader couldn't find it.  Seems
to me this *should* work because is still pointing
to a valid threadlib (libc_r).  But it doesn't work:  trying to link
miniperl that way, I get complaints that 'pthread_atfork' is missing
and that symbol is defined only in lib_xu.

To test if it really is okay for to be linked against
lib_xu, I used hexedit to remove the reference to it in the actual binary.  (Really, I edited the reference to point to
libbluetooth, just because the name is exactly the same length :o)

Now I can build perl using either threadlib, and neither miniperl
nor perl is linked (permanently) against lib_xu.

Could very well be that I just don't understand any of this, but
so far it seems to be working well.  Can you suggest any tests I
should do to see if my modified will cause problems?

Thanks for the help!

More information about the Bugs mailing list