dh_shlibdeps: bogus? warnings when linking against pthread - Debian

This is a discussion on dh_shlibdeps: bogus? warnings when linking against pthread - Debian ; Hi, when I build the libv4l package [1] the following warning is emitted: > dpkg-shlibdeps: warning: dependency on libpthread.so.0 could be avoided if "debian/libv4l-0/usr/lib/libv4l1.so.0 debian/libv4l-0/usr/lib/libv4l2.so.0" were not uselessly linked against it (they use none of its symbols). But libv4l1 and ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: dh_shlibdeps: bogus? warnings when linking against pthread

  1. dh_shlibdeps: bogus? warnings when linking against pthread

    Hi,

    when I build the libv4l package [1] the following warning is emitted:
    > dpkg-shlibdeps: warning: dependency on libpthread.so.0 could be avoided if "debian/libv4l-0/usr/lib/libv4l1.so.0 debian/libv4l-0/usr/lib/libv4l2.so.0" were not uselessly linked against it (they use none of its symbols).


    But libv4l1 and libv4l2 are using the pthread_mutex_* funtions:
    > gjasny@Rincewind:~/src/debian/exp/libv4l$ objdump -T debian/libv4l-0/usr/lib/libv4l1.so.0
    >
    > debian/libv4l-0/usr/lib/libv4l1.so.0: file format elf64-x86-64
    >
    > DYNAMIC SYMBOL TABLE:
    > ...
    > 0000000000000000 DF *UND* 0000000000000751 GLIBC_2.2.5 pthread_mutex_lock
    > 0000000000000000 DF *UND* 000000000000000a GLIBC_2.2.5 pthread_mutex_unlock
    > ...


    The weird thing is that this symbol is defined in libc and also in
    libpthread:

    > $ objdump -T /lib/libc.so.6 |grep mutex_lock
    > 00000000000dae50 g DF .text 0000000000000027 GLIBC_2.2.5 pthread_mutex_lock
    > $ objdump -T /lib/libpthread.so.0 |grep mutex_lock
    > 0000000000008490 g DF .text 0000000000000751 GLIBC_2.2.5 pthread_mutex_lock
    > 0000000000008490 g DF .text 0000000000000751 GLIBC_2.2.5 __pthread_mutex_lock


    Can anyone shed some light on this issue?

    Thanks,
    Gregor

    PS: Please keep CC I'm not subscribed to debian-devel

    [1] git://git.debian.org/git/collab-maint/libv4l.git


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  2. Re: dh_shlibdeps: bogus? warnings when linking against pthread

    On Sun, Oct 19, 2008 at 03:39:20PM +0000, Gregor Jasny wrote:
    > Hi,
    >
    > when I build the libv4l package [1] the following warning is emitted:
    > >dpkg-shlibdeps: warning: dependency on libpthread.so.0 could be avoided
    > >if "debian/libv4l-0/usr/lib/libv4l1.so.0
    > >debian/libv4l-0/usr/lib/libv4l2.so.0" were not uselessly linked against
    > >it (they use none of its symbols).

    >
    > But libv4l1 and libv4l2 are using the pthread_mutex_* funtions:
    > >gjasny@Rincewind:~/src/debian/exp/libv4l$ objdump -T
    > >debian/libv4l-0/usr/lib/libv4l1.so.0
    > >debian/libv4l-0/usr/lib/libv4l1.so.0: file format elf64-x86-64
    > >DYNAMIC SYMBOL TABLE:
    > > ...
    > >0000000000000000 DF *UND* 0000000000000751 GLIBC_2.2.5
    > >pthread_mutex_lock
    > >0000000000000000 DF *UND* 000000000000000a GLIBC_2.2.5
    > >pthread_mutex_unlock
    > >...

    >
    > The weird thing is that this symbol is defined in libc and also in
    > libpthread:
    >
    > >$ objdump -T /lib/libc.so.6 |grep mutex_lock
    > >00000000000dae50 g DF .text 0000000000000027 GLIBC_2.2.5
    > >pthread_mutex_lock
    > >$ objdump -T /lib/libpthread.so.0 |grep mutex_lock
    > >0000000000008490 g DF .text 0000000000000751 GLIBC_2.2.5
    > >pthread_mutex_lock
    > >0000000000008490 g DF .text 0000000000000751 GLIBC_2.2.5
    > >__pthread_mutex_lock

    >
    > Can anyone shed some light on this issue?


    Glibc has stubs for many of the pthread functions, that do nothing when
    libpthread isn't loaded. This way, code has not runtime performance for
    using mutexes and locking when there is no thread used.

    If your library only uses the stuff that the libc has stubs for, then
    you don't want to force linking against libpthread, as it will bring a
    performance penalty for mono-threaded programs.
    --
    ·O· Pierre Habouzit
    ··O madcoder@debian.org
    OOO http://www.madism.org

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEABECAAYFAkj7dZsACgkQvGr7W6HudhyXdwCgnoJm7wy0IG sXcAU0ZoPR6BuU
    PRwAoJ2/wTanOJpT+1rDlnPZ/W0e4Of9
    =rDU4
    -----END PGP SIGNATURE-----


  3. Re: dh_shlibdeps: bogus? warnings when linking against pthread

    On Sun, Oct 19, 2008 at 05:59:55PM +0000, Pierre Habouzit wrote:
    > Glibc has stubs for many of the pthread functions, that do nothing when
    > libpthread isn't loaded. This way, code has not runtime performance for

    ^
    hit
    > using mutexes and locking when there is no thread used.
    >
    > If your library only uses the stuff that the libc has stubs for, then
    > you don't want to force linking against libpthread, as it will bring a
    > performance penalty for mono-threaded programs.



    --
    ·O· Pierre Habouzit
    ··O madcoder@debian.org
    OOO http://www.madism.org

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEABECAAYFAkj7iLkACgkQvGr7W6HudhzzvQCfaDR67oDxZk aVQYzs/vPKJPtf
    wbcAnieqKXr4abDqMfHuWsqVRx8zGavv
    =6zTg
    -----END PGP SIGNATURE-----


+ Reply to Thread