libpthread problem (segfaults)
Benjamin Lutz
benlutz at datacomm.ch
Wed Jun 1 11:56:48 PDT 2005
> No, gcc (the linker really) is doing exactly what you are
> telling it. The linker already brings in libc, you have
> to use -nostdlib to prevent it. You must link to objects
> in the correct order. libpthread, libthr, and libc_r all
> provide some functions that are overloaded from libc.
> When you link to libc first, you get the libc versions of
> those functions instead of the thread versions of them.
Ah, thanks! That makes sense now! I had assumed it somehow links libc
twice, but if it's really an order issue, all becomes clear!
>>And, something in the 5.3->5.4 upgrade process went wrong which left me
>>with a broken libpthread. Can't say what exactly, maybe my system was
>>slightly broken to begin with.
>
> libpthread ain't broke; your applications are probably linked
> incorrectly.
I'm not saying the code is broken, just my binaries. I've now replaced
them with files from a clean installation, and all is well.
Cheers
Benjamin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 186 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20050601/949ee12a/signature.bin
More information about the freebsd-stable
mailing list