This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
O.T. linux thread library question
- From: Robert Schweikert <rjschwei at cox dot net>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 28 Mar 2002 22:10:39 -0500
- Subject: O.T. linux thread library question
Sorry for being O.T., but I hope someone can help.
There is a bug in the linuxthread library that comes with glibc-2.2.4,
which is used for the SuSE 7.3 distribution. The problem is a race
condition when one call pthread_key_delete(). The problem has been fixed
in glibc-2.2.5. Thus I figured I can just compile the thread library
from 2.2.5 and use it. But that didn't work as expected.
Here is what I did.
- build glibc-2.2.5 and ran make check; no complaints
- renamed libpthread.so from the linuxthreads directory to libnew_pthread.so
- stored the new library somewhere and tried to link against it instead
of the system pthread library, this fails
I used g++ -D_REENTRANT ..... -L/pathToTheNewLibrary -lnew_pthread
but when I use ldd on the resulting executable I still see linkage to
the system pthread library instead of the new library. Also odd is that
ldd on the new library produces an error.
/usr/bin/ldd: ./libnew_pthread.so: No such file or directory
while ldd on the system pthread library produces sensible output.
-> ldd libpthread.so
libc.so.6 => /lib/libc.so.6 (0x40026000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
The new thread library is recognized as a library
-> file libnew_pthread.so
libnew_pthread.so: ELF 32-bit LSB shared object, Intel 80386, version 1,
not stripped
Since I cannot depend on every user installing the latest version of the
thread library and I don't want my code to crash I would like to package
the new library with my app and set the LD_LIBRARY_PATH such that at
runtime the new library is found. However, since I cannot get the
linkage to the new library working this is a moot point.
Any help on how to get this working is much appreciated.
Thanks,
Robert
--
Robert Schweikert MAY THE SOURCE BE WITH YOU
rjschwei@cox.net LINUX