![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
System Configuration --------------------- Architecture (example: Intel Pentium) : Intel Pentium Operating System (example: Linux 2.4.18) : Linux 2.4.21-grsec (Debian) PostgreSQL version (example: PostgreSQL-8.0): PostgreSQL-8.0.0-beta1 Compiler used (example: gcc 2.95.2) : 2.95.4 Please enter a FULL description of your problem: ------------------------------------------------ When configuring --enable-thread-safety the binaries cannot be linked: gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations initdb.o dirmod.o exe c.o -L../../../src/interfaces/libpq -lpq -L../../../src/port -Wl,-rpath,/opt/postgresql-800beta1/li b -lpgport -lz -lreadline -lcrypt -lresolv -lnsl -ldl -lm -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 Please describe a way to repeat the problem. Please try to provide a concise reproducible example, if at all possible: ---------------------------------------------------------------------- # ./configure --prefix=3D/opt/postgresql-800beta1 --enable-thread-safety # make If you know how this problem might be fixed, list the solution below: --------------------------------------------------------------------- The binaries must be linked with pthread (-lpthread). |
#3
| |||
| |||
|
|
On Tuesday 10 August 2004 05:14, Martin M?nstermann wrote: System Configuration --------------------- Architecture (example: Intel Pentium) : Intel Pentium Operating System (example: Linux 2.4.18) : Linux 2.4.21-grsec (Debian) PostgreSQL version (example: PostgreSQL-8.0): PostgreSQL-8.0.0-beta1 Compiler used (example: gcc 2.95.2) : 2.95.4 Please enter a FULL description of your problem: ------------------------------------------------ When configuring --enable-thread-safety the binaries cannot be linked: gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations initdb.o dirmod.o exe c.o -L../../../src/interfaces/libpq -lpq -L../../../src/port -Wl,-rpath,/opt/postgresql-800beta1/li b -lpgport -lz -lreadline -lcrypt -lresolv -lnsl -ldl -lm -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 Please describe a way to repeat the problem. Please try to provide a concise reproducible example, if at all possible: ---------------------------------------------------------------------- # ./configure --prefix=/opt/postgresql-800beta1 --enable-thread-safety # make If you know how this problem might be fixed, list the solution below: --------------------------------------------------------------------- The binaries must be linked with pthread (-lpthread). Can you take a look at the thread below and report back if that fixes your problem? http://archives.postgresql.org/pgsql...8/msg00525.php -- Robert Treat Build A Better Lamp :: Linux Apache {middleware} PostgreSQL ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend |
#4
| |||
| |||
|
|
`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 Please describe a way to repeat the problem. Please try to provide a concise reproducible example, if at all possible: ---------------------------------------------------------------------- # ./configure --prefix=/opt/postgresql-800beta1 --enable-thread-safety # make If you know how this problem might be fixed, list the solution below: --------------------------------------------------------------------- The binaries must be linked with pthread (-lpthread). Can you take a look at the thread below and report back if that fixes your problem? http://archives.postgresql.org/pgsql...8/msg00525.php |
#5
| |||
| |||
|
|
Hello! Bruce Momjian wrote: Robert Treat wrote: `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 Please describe a way to repeat the problem. Please try to provide a concise reproducible example, if at all possible: ---------------------------------------------------------------------- # ./configure --prefix=/opt/postgresql-800beta1 --enable-thread-safety # make If you know how this problem might be fixed, list the solution below: --------------------------------------------------------------------- The binaries must be linked with pthread (-lpthread). Can you take a look at the thread below and report back if that fixes your problem? http://archives.postgresql.org/pgsql...8/msg00525.php Yes, adding -lpthread to PTHREAD_LIBS and rebuilding solved the problem. Note: when doing so, libpq.so is built with -lpthread, PTHREAD_LIBS is *not* used in the makefiles of the client binaries like initdb and psql. I looked at that. The line that does the tests is in config/acx_pthread.m4: acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-conf ig" so you should see that list tried. Does that help? I am majorly concerned that Slackware has the same problem as Unixware, meaning that if you use threading in the lib, you now need the flags on every applicaiton that uses the lib. At least on debian this is not the case (see above): -lpthread is used when building libpq.so.3.2. So the shared library contains a dependency on libpthread.so. Then the client apps do not need a -lpthread at build time. The dynamic linker will resolve the dependency on libpthread.so (via libpq.so) at runtime. Regards, Martin |
#6
| |||
| |||
|
|
OK, I have some more information. Basically, the config/acx_pthread.m4 manual page (http://www.gnu.org/software/ac-archi...acx_pthread.h= tml) says: =09 NOTE: You are assumed to not only compile your program with these flags, but also link it with them as well. e.g. you should link with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS meaning if -lpthread is defined in PTHREAD_CFLAGS, it also has to be included in the link. Now, from your reports you said -lpthread was in PTHREAD_CFLAGS, so why isn't it also included in the libpq link line. I need to see your link line output for libpq. |
#7
| |||
| |||
|
|
Robert Treat wrote: `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 Please describe a way to repeat the problem. Please try to provide a concise reproducible example, if at all possible: ---------------------------------------------------------------------- # ./configure --prefix=/opt/postgresql-800beta1 --enable-thread-safety # make If you know how this problem might be fixed, list the solution below: --------------------------------------------------------------------- The binaries must be linked with pthread (-lpthread). Can you take a look at the thread below and report back if that fixes your problem? http://archives.postgresql.org/pgsql...8/msg00525.php |
|
I looked at that. The line that does the tests is in config/acx_pthread.m4: acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-conf ig" so you should see that list tried. Does that help? I am majorly concerned that Slackware has the same problem as Unixware, meaning that if you use threading in the lib, you now need the flags on every applicaiton that uses the lib. |
![]() |
| Thread Tools | |
| Display Modes | |
| |