GNOME Bugzilla – Bug 518728
subtle link error: system libs before Evolution libs
Last modified: 2008-08-28 20:50:33 UTC
I'm compiling from source on Debian Etch, which has /usr/lib/libecal-1.2.so -> libecal-1.2.so.6.0.0 During compilation libedata-cal-1.2.so is linked against the more recent libecal-1.2.so.7 which was compiled from source as part of the same "make". So far, so good: evolution-data-server/calendar/libedata-cal$ readelf -a .libs/libedata-cal-1.2.so.6.0.2 | grep libecal 0x00000001 (NEEDED) Shared library: [libecal-1.2.so.7] During installation libtool decides to relink the shared object and at that stage picks up libecal from /usr/lib first: libtool: install: warning: relinking `libedata-cal-1.2.la' (cd /tmp/runtests/head/tmp/evolutiontrunk-build/obj/evolution-data-server/calendar/libedata-cal; /bin/sh ../../libtool --tag=CC --mode=relink ccache gcc -g -Wall -Wmissing-prototypes -Wno-sign-compare -Wno-pointer-sign -L/lib -L/home/patrick/evo-svn/gtk+2.0/lib -o libedata-cal-1.2.la -rpath /tmp/runtests/head/tmp/evolutiontrunk-result/lib -version-info 6:2:0 Evolution-DataServer-Calendar-common.lo Evolution-DataServer-Calendar-skels.lo Evolution-DataServer-Calendar-stubs.lo e-cal-backend.lo e-cal-backend-cache.lo e-cal-backend-factory.lo e-cal-backend-sexp.lo e-cal-backend-sync.lo e-cal-backend-util.lo e-data-cal.lo e-data-cal-factory.lo e-data-cal-view.lo -pthread -L/home/patrick/evo-svn/gtk+2.0//lib -lxml2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lgnomevfs-2 -lgconf-2 -lgmodule-2.0 -ldl -lORBit-2 -lgthread-2.0 -lrt -lgobject-2.0 -lglib-2.0 ../../calendar/libecal/libecal-1.2.la ../../libedataserver/libedataserver-1.2.la ) The result is a broken libedata-cal: evolution-data-server/calendar/libedata-cal$ readelf -a .libs/libedata-cal-1.2.so.6.0.2T | grep libecal 0x00000001 (NEEDED) Shared library: [libecal-1.2.so.6] The libtool call above looks wrong to me: libecal-1.2.la and libedataserver-1.2.la are specified after some of the additional libraries they typically depend upon, like libglib. Changing the order of libedata_cal_1_2_la_LIBADD so that the .la libs are mentioned first fixed the problem for me. I don't think this can break anything because .la files are self-contained and thus ordering shouldn't be relevant, but please test and apply if you agree. I checked my install .so files (including the extensions) and found that evolution-data-server/calendar/backends/caldav has the same problem, while none of the others that I build has. Incidentally, caldav also lists the $(EVOLUTION_CALENDAR_LIBS) while the other backends don't. This further confirms that listing the .la files first is probably the right thing to do. Index: evolution-data-server/calendar/libedata-cal/Makefile.am =================================================================== --- evolution-data-server/calendar/libedata-cal/Makefile.am (Revision 8531) +++ evolution-data-server/calendar/libedata-cal/Makefile.am (Arbeitskopie) @@ -46,9 +46,9 @@ e-data-cal-view.c libedata_cal_1_2_la_LIBADD = \ - $(EVOLUTION_CALENDAR_LIBS) \ $(top_builddir)/calendar/libecal/libecal-1.2.la \ - $(top_builddir)/libedataserver/libedataserver-1.2.la + $(top_builddir)/libedataserver/libedataserver-1.2.la \ + $(EVOLUTION_CALENDAR_LIBS)
Created attachment 106432 [details] [review] makes the placement of additional libraries consistent Please review and apply. I need this patch to build cleanly on Debian Etch.
Approved. There's a similar issue in bug #443022 about the way evolution-exchange links to libldap. I can't build Fedora packages without the patch there, but apparently other distros aren't seeing the problem (yet). In any case, the reasoning there is the similar to what you described above.
Tested patch; distcheck passes and no additional compilation warnings. Committed to trunk (revision 8549). Thanks Patrick!
There's a similar issue in bug #519234
(In reply to comment #4) > There's a similar issue in bug #519234 No, not similar.
(In reply to comment #5) > (In reply to comment #4) > > There's a similar issue in bug #519234 > > No, not similar. > why? in this bug patrick said: "During installation libtool decides to relink the shared object and at that stage picks up libecal from /usr/lib first" and in bug #519234 the same happend with glib. in bug #519234 libtool picks up glib-2.14 from /usr/lib64 instead the fresh made version 2.15.6 from /usr/local/lib.
I suggest we discuss whether bug #519234 is related or not in entry #519234 itself...
Reopening this issue: the same problem also occurs with EVOLUTION_ADDRESSBOOK_LIBS. When compiling 2.22.x on Debian Etch (Evolution 2.12), evolution-dataserver was linked against /usr/lib/libebook-1.2.so.5 because of the incorrect link order. Remember, "incorrect" in this context means "system libs" before "evolution libs". I have a patch which fixes the problem. I tested it in the nightly testing on estamos.de: on 2008-08-27 ldd shows the incorrect libebook, on 2008-08-28 with the patch everything is okay. Okay to apply on 2.22.x and trunk?
Created attachment 117547 [details] [review] fixes link order for libebook
Thanks, please commit. You can commit to gnome-2-22 if you like, but there's no more 2.22.x releases scheduled and the patch won't see the light of day unless distros pick it up.
Committed. I know that there won't be an official release, but at least I continue to use 2.22.x for a while. Perhaps it's also useful for others.