GNOME Bugzilla – Bug 561187
Links statically a lot of files in each backend
Last modified: 2013-12-12 16:38:43 UTC
Currently, all common functions to the different gvfs backends are built as libdaemon.la and linked statically into each backend. Because of that, each backend is > 100KB. Linking them dynamically would reduce the binary package size quite a bit, and would save users memory by using shared segments when several backends are in use. If the API for these functions is not meant to be stable, it is possible to put it in a shared library nevertheless; my favorite way to do this is to call libtool -release to enforce library soname changes.
Its now shared.
I’ve just built gvfs 1.2.2, and the common functions are still linked statically. The smallest backend is 732K on amd64, so that makes 13 MB for all backends. This makes gvfs-backends one of the biggest binary packages of the GNOME suite.
Sorry, I looked at the unstripped binaries. Stripped are about 130K, so that’s the same as with 1.0. The bug is not fixed, but it has not gotten worse :)
Created attachment 258339 [details] [review] Convert libdaemon to a shared library Convert libdaemon to be a shared library called libgvfsdaemon, much like libgvfscommon. It has the benefit of reducing the binary size of each daemon by between 100 and 200KB and reduces the memory footprint if using several backends at the same time.
Review of attachment 258339 [details] [review]: Looks good to me, hopefully this doesn't break anything...
Review of attachment 258339 [details] [review]: ::: daemon/Makefile.am @@ +200,3 @@ $(NULL) +libgvfsdaemon_la_LDFLAGS = -no-undefined Would be nice to add comment same as in common/Makefile.am: # needed by cygwin (see bug #564003)
Thanks. I see now that Debian has a similar patch [1]. I think we should change lib_LTLIBRARIES to pkglib_LTLIBRARIES for libgvfs{daemon,common} and add -avoid-version since they are private libraries? (as done with libgedit-private in [2]) [1] http://anonscm.debian.org/viewvc/pkg-gnome/desktop/unstable/gvfs/debian/patches/05_shared_libdaemon.patch?revision=37904&view=markup [2] https://git.gnome.org/browse/gedit/tree/gedit/Makefile.am
Created attachment 263618 [details] [review] Convert libdaemon to a private shared library
Created attachment 263619 [details] [review] Convert libgvfscommon to a private shared library
Review of attachment 263618 [details] [review]: Looks good!
Review of attachment 263619 [details] [review]: Looks good!
Pushed to master as 9ec8f2e84e97831d1ce97d8daa7b590349e08415. Thanks!