From owner-freebsd-ports@FreeBSD.ORG Tue Jun 8 07:40:48 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6105C16A4CE; Tue, 8 Jun 2004 07:40:48 +0000 (GMT) Received: from mail.mcneil.com (rrcs-west-24-199-45-54.biz.rr.com [24.199.45.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3916F43D48; Tue, 8 Jun 2004 07:40:48 +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 6B6E6FD031; Tue, 8 Jun 2004 00:40:47 -0700 (PDT) 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 00672-01; Tue, 8 Jun 2004 00:40:46 -0700 (PDT) Received: from [24.199.45.54] (mcneil.com [24.199.45.54]) by mail.mcneil.com (Postfix) with ESMTP id 96446FD02E; Tue, 8 Jun 2004 00:40:46 -0700 (PDT) From: Sean McNeil To: Daniel Eischen In-Reply-To: References: Content-Type: text/plain Message-Id: <1086680446.1060.3.camel@server.mcneil.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 08 Jun 2004 00:40:46 -0700 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mcneil.com cc: ports@freebsd.org cc: Dan Nelson cc: John Birrell cc: freebsd-threads@freebsd.org Subject: Re: weak implementation of threads has problems - kse fix attached X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2004 07:40:48 -0000 On Mon, 2004-06-07 at 22:34, Daniel Eischen wrote: > On Tue, 8 Jun 2004, John Birrell wrote: > > > [ cross-post lists cut back, ports added 8-) ] > > > > On Mon, Jun 07, 2004 at 11:48:45PM -0500, Dan Nelson wrote: > > > A good addition to bsd.port.mk, right next to the "possible network > > > server" etc checks, might be to run ldd on all installed shared > > > libraries and print a warning if any threads libraries show up. There > > > are a huge number of ports that install shlibs linked to libpthreads. > > > > Good idea. > > Just picking a message at random to reply to... > > In case anyone wonders why we don't use strong references, I chose to > mimic what Solaris does: > > bash-2.05$ nm /lib/libpthread.so.1 | grep pthread_mutex_lock > 0000000000003c80 T _pthread_mutex_lock > 0000000000003c80 W pthread_mutex_lock > > bash-2.05$ nm /lib/libc.so.1 | grep pthread_mutex_lock > 0000000000096c38 W _pthread_mutex_lock > 0000000000096c38 W pthread_mutex_lock > > It is also easy to provide your own version of pthread_foo() without > having any strong references override it. OK, that is what I was wondering. In that case, you have failed to mimic Solaris: [sean@wrsparc sean]$ uname -a SunOS wrsparc.mcneil.com 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-5_10 [sean@wrsparc sean]$ nm /lib/libpthread.so.1 | grep select [201] | 21328| 8|FUNC |GLOB |0 |8 |select [sean@wrsparc sean]$ nm /lib/libc.so.1 | grep select [213] | 320732| 1420|FUNC |LOCL |0 |12 |_libc_select [4534] | 320732| 1420|FUNC |GLOB |0 |12 |_select [3556] | 320732| 1420|FUNC |WEAK |0 |12 |select [1385] | 0| 0|FILE |LOCL |0 |ABS |select.c [4404] | 322152| 1920|FUNC |GLOB |0 |12 |select_large_fdset [1387] | 0| 0|FILE |LOCL |0 |ABS |select_large_fdset.c Same thing with open or any of the other libc functions. That is why Solaris works correctly and FreeBSD does not.