bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pthreads inline functions break libgcc_s.so


From: Jeroen Dekkers
Subject: pthreads inline functions break libgcc_s.so
Date: Thu, 22 Jul 2004 23:51:38 +0200
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

Michael Banck reported on IRC that the libgcc_s.so of the gcc 3.4
debian packages fail with the following error:
/lib/libgcc_s.so: undefined reference to `_pthread_mutex_lock'

objdump -T /lib/libgcc_s.so | grep pthread gives the following:

23:19 < azeem> 00000000      D  *UND*  00000000              _pthread_mutex_lock
23:19 < azeem> 00000000  w   D  *UND*  00000000              pthread_create
23:19 < azeem> 00000000  w   D  *UND*  00000000              pthread_once
23:19 < azeem> 00000000  w   D  *UND*  00000000              
pthread_mutex_unlock

The problem here is that gcc declares all the pthread functions weak
with a #pragma weak. When calling pthread_mutex_lock() however, the
inline function from /include/bits/mutex.h
(libpthread/sysdeps/generic/bits/mutex.h in the Hurd sources) is
used. This inline function calls _pthread_mutex_lock, which of course
isn't declared weak by gcc.

I think we should just remove those inline functions, because it's
dubious whether they are a really faster and they do break
things. What do you think?

Jeroen Dekkers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]