From owner-freebsd-threads@FreeBSD.ORG Fri Apr 22 15:02:07 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 510B916A4CE for ; Fri, 22 Apr 2005 15:02:07 +0000 (GMT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FE1943D48 for ; Fri, 22 Apr 2005 15:02:07 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.30.114.143]) by comcast.net (rwcrmhc12) with ESMTP id <2005042215020601400php5pe>; Fri, 22 Apr 2005 15:02:06 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.127.in-addr.arpa [127.0.0.1])j3MF2AGs033899; Fri, 22 Apr 2005 11:02:10 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)j3MF2Ata033898; Fri, 22 Apr 2005 11:02:10 -0400 (EDT) (envelope-from rodrigc) Date: Fri, 22 Apr 2005 11:02:09 -0400 From: Craig Rodrigues To: Archie Cobbs Message-ID: <20050422150209.GA33838@crodrigues.org> References: <42641308.3060900@dellroad.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42641308.3060900@dellroad.org> User-Agent: Mutt/1.5.9i cc: freebsd-threads@freebsd.org Subject: Re: Bug with pthread_getspecific() and signals X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2005 15:02:07 -0000 On Mon, Apr 18, 2005 at 03:05:28PM -0500, Archie Cobbs wrote: > So perhaps the simplest thing to do is look for libpthread and always > link "-lpthread"; otherwise, if libpthread is not found, bail out. That's a reasonable approach. Alternatively, if you want, look at the devel/apr port (which I maintain). I had to put some logic in there in the configure scripts to link to the correct pthread library, depending if you are on 4.x or 5.x. Basically, what I have logic that does something like: os_version=`/sbin/sysctl -n kern.osreldate` # 502102 is when libc_r switched to libpthread (aka libkse). if test $os_version -ge "502102"; then apr_cv_pthreads_cflags="none" apr_cv_pthreads_lib="-lpthread" else APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE -D_REENTRANT]) apr_cv_pthreads_lib="-lc_r" APR_SETIFNULL(enable_threads, [no]) fi In my opinion, when libc_r is removed from the tree in -CURRENT, that will be good, because people still try to use it, and then get annoyed when they encounter problems with it. It can't disappear in the 4.x branch though.... -- Craig Rodrigues rodrigc@crodrigues.org