This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
970917 libio has undefined pthread references with Linux/glibc2
- To: egcs-bugs at cygnus dot com
- Subject: 970917 libio has undefined pthread references with Linux/glibc2
- From: Derek Upham <sand at celia dot serv dot net>
- Date: 21 Sep 1997 19:12:46 -0000
- Reply-To: sand at celia dot serv dot net
On a Linux system with glibc 2.0.5, the "libio/config/linux.mt"
configuration file sets up the build to use "-D_IO_MTSAFE_IO". When
this value is defined, "iostream.cc" and "osform.cc" use the pthread
routines "pthread_cleanup_pop_restore" and "pthread_cleanup_push_defer"
internally. These become undefined references in the object files.
When linking against "libstdc++", these references are still undefined,
and the linker exits with an error. The only way to successfully link
a program using "libstdc++" is to add "-lpthread" to the link acommand.
This is probably not acceptable in the long term. Removing the
"IO_MTSAFE_IO" definition is a temporary workaround for people not
using multi-threading. The best solution to the problem is unclear.
Derek
--
Derek Upham
sand@celia.serv.net http://www.serv.net/~sand
"Ha! Your Leaping Tiger Kung Fu is no match for my Frightened Piglet style!"