Loads of undefined reference to `pthread_foo`

Philip Paeps philip at paeps.cx
Mon Apr 28 19:43:00 PDT 2003


On 2003-04-28 20:46:05 (-0400), Joe Marcus Clarke <marcus at marcuscom.com> wrote:
> On Mon, 2003-04-28 at 20:22, Philip Paeps wrote:
> > For some obscure reason, I can't get anything to link properly with libxml2
> > today.  I keep getting errors like:
> > 
> >   /usr/local/lib/libxml2.so: undefined reference to `pthread_cond_signal'
> >   [...]
> > 
> > I don't know what all changed on the box either, perhaps someone could
> > point me in the right direction towards debugging this, and preferably
> > fixing it :-)
> 
> libxml2 as of 2.5.7 has thread supported enabled by default.  Therefore, you
> need to link in -pthread on -STABLE or -lc_r on -CURRENT.  If you're
> building your own app, you should be using either pkg-config --libs
> libxml-2.0 or gnome-config --libs libxml-2.0 to get the libraries needed for
> libxml2.
> 
> If this is a port in the system, let me know which one is failing.

Mmm, it seems as though www/mod_php4 isn't compiling.  It's giving the same
errors as above.  From work/php4.3.1/config.log:

configure:28839: cc -o conftest -O2 -pipe  -I/usr/local/include -DHARD_SERVER_LIMIT=512 -DDOCUMENT_LOCATION="/usr/local/www/data/" -DDEFAULT_PATH="/usr/ local/bin:/bin:/usr/bin" -DACCEPT_FILTER_NAME="httpready" -DMOD_SSL=208114 -DEAPI -DEAPI_MM -DUSE_EXPAT -DNO_IDEA 
        -L/usr/local/lib 
        -R/usr/local/lib -L/usr/local/lib conftest.c -ljpeg  -lz -lz -lcrypt -lssl -lcrypto -lm  -lcrypt -lxml2 -lz -liconv -lm 1>&5 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_cond_signal' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_getspecific' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_equal' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_once' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_key_create' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_mutex_unlock' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_self' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_mutex_destroy' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_mutex_lock' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_cond_wait' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_mutex_init' 
        /usr/local/lib/libxml2.so: undefined reference to `pthread_setspecific'

[Sorry about the long line]

I'm trying to figure out where in the configure script best to add the
-pthread bit.

 - Philip

-- 
Philip Paeps                                          Please don't CC me, I am
philip at paeps.cx                                       subscribed to the list.

  You're all clear now, kid.
  Now blow this thing so we can all go home.
  		-- Han Solo


More information about the freebsd-ports mailing list