CVS tip compiler error with --enable-thread-safety - Mailing list pgsql-hackers

From Shridhar Daithankar
Subject CVS tip compiler error with --enable-thread-safety
Date
Msg-id 200405301908.08251.shridhar@frodo.hserus.net
Whole thread Raw
Responses Re: CVS tip compiler error with --enable-thread-safety
List pgsql-hackers
Hi,

Platform Slackware linux 9.1/ Linux 2.6.4

I did a make distclean and ./configure --enable-thread-safety. The build 
aborted with following error messages

make[4]: Leaving directory `/home/shridhar/postgresql/pgsql/src/port'
gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations 
-DFRONTEND -I../../../src/interfaces/libpq -I../../../src/include 
-D_GNU_SOURCE   -c -o initdb.o initdb.c
rm -f exec.c && ln -s ../../../src/port/exec.c .
gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations 
-DFRONTEND -I../../../src/interfaces/libpq -I../../../src/include 
-D_GNU_SOURCE   -c -o exec.o exec.c
gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations 
initdb.o exec.o -L../../../src/interfaces/libpq -lpq -L../../../src/port  
-Wl,-rpath,/usr/local/pgsql/lib -lz -lreadline -ltermcap -lcrypt -lresolv 
-lnsl -ldl -lm  -lpgport -o initdb
../../../src/interfaces/libpq/libpq.so: undefined reference to 
`pthread_getspecific'
../../../src/interfaces/libpq/libpq.so: undefined reference to `pthread_once'
../../../src/interfaces/libpq/libpq.so: undefined reference to 
`pthread_key_create'
../../../src/interfaces/libpq/libpq.so: undefined reference to 
`pthread_setspecific'
collect2: ld returned 1 exit status
make[3]: *** [initdb] Error 1
make[3]: Leaving directory `/home/shridhar/postgresql/pgsql/src/bin/initdb'

The relevant configure messages read 
-------------
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
-------------

Here is relevant portion of src/Makefile.global

-------------
PTHREAD_CFLAGS        = -pthread -D_REENTRANT -D_THREAD_SAFE 
-D_POSIX_PTHREAD_SEMANTICS
PTHREAD_LIBS        = 
LIBS = -lz -lreadline -ltermcap -lcrypt -lresolv -lnsl -ldl -lm 
-------------

It worked after I manually added -lpthread to LIBS and did a make clean;make

RegardsShridhar


pgsql-hackers by date:

Previous
From: Shridhar Daithankar
Date:
Subject: Converting postgresql.conf parameters to kilobytes
Next
From: Bruce Momjian
Date:
Subject: Re: CVS tip compiler error with --enable-thread-safety