[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] libxml2 and threads

From: Vadim Zeitlin
Subject: Re: [lmi] libxml2 and threads
Date: Wed, 20 Jan 2016 18:52:21 +0100

On Wed, 20 Jan 2016 17:37:52 +0000 Greg Chicares <address@hidden> wrote:

GC> Although you were talking about cross-compiling, I've encountered an
GC> apparently similar problem with MinGW-w64 gcc-4.9.2 .

 Our emails must have just crossed because I mentioned that I was getting
it two in a post less than 10 minutes ago.

GC> Here's the error I get:
GC> /bin/sh ./libtool --tag=CC --mode=compile /MinGW_/bin/gcc -DHAVE_CONFIG_H 
-I. -I. -I. -I./include -I./include  -DHAVE_WIN32_THREADS -D_REENTRANT    
-DWIN32  -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type 
-Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized 
-Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings 
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs 
-Winline -Wredundant-decls -c -o threads.lo threads.c
GC>  /MinGW_/bin/gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include 
-DHAVE_WIN32_THREADS -D_REENTRANT -DWIN32 -g -O2 -pedantic -W -Wformat -Wunused 
-Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat 
-Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith 
-Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes 
-Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -c threads.c  
-DDLL_EXPORT -DPIC -o .libs/threads.o
GC> threads.c: In function 'xmlOnceInit':
GC> threads.c:788:10: error: 'run_once' undeclared (first use in this function)
GC>      if (!run_once.done) {
GC>           ^
GC> ...
GC> install_libxml2_libxslt.make:146: recipe for target 
'libxml2/2.6/libxml2-2.6.26' failed
GC> make: *** [libxml2/2.6/libxml2-2.6.26] Error 2
GC> I'll retry it with '--without-threads'.

 It will work but, at least here, I also had to use --without-zlib to make
it work during run-time as well as compile.

GC> But let me ask a question about
GC> this error message now, just because I looked at the source code and
GC> would like to understand what went wrong.
GC> #elif defined HAVE_WIN32_THREADS
GC> ...
GC> static DWORD mainthread;
GC> static struct
GC> {
GC>     DWORD done;
GC>     DWORD control;
GC> } run_once = { 0, 0 };
GC> /* endif HAVE_WIN32_THREADS */
GC> This library built successfully with mingw.org gcc-3.4.5 . What changed?
GC> Is it that 'struct {...} foo = {...}' was legal C once, but is no longer?
GC> Or is it that HAVE_WIN32_THREADS wasn't defined for gcc-3.4.5, so we never
GC> actually compiled this block before? Just curious--this isn't worth a lot
GC> of research.

 With 3.4, there is no pthread.h and so HAVE_PTHREAD_H is not set. 4.9 does
provide pthreads [emulation?], which is not a bad thing on its own, but
exposes a bug in the ancient libxml2 we use.

GC> I'll commit a change to add '--without-threads' anyway.

 This is a good temporary fix, but I still strongly believe that we should
update to a more recent libxml2 version and undo this fix. Whatever you can
think about libxml2, it's pretty good at not breaking compatibility, so we
should be able to upgrade without any problems at all and get not only the
fix for this problem, but also many, many other ones, including several
security bug fixes that were found in libxml2 over the years.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]