Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Apr 2005 11:02:09 -0400
From:      Craig Rodrigues <rodrigc@crodrigues.org>
To:        Archie Cobbs <archie@dellroad.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: Bug with pthread_getspecific() and signals
Message-ID:  <20050422150209.GA33838@crodrigues.org>
In-Reply-To: <42641308.3060900@dellroad.org>
References:  <Pine.GSO.4.43.0504181417400.58-100000@sea.ntplx.net> <42641308.3060900@dellroad.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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


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