bug-glibc
[Top][All Lists]
Advanced

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

pthread_mutex_trylock weak symbol


From: Anil Kumar Kommuri
Subject: pthread_mutex_trylock weak symbol
Date: Thu, 27 Mar 2003 07:20:38 -0700

hello,
For developing a shared library (mysdk.so) on Linux (RedHat 7.2) I am
using glibc.  mysdk.so implementation uses pthread_mutex_* functions. 
mysdk.so didn't link to pthread library.  Here the idea is application
developers can use their own PTHREAD package.  

When the application tries to link to mysdk.so, I'm getting an
undefined reference to pthread_mutex_trylock from mysdk.so.  I could
certainly pass -lpthread to ld but this seems unreasonable since the
thing I'm linking does not use anything from pthreads.

The command nm -D /lib/libc.so.6 | grep pthread_mutex_ displays
following information
         w __pthread_mutex_destroy
         w __pthread_mutex_init
         w __pthread_mutex_lock
         w __pthread_mutex_trylock
         w __pthread_mutex_unlock
000fa030 W pthread_mutex_destroy
000fa030 W pthread_mutex_init
000fa030 W pthread_mutex_lock
000fa030 W pthread_mutex_unlock 

why is pthread_mutex_trylock weak symbol not present in libc?  Is there
any way to get rid of this issue.  Any help would be greatly
appreciated.

thanks
anil.






reply via email to

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