This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: pthread issue on OpenSUSE 10
- From: Ian Lance Taylor <iant at google dot com>
- To: Dima Rusyy <dima dot ru dot com at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: 28 Mar 2007 07:31:11 -0700
- Subject: Re: pthread issue on OpenSUSE 10
- References: <9714184.post@talk.nabble.com>
Dima Rusyy <dima.ru.com@gmail.com> writes:
> I am working on an application that uses gcc-2.95 libs.
You know that 2.95 is really old, right?
> When linking I got the following error:
> ------------
> ../gcc-2.95/lib/libstdc++.a(isgetline.o): In function `istream::getline(char
> *, int, char)':
> ../gcc-2.95/linux/i686-pc-linux-gnu/libio/../../../gcc-2.95.3/libio/isgetline.cc:41:
> undefined reference to `_pthread_cleanup_push_defer(_pthread_cleanup_buffer
> *, void (*)(void *), void *)'
It looks like this may come from libio/config/linuxapi1-libc-lock.h:
#define __libc_cleanup_region_start(FCT, ARG) \
{ struct _pthread_cleanup_buffer _buffer; \
if (_pthread_cleanup_push_defer != NULL) { \
_pthread_cleanup_push_defer (&_buffer, (FCT), (ARG)); \
}
The problem would seem to be that the function is getting called as a
C++ function rather than a C function. Perhaps it was once declared
in pthread.h but no longer is. It may work to add something like this
to linuxapi1-libc-lock.h:
extern "C" void _pthread_cleanup_push_defer
(struct _pthread_cleanup_buffer *, void (*)(void *), void*);
Ian