[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Shared libraries dependancies



Hello!

I maintain the gdome2 debian packages libgdome2-0 and libgdome2-dev, and I
have a problem with libraries dependancies.

Let's start with a short extract of the package data:

Package: libgdome2-0
Section: libs
Source: gdome2
Depends: libc6 (>= 2.2.4-2)
Description: DOM level2 library for accessing XML files
 gdome2 is a fast, light and complete DOM level2 implementation based
 on libxml2.  Although it has been written for the GNOME project, it
 can be used stand-alone.
 [...]

Package: libgdome2-dev
Section: devel
Source: gdome2
Depends: libgdome2-0 (= 0.6.9-1), libc6-dev, libxml2-dev, libglib1.2-dev
Description: Development files for libgdome2
 This package contains the header files and static libraries for
 developing with libgdome2-0.
 [...]


I noticed, and so did the upstream maintainer, and other people, too, that
libgdome2-0 does not depend neither on libxml2 nor on glib.  The
dependancy is calculated by dh_shlibdeps, and since it isn't something I
should directly control, I started to investigate the case.
gdome2 is a wrapper around libxml2, and makes heavy uses of glib
functions; without libxml2 and glib, it does not make sense and would
surely give linking errors.

Now, I started inspecting the shlib I have installed here using the same
package that is on Debian:

marvin:/usr/lib# ldd libgdome.so.0.6.9
	libc.so.6 => /lib/libc.so.6 (0x40041000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

marvin:/usr/lib# dpkg-shlibdeps -O libgdome.so.0.6.9
shlibs:Depends=libc6 (>= 2.2.4-2)
marvin:/usr/lib# ls -la libgdome.so.* libxml2.so.* libglib-1.2.so.*
lrwxrwxrwx    1 root     root           17 Oct 27 20:04 libgdome.so.0 -> libgdome.so.0.6.9
-rw-r--r--    1 root     root       185016 Oct 17 12:00 libgdome.so.0.6.9
lrwxrwxrwx    1 root     root           21 Aug 22 10:50 libglib-1.2.so.0 -> libglib-1.2.so.0.0.10
-rw-r--r--    1 root     root       137448 Jun 23 14:33 libglib-1.2.so.0.0.10
lrwxrwxrwx    1 root     root           16 Sep 19 03:12 libxml2.so.2 -> libxml2.so.2.4.5
-rw-r--r--    1 root     root       603192 Sep 16 01:06 libxml2.so.2.4.5

marvin:/usr/lib# objdump -T libgdome.so.0.6.9


libgdome.so.0.6.9:     file format elf32-i386

DYNAMIC SYMBOL TABLE:
[...]
00000000      D  *UND*	00000000              xmlNodeSetContent
0001310c g    DF .text	00000040  Base        gdome_c_localName
[...]
00000000      D  *UND*	00000000              xmlAddDocEntity
0001783c g    DF .text	00000040  Base        gdome_pi_cloneNode
00000000      D  *UND*	00000000              xmlNewDocText
[...]
00000000      D  *UND*	00000000              g_strcasecmp
0001590c g    DF .text	00000040  Base        gdome_not_childNodes
[...]
00000000  w   DF *UND*	00000027  GLIBC_2.0   __register_frame_info
0002745c g    DF .text	0000001e  Base        gdome_xmlGetChildrensLength
[...]


At this time I'm quite disappointed: the external references DO refere to
external symbols, but neither ldd nor dpkg-shlibdeps can get the
dependancies.

First I suspected it was because of the empty field before the symbol name
that I have for glib and libxml2 functions, while glibc functions have
GLIBC_2<something>.
This idea proved wrong when I tried running ldd, dpkg-shlibdeps and
objdump -T on libgnomeui, since they gave the same empty fields in every
external symbol that is not in glibc, but the dependencies are correctly
found both by ldd and dpkg-shlibdeps.

Now I tried to compile one of the examples included in libgdome2-dev.  To
compile it, gdome-config --libs wants "-L/usr/lib -lgdome -lglib -lxml2",
and libgdome2-dev already brings in the correct packages, so the
development version has the dependancies ok.

Ok, now I could conclude that the dependancies on the libraries used by
gdome will be the responsibility of the packets that use the gdome2
library, not on the gdome2 shared object itself.  Thus I could possibly
install libgdome2-0 without libxml2, but any package making use of it will
necessarily bring in libxml2 and glib.

Now, if this is true and if this is the right way to package shlibs, why
does libgnomeui32 depend on a dozen other shlibs?

And then, suppose I want to use a non-debian precompiled binary that
requires libgdome.so, I would install libgdome2-0 and expect my
precompiled application to be fine, but I would then discover the hard way
(and it would be a real PITA of trials and errors, I guess) that I need
also to install libxml2 and glib.

Now, discussing with another developer he noted that when libgdome.so is
compiled, the switches -shared and -lxml2 are not present, and this could
be the cause for the missing dependancies.  When reporting this to
upstream, he told me he could add those switches and help me in any way he
can (he is really kind to me), but he had no clue on all of this
discussion.

A this point I don't have the faintest clue, too, so I'm asking for help
here.

What is the right way to compile shlibs wrt this issues?  Are the current
dependancies wrong?  If not, what about libgnomeui, and what is the
difference between the two in terms of shlib dependancies?  What should
gdome2 do?  Does it need those dependancies listed?  Is there an error in
how gdome2 is compiled?  What error?  How do we resolve it?  Why?


Bye, Enrico

--
GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini (Unibo) <zinie@cs.unibo.it>



Reply to: