Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Jun 2005 20:56:41 +0200
From:      Benjamin Lutz <benlutz@datacomm.ch>
To:        Daniel Eischen <deischen@freebsd.org>
Cc:        freebsd-stable@freebsd.org, Brent Casavant <b.j.casavant@ieee.org>
Subject:   Re: libpthread problem (segfaults)
Message-ID:  <429E04E9.5020008@datacomm.ch>
In-Reply-To: <Pine.GSO.4.43.0506011437420.9884-100000@sea.ntplx.net>
References:  <Pine.GSO.4.43.0506011437420.9884-100000@sea.ntplx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig79BF18CE206347F128D2CC30
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

> 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


--------------enig79BF18CE206347F128D2CC30
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFCngTtgShs4qbRdeQRAo5XAKCGS7x7yJFGn+/wuNHCHQqYjkqyPACeI33X
krANLzjGFrhLffHspql9pLM=
=Khrj
-----END PGP SIGNATURE-----

--------------enig79BF18CE206347F128D2CC30--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?429E04E9.5020008>