libxml doesn’t compile

The latest CVS version of libxml2 doesn't build. Linking fails with messages:

../../.libs/libxml2.so: undefined reference to `pthread_getspecific'
../../.libs/libxml2.so: undefined reference to `pthread_once'
../../.libs/libxml2.so: undefined reference to `pthread_key_create'
../../.libs/libxml2.so: undefined reference to `pthread_setspecific'

It seems I'm not alone. Here is a message form the libxml2 mailing list: "Linker error Compiling off the HEAD".

The sad thing is that it will not be fixed for some time: Re: Linker error Compiling off the HEAD:

... and I don't have a complete solution. Probably need a compiler portability expert input to get it right...

My workaround is bad. In several Makefiles (Makefile, doc/examples/Makefile, example/Makefile), I changes the line

LDADDS =  $(top_builddir)/libxml2.la  -lz $(ICONV_LIBS) -lm 

to

LDADDS =  $(top_builddir)/libxml2.la  -lz $(ICONV_LIBS) -lm -lpthread 

Similar actions are required for libxslt (in xsltproc/Makefile).

Categories:

Updated: