After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 572910 - unused direct shlib dependencies in goffice
unused direct shlib dependencies in goffice
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
0.6.x
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2009-02-23 21:46 UTC by Julian Sikorski
Modified: 2009-03-12 23:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
partially fixes the issue (822 bytes, patch)
2009-02-24 10:17 UTC, Jean Bréfort
none Details | Review
Proposed pacth for trunk (5.48 KB, patch)
2009-02-26 13:15 UTC, Jean Bréfort
rejected Details | Review
real patch for trunk (2.13 KB, patch)
2009-02-27 18:00 UTC, Jean Bréfort
none Details | Review
the same patch with one less typo. (2.14 KB, patch)
2009-02-27 18:39 UTC, Jean Bréfort
none Details | Review
Updated patch (2.52 KB, patch)
2009-03-12 15:18 UTC, Morten Welinder
none Details | Review

Description Julian Sikorski 2009-02-23 21:46:48 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.
Comment 1 Jean Bréfort 2009-02-24 07:30:04 UTC
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.
Comment 2 Jean Bréfort 2009-02-24 07:39:28 UTC
ldd -u -r /usr/lib/libgoffice-0.6.so.6
gives no unused direct dependency on debian sid.
Comment 3 Jean Bréfort 2009-02-24 08:13:18 UTC
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
Comment 4 Jean Bréfort 2009-02-24 10:17:33 UTC
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.
Comment 5 Jean Bréfort 2009-02-24 15:48:50 UTC
We also need to rename the Requires field in libgoffice.pn.in to Requires.private
Comment 6 Morten Welinder 2009-02-25 18:38:34 UTC
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.
Comment 7 Jean Bréfort 2009-02-25 21:31:15 UTC
> 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).  
Comment 8 Morten Welinder 2009-02-25 23:43:45 UTC
> PKG_CHECK_MODULES(RENDER, [Xrender])

That's a no-go for Solaris.  Xrender doesn't come with pkg-config
files.
Comment 9 Jean Bréfort 2009-02-26 10:28:11 UTC
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
		  ])
Comment 10 Jean Bréfort 2009-02-26 13:15:41 UTC
Created attachment 129563 [details] [review]
Proposed pacth for trunk
Comment 11 Jean Bréfort 2009-02-26 13:48:05 UTC
Btw, should we also remove unused dependencies in plugins?
Comment 12 Jean Bréfort 2009-02-27 17:51:36 UTC
Oops, wrong patch.
Comment 13 Jean Bréfort 2009-02-27 18:00:06 UTC
Created attachment 129675 [details] [review]
real patch for trunk

this one should be better.
Comment 14 Jean Bréfort 2009-02-27 18:39:58 UTC
Created attachment 129681 [details] [review]
the same patch with one less typo.
Comment 15 Morten Welinder 2009-02-28 13:50:23 UTC
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.
Comment 16 Jean Bréfort 2009-02-28 14:54:24 UTC
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.
Comment 17 Morten Welinder 2009-03-12 14:31:57 UTC
For HEAD, would it be ok to drop everything except the -lXext thing in?
Comment 18 Jean Bréfort 2009-03-12 14:49:17 UTC
it is possible, but this bug would not be fixed.
Comment 19 Morten Welinder 2009-03-12 15:18:31 UTC
Created attachment 130528 [details] [review]
Updated patch

How about this one?  This ought to keep -lXext if and if only it is needed.
Comment 20 Jean Bréfort 2009-03-12 20:11:29 UTC
Looks good :-)
Comment 21 Morten Welinder 2009-03-12 23:20:16 UTC
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.