[lxc-devel] [PATCH] Link against pthread when not on bionic.

Stéphane Graber stgraber at ubuntu.com
Mon Feb 18 20:46:24 UTC 2013


On 02/18/2013 03:40 PM, Daniel Lezcano wrote:
> On 02/18/2013 06:23 PM, Stéphane Graber wrote:
>> dpkg spotted that we're not explicitly linking against pthread even though
>> we use some of its symbols (sem_*).
> 
> uh ? wait.
> 
> We shouldn't link against the lib pthread.
> 
> I don't think sem_* is a symbol coming from the pthread library.
> 
> Could you give the output of dpkg ?

From "man sem_open":
       Link with -pthread.

dpkg-shlibdeps output:
dpkg-shlibdeps: warning: symbol sem_post used by
debian/liblxc0/usr/lib/x86_64-linux-gnu/liblxc.so.0.9.0.alpha3 found in
none of the libraries
dpkg-shlibdeps: warning: symbol sem_open used by
debian/liblxc0/usr/lib/x86_64-linux-gnu/liblxc.so.0.9.0.alpha3 found in
none of the libraries
dpkg-shlibdeps: warning: symbol sem_close used by
debian/liblxc0/usr/lib/x86_64-linux-gnu/liblxc.so.0.9.0.alpha3 found in
none of the libraries
dpkg-shlibdeps: warning: symbol sem_init used by
debian/liblxc0/usr/lib/x86_64-linux-gnu/liblxc.so.0.9.0.alpha3 found in
none of the libraries
dpkg-shlibdeps: warning: symbol sem_timedwait used by
debian/liblxc0/usr/lib/x86_64-linux-gnu/liblxc.so.0.9.0.alpha3 found in
none of the libraries
dpkg-shlibdeps: warning: symbol sem_destroy used by
debian/liblxc0/usr/lib/x86_64-linux-gnu/liblxc.so.0.9.0.alpha3 found in
none of the libraries
dpkg-shlibdeps: warning: symbol sem_wait used by
debian/liblxc0/usr/lib/x86_64-linux-gnu/liblxc.so.0.9.0.alpha3 found in
none of the libraries


Looking at pthread.so it appears to provide:
sem_init
sem_destroy
sem_open
sem_close
sem_unlink
sem_getvalue
sem_wait
sem_trywait
sem_timedwait
sem_post

>>
>> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
>> ---
>>  src/lxc/Makefile.am | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
>> index 8974ca9..a0077aa 100644
>> --- a/src/lxc/Makefile.am
>> +++ b/src/lxc/Makefile.am
>> @@ -115,7 +115,7 @@ liblxc_so_LDFLAGS = \
>>  liblxc_so_LDADD = $(CAP_LIBS) $(APPARMOR_LIBS) $(SECCOMP_LIBS)
>>  
>>  if !IS_BIONIC
>> -liblxc_so_LDADD += -lutil -lrt
>> +liblxc_so_LDADD += -lutil -lrt -lpthread
>>  endif
>>  
>>  bin_SCRIPTS = \
> 


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130218/1d953111/attachment.pgp>


More information about the lxc-devel mailing list