GNOME Bugzilla – Bug 572910
unused direct shlib dependencies in goffice
Last modified: 2009-03-12 23:20:16 UTC
rpmlint, a Fedora tool to find common problems in RPMs, lists the following warnings: goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /lib64/libz.so.1 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libgnomeui-2.so.0 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libSM.so.6 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libICE.so.6 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libbonoboui-2.so.0 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libgnomecanvas-2.so.0 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /lib64/libpopt.so.0 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /lib64/libgio-2.0.so.0 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libpangoft2-1.0.so.0 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libfreetype.so.6 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libfontconfig.so.1 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libgconf-2.so.4 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libbonobo-2.so.0 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libbonobo-activation.so.4 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libORBit-2.so.0 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /lib64/libgthread-2.0.so.0 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /lib64/librt.so.1 goffice.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libgoffice-0.6.so.6.0.5 /usr/lib64/libXext.so.6 This is explained in the following manner: The binary contains unused direct shared library dependencies. This may indicate gratuitously bloated linkage; check that the binary has been linked with the intended shared libraries only. Some explanation is also given in the Mandriva wiki: http://wiki.mandriva.com/en/Overlinking Also, 0.4 branch didn't exhibit that problem despite the fact that the RPM spec changes were minimal.
We do not request any of them (except perhaps gconf, I'll have a look) so all other are .pc files issue outside of goffice.
ldd -u -r /usr/lib/libgoffice-0.6.so.6 gives no unused direct dependency on debian sid.
I get them if I compile the library: ldd -u -r /usr/local/lib/libgoffice-0.6.so.6 Unused direct dependencies: /usr/lib/libz.so.1 /usr/lib/libgnomeui-2.so.0 /usr/lib/libSM.so.6 /usr/lib/libICE.so.6 /usr/lib/libbonoboui-2.so.0 /usr/lib/libgnomecanvas-2.so.0 /lib/libpopt.so.0 /usr/lib/libgconf-2.so.4 /usr/lib/libbonobo-2.so.0 /usr/lib/libbonobo-activation.so.4 /usr/lib/libORBit-2.so.0 /usr/lib/libgthread-2.0.so.0 /lib/librt.so.1 /usr/lib/libXext.so.6
Created attachment 129399 [details] [review] partially fixes the issue /usr/lib/libgconf-2.so.4 Some unused dependencies remain: /lib/libpopt.so.0 /usr/lib/libbonobo-2.so.0 /usr/lib/libbonobo-activation.so.4 /usr/lib/libORBit-2.so.0 /usr/lib/libgthread-2.0.so.0 /lib/librt.so.1 all coming from libgnome-2.0.pc needed for gnome-url-show. I also have a fix for trunk which removes all unused dependencies since we have no more gnome support in 0.8.
We also need to rename the Requires field in libgoffice.pn.in to Requires.private
Are we trying to solve a non-problem here? - cairo-svg >= 1.2.0 - cairo-pdf >= 1.2.0 - cairo-ps >= 1.2.0 How else can we request that these backends be available? - gconf-2.0 - libgnomeui-2.0 >= 2.0.0 - libgsf-gnome-1 >= 1.12.2 + gnome-vfs-2.0 + libgnome-2.0 Why the two "+" lines? I get no hits on gnome_vfs in the code. - [AC_SUBST(RENDER_LIBS, "-lXrender -lXext") + [AC_SUBST(RENDER_LIBS, "-lXrender") I am not convinced that will work on other platforms. There is a lot of code out there adding -lXect for xrender tests.
> Are we trying to solve a non-problem here? > > - cairo-svg >= 1.2.0 > - cairo-pdf >= 1.2.0 > - cairo-ps >= 1.2.0 The issue is that the pc files are not useful for the build, and they introduce -lz to LIBS which is not needed. > How else can we request that these backends be available? We can still make an independant PKG_CHECK_MODULES to check for these without adding -lz to GOFFICE_LIBS. > - gconf-2.0 > - libgnomeui-2.0 >= 2.0.0 > - libgsf-gnome-1 >= 1.12.2 > + gnome-vfs-2.0 > + libgnome-2.0 > > Why the two "+" lines? I get no hits on gnome_vfs in the code. The patch is for goffice-0.6 which uses gnome_vfs and gnome_show_url. > - [AC_SUBST(RENDER_LIBS, "-lXrender -lXext") > + [AC_SUBST(RENDER_LIBS, "-lXrender") > > I am not convinced that will work on other platforms. There is a lot of > code out there adding -lXect for xrender tests. PKG_CHECK_MODULES(RENDER, [Xrender]) should be more convenient (and is portable) (but it will add -lX11).
> PKG_CHECK_MODULES(RENDER, [Xrender]) That's a no-go for Solaris. Xrender doesn't come with pkg-config files.
Here is the code used by cairo, we might adapt it: PKG_CHECK_MODULES(xlib_xrender, $xlib_xrender_REQUIRES, , [AC_MSG_RESULT(no) xlib_xrender_REQUIRES="" old_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $xlib_CFLAGS $xlib_NONPKGCONFIG_CFLAGS" AC_CHECK_HEADER(X11/extensions/Xrender.h, [xlib_xrender_NONPKGCONFIG_LIBS="-lXrender"], [use_xlib_xrender="no (requires $xlib_xrender_REQUIRES http://freedesktop.org/Software/xlibs)"]) CPPFLAGS=$old_CPPFLAGS ])
Created attachment 129563 [details] [review] Proposed pacth for trunk
Btw, should we also remove unused dependencies in plugins?
Oops, wrong patch.
Created attachment 129675 [details] [review] real patch for trunk this one should be better.
Created attachment 129681 [details] [review] the same patch with one less typo.
For 0.6, do whatever you like. For HEAD, please don't change the Xrender stuff. It has the distinct feel of something that is needed somewhere.
The Xrender stuff is used only by foocanvas to render semi-transparent rectangles and ellipses, AFAIK. And the corresponding sheet objects do not support transparency at the moment. So it looks like a minor concern.
For HEAD, would it be ok to drop everything except the -lXext thing in?
it is possible, but this bug would not be fixed.
Created attachment 130528 [details] [review] Updated patch How about this one? This ought to keep -lXext if and if only it is needed.
Looks good :-)
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.