Re: Thread safety and libxml2 - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Thread safety and libxml2
Date
Msg-id 201002190041.o1J0fjL19819@momjian.us
Whole thread Raw
In response to Re: Thread safety and libxml2  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Thread safety and libxml2
List pgsql-hackers
Peter Eisentraut wrote:
> On ons, 2009-12-30 at 12:55 -0500, Greg Smith wrote:
> > Basically, configure failed on their OpenBSD system because thread
> > safety is on but the libxml2 wasn't compiled with threaded support:
> > http://xmlsoft.org/threads.html
> >
> > Disabling either feature (no --with-libxml or --disable-thread-safety)
> > gives a working build.
>
> This could perhaps be fixed by excluding libxml when running the thread
> test.  The thread result is only used in the client libraries and libxml
> is only used in the backend, so those two shouldn't meet each other in
> practice.

The attached patch removes "-lxml2" from the link line of the thread
test program.  Comments?  Can anyone test this fixes the OpenBSD
problem?

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: configure
===================================================================
RCS file: /cvsroot/pgsql/configure,v
retrieving revision 1.671
diff -c -c -r1.671 configure
*** configure    17 Feb 2010 04:19:36 -0000    1.671
--- configure    19 Feb 2010 00:40:05 -0000
***************
*** 28593,28599 ****
  _CFLAGS="$CFLAGS"
  _LIBS="$LIBS"
  CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
! LIBS="$LIBS $PTHREAD_LIBS"
  if test "$cross_compiling" = yes; then
    { $as_echo "$as_me:$LINENO: result: maybe" >&5
  $as_echo "maybe" >&6; }
--- 28593,28601 ----
  _CFLAGS="$CFLAGS"
  _LIBS="$LIBS"
  CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
! # On OpenBSD, libxml2 is not thread-safe, but it is not used in the backend
! # 2010-02-18
! LIBS=`echo "$LIBS" | sed 's/-lxml2 //'`"$PTHREAD_LIBS"
  if test "$cross_compiling" = yes; then
    { $as_echo "$as_me:$LINENO: result: maybe" >&5
  $as_echo "maybe" >&6; }
Index: configure.in
===================================================================
RCS file: /cvsroot/pgsql/configure.in,v
retrieving revision 1.623
diff -c -c -r1.623 configure.in
*** configure.in    17 Feb 2010 04:19:37 -0000    1.623
--- configure.in    19 Feb 2010 00:40:10 -0000
***************
*** 1746,1752 ****
  _CFLAGS="$CFLAGS"
  _LIBS="$LIBS"
  CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
! LIBS="$LIBS $PTHREAD_LIBS"
  AC_TRY_RUN([#include "$srcdir/src/test/thread/thread_test.c"],
    [AC_MSG_RESULT(yes)],
    [AC_MSG_RESULT(no)
--- 1746,1754 ----
  _CFLAGS="$CFLAGS"
  _LIBS="$LIBS"
  CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
! # On OpenBSD, libxml2 is not thread-safe, but it is not used in the backend
! # 2010-02-18
! LIBS=`echo "$LIBS" | sed 's/-lxml2 //'`"$PTHREAD_LIBS"
  AC_TRY_RUN([#include "$srcdir/src/test/thread/thread_test.c"],
    [AC_MSG_RESULT(yes)],
    [AC_MSG_RESULT(no)

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: alpha4 timing
Next
From: David Fetter
Date:
Subject: Re: PGXS: REGRESS_OPTS=--load-language=plpgsql