[Postgresql alpha3] Configure fails with --libxml on OpenBSD - Mailing list pgsql-testers

From postgresql@raveland.org
Subject [Postgresql alpha3] Configure fails with --libxml on OpenBSD
Date
Msg-id 20091230110717.GB15571@coredump.raveland.priv
Whole thread Raw
Responses Re: [Postgresql alpha3] Configure fails with --libxml on OpenBSD  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-testers
Hi,

I'm testing postgresql 8.5 alpha3 on OpenBSD (-current , amd64 and macppc).
The port uses the option --libxml.

With this option, I have the following error:

[...]
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... no
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no
checking for pthread-config... no
checking for the pthreads library -lpthreadGC2... no
checking for pthread.h... (cached) yes
checking for strerror_r... (cached) yes
[...]
checking thread safety of required library functions... no
configure: error: thread test program failed
This platform is not thread-safe.  Check the file 'config.log' or compile
and run src/test/thread/thread_test for the exact reason.
Use --disable-thread-safety to disable thread safety.



*OpenBSD must use -pthread.*

The config.log shows me these lines:

configure:20889: checking whether pthreads work with -pthread
configure:20984: cc -o conftest -O2 -pipe -Wall -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing -pthread  -I/usr/local/include/libxml2 -I/usr/local/include  -I/usr/local/include
-I/usr/include/kerberosV -L/usr/local/lib -L/usr/local/lib  -L/usr/local/lib conftest.c   -lxml2 -lssl -lcrypto
-lcom_err-lssl -lcrypto -lz -lreadline -ltermcap -lm  >&5 
conftest.c: In function `main':
conftest.c:154: warning: `th' might be used uninitialized in this function
/usr/local/lib/libxml2.so.11.0: warning: strcpy() is almost always misused, please use strlcpy()
/usr/local/lib/libxml2.so.11.0: warning: strcat() is almost always misused, please use strlcat()
configure:20991: $? = 0
configure:21037: result: no
[...]
configure:20941: checking for the pthreads library -lpthread
configure:20984: cc -o conftest -O2 -pipe -Wall -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing   -I/usr/local/include/libxml2 -I/usr/local/include  -I/usr/local/include -I/usr/include/kerberosV
-L/usr/local/lib -L/usr/local/lib  -L/usr/local/lib conftest.c -lpthread  -lxml2 -lssl -lcrypto -lcom_err -lssl
-lcrypto-lz -lreadline -ltermcap -lm  >&5 
conftest.c: In function `main':
conftest.c:154: warning: `th' might be used uninitialized in this function
/usr/local/lib/libxml2.so.11.0: warning: strcpy() is almost always misused, please use strlcpy()
/usr/local/lib/libxml2.so.11.0: warning: strcat() is almost always misused, please use strlcat()
configure:20991: $? = 0
configure:21037: result: no
[..]
configure:28181: checking thread safety of required library functions
configure:28214: cc -o conftest -O2 -pipe -Wall -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DIN_CONFIGURE
-I/usr/local/include/libxml2-I/usr/local/include  -I/usr/local/include -I/usr/include/kerberosV  -L/usr/local/lib
-L/usr/local/lib -L/usr/local/lib conftest.c -lxml2 -lssl -lcrypto -lcom_err -lssl -lcrypto -lz -lreadline -ltermcap
-lm  >&5 
/tmp//ccZIUQ7g.o(.text+0x56): In function `main':
: warning: strcpy() is almost always misused, please use strlcpy()
/usr/local/lib/libxml2.so.11.0: warning: strcat() is almost always misused, please use strlcat()
/tmp//ccZIUQ7g.o(.text+0xa4): In function `main':
: undefined reference to `pthread_mutex_lock'
/tmp//ccZIUQ7g.o(.text+0xb7): In function `main':
: undefined reference to `pthread_create'
/tmp//ccZIUQ7g.o(.text+0xca): In function `main':
: undefined reference to `pthread_create'
/tmp//ccZIUQ7g.o(.text+0x10b): In function `main':
: undefined reference to `pthread_mutex_unlock'
/tmp//ccZIUQ7g.o(.text+0x117): In function `main':
: undefined reference to `pthread_join'
/tmp//ccZIUQ7g.o(.text+0x123): In function `main':
: undefined reference to `pthread_join'
/tmp//ccZIUQ7g.o(.text+0x232): In function `func_call_1':
: undefined reference to `pthread_mutex_lock'
/tmp//ccZIUQ7g.o(.text+0x2e7): In function `func_call_2':
: undefined reference to `pthread_mutex_lock'
/tmp//ccZIUQ7g.o(.text+0x240): In function `func_call_1':
: undefined reference to `pthread_mutex_unlock'
/tmp//ccZIUQ7g.o(.text+0x2f5): In function `func_call_2':
: undefined reference to `pthread_mutex_unlock'
collect2: ld returned 1 exit status
configure:28218: $? = 1
configure: program exited with status 1




When I remove the option --libxml in the port, everything is ok.

checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... yes
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no
checking for the pthreads library -lpthreadGC2... no
checking for pthread.h... (cached) yes
checking for strerror_r... (cached) yes

Please note that both -pthread and -lpthread are on yes now.

And the config.log:

configure:20889: checking whether pthreads work with -pthread
configure:20984: cc -o conftest -O2 -pipe -Wall -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing -pthread   -I/usr/local/include -I/usr/include/kerberosV   -L/usr/local/lib conftest.c   -lssl
-lcrypto-lcom_err -lssl -lcrypto -lz -lreadline -ltermcap -lm  >&5 
conftest.c: In function `main':
conftest.c:152: warning: `th' might be used uninitialized in this function
configure:20991: $? = 0
configure:21037: result: yes
[...]
configure:20941: checking for the pthreads library -lpthread
configure:20984: cc -o conftest -O2 -pipe -Wall -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing -pthread    -I/usr/local/include -I/usr/include/kerberosV   -L/usr/local/lib conftest.c -lpthread
 -lssl -lcrypto -lcom_err -lssl -lcrypto -lz -lreadline -ltermcap -lm  >&5 
conftest.c: In function `main':
conftest.c:152: warning: `th' might be used uninitialized in this function
configure:20991: $? = 0
configure:21037: result: yes
[...]
configure:28181: checking thread safety of required library functions
configure:28214: cc -o conftest -O2 -pipe -Wall -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing -pthread  -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DIN_CONFIGURE
-I/usr/local/include-I/usr/include/kerberosV   -L/usr/local/lib conftest.c -lssl -lcrypto -lcom_err -lssl -lcrypto -lz
-lreadline-ltermcap -lm   -lpthread    >&5 
/tmp//ccAUpoIA.o(.text+0x56): In function `main':
: warning: strcpy() is almost always misused, please use strlcpy()
configure:28218: $? = 0
configure:28224: ./conftest
Your errno is thread-safe.
Your system has sterror_r();  it does not need strerror().
Your system has getpwuid_r();  it does not need getpwuid().
Your system has getaddrinfo();  it does not need gethostbyname()
  or gethostbyname_r().

Your platform is thread-safe.
configure:28228: $? = 0
configure:28230: result: yes


I don't understand why the detection of both -pthread and -lpthread fails with --libxml (may
the messages about strcpy/strcat be the cause) ?

Regards,


pgsql-testers by date:

Previous
From: Greg Smith
Date:
Subject: Re: alpha2 initdb PG_CONTROL_VERSION incompatibility?
Next
From: Aioanei Rares
Date:
Subject: [Fwd: "pg_regress: initdb failed" with git tree]