From owner-freebsd-current@FreeBSD.ORG Mon Nov 15 00:07:57 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F58F16A4CE; Mon, 15 Nov 2004 00:07:57 +0000 (GMT) Received: from mail.mcneil.com (mcneil.com [24.199.45.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32C0543D1D; Mon, 15 Nov 2004 00:07:57 +0000 (GMT) (envelope-from sean@mcneil.com) Received: from localhost (localhost.mcneil.com [127.0.0.1]) by mail.mcneil.com (Postfix) with ESMTP id C5942F2077; Sun, 14 Nov 2004 16:07:54 -0800 (PST) Received: from mail.mcneil.com ([127.0.0.1]) by localhost (server.mcneil.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 98808-05; Sun, 14 Nov 2004 16:07:46 -0800 (PST) Received: from mcneil.com (mcneil.com [24.199.45.54]) by mail.mcneil.com (Postfix) with ESMTP id 763C8F1802; Sun, 14 Nov 2004 16:07:46 -0800 (PST) From: Sean McNeil To: Daniel Eischen In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-aZWYRMzwF80bujqZbo62" Date: Sun, 14 Nov 2004 16:07:46 -0800 Message-Id: <1100477266.89074.15.camel@server.mcneil.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 FreeBSD GNOME Team Port X-Virus-Scanned: by amavisd-new at mcneil.com cc: current@freebsd.org Subject: Re: missing weak symbol for pthread_equal in libc X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2004 00:07:57 -0000 --=-aZWYRMzwF80bujqZbo62 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 2004-11-14 at 18:46 -0500, Daniel Eischen wrote: > On Sun, 14 Nov 2004, Sean McNeil wrote: >=20 > > > > I think pthread_equal should be added to libc. I found it is used in > > libxml2 and a link to that library fails without -pthread. >=20 > The pthread_foo() in libc are mainly for libc usage. If applications > want to use pthread_foo(), they really should be linking to the (a) > threads library. Look at it this way -- if we didn't use any pthread > functions in libc, there wouldn't be _any_ pthread stubs in libc. > Also, we could have used __libc_lock(), __libc_unlock(), etc, in > libc and have the threads libraries override those functions instead > of using _pthread_*(). >=20 > pthread_equal() would be kinda harmless in libc, but you get my > point above, no? After some thought, I agree as pthread_equal is not used within libc, but this brings up the question as to why there are any pthread_* symbols in libc. This is kind of a sore point for me. I actually believe that there should be no weak symbols of pthread_* in libc. A program that uses pthread_cond_init, for example, should not compile without the pthread library. weak symbols to the _pthread_* functions are fine as they are required to provide thread-safe functionality within libs. IMHO, it should be setup as follows: 1) libpthread.so has routines _pthread_* and references as pthread_* (I think they should be strong, but others think weak ;-) - suppose to be funny, not offensive). 2) libc.so accesses those (_pthread_*) functions and has weak symbols for the ones it use to work without libpthread. --=-aZWYRMzwF80bujqZbo62 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBl/NSyQsGN30uGE4RAvChAJ9qyFQR3hMbn8UZFv9btR6Eed6hfQCePV5E fo9SY4UFwYVjoh8evRVlhPA= =h5VB -----END PGP SIGNATURE----- --=-aZWYRMzwF80bujqZbo62--