dpkg-shlibdeps: warning: dependency on $(lib) could be avoided if $(object) were not uselessly linked against it (they use none of its symbols).
I didn't like this build time warning at all. In the library packaging guide a found a nifty trick, add this line to the debian/rules (this is cdbs, don't know how it is done with debhelper scripts)
DEB_CONFIGURE_SCRIPT_ENV += LDFLAGS=" -Wl,--as-needed"
This worked for the executable and I've saved 300 bytes!!!!! Yeah =D
It didn't work for the library though =( Bummer.
I didn't like this build time warning at all. In the library packaging guide a found a nifty trick, add this line to the debian/rules (this is cdbs, don't know how it is done with debhelper scripts)
DEB_CONFIGURE_SCRIPT_ENV += LDFLAGS=" -Wl,--as-needed"
This worked for the executable and I've saved 300 bytes!!!!! Yeah =D
It didn't work for the library though =( Bummer.
I had this exact issue, and it was really driving me nuts. Your suggestion worked great, and I'm using it in the Debian geoclue package.
ReplyDeleteOn a side-note later I've realised that there could be another reason. Upstream sometimes overdoes with import statements, hence the binary gets linked with too many libraries. If you know how to program dig into upstream code and try to minimise amount of libraries used...... and try to get patch upstream...... unless they are hostile and hate everything debian related =D lol
ReplyDelete