Tag Archives: debian packaging hacking gnu linux gcc linker ld

how to avoid linking with uneeded libs

dpkg-shlibdeps: warning: debian/gnome-subtitles/usr/lib/gnome-subtitles/libgstreame
r_playbin.so shouldn't be linked with libgmodule-2.0.so.0 (it uses none of its symb
ols).
dpkg-shlibdeps: warning: debian/gnome-subtitles/usr/lib/gnome-subtitles/libgstreame
r_playbin.so shouldn't be linked with libdl.so.2 (it uses none of its symbols).
dpkg-shlibdeps: warning: debian/gnome-subtitles/usr/lib/gnome-subtitles/libgstreame
r_playbin.so shouldn't be linked with libgthread-2.0.so.0 (it uses none of its symb
ols).
dpkg-shlibdeps: warning: debian/gnome-subtitles/usr/lib/gnome-subtitles/libgstreame
r_playbin.so shouldn't be linked with librt.so.1 (it uses none of its symbols).
dpkg-shlibdeps: warning: debian/gnome-subtitles/usr/lib/gnome-subtitles/libgstreame
r_playbin.so shouldn't be linked with libxml2.so.2 (it uses none of its symbols).
dpkg-shlibdeps: warning: debian/gnome-subtitles/usr/lib/gnome-subtitles/libgstreame
r_playbin.so shouldn't be linked with libpthread.so.0 (it uses none of its symbols)
.

just add –as-needed in your linker flags:
LDFLAGS = -Wl,–as-needed