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 518728 - subtle link error: system libs before Evolution libs
subtle link error: system libs before Evolution libs
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
2.22.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Patrick Ohly
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2008-02-25 23:11 UTC by Patrick Ohly
Modified: 2008-08-28 20:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
makes the placement of additional libraries consistent (2.12 KB, patch)
2008-03-02 21:56 UTC, Patrick Ohly
committed Details | Review
fixes link order for libebook (1.30 KB, patch)
2008-08-28 19:46 UTC, Patrick Ohly
committed Details | Review

Description Patrick Ohly 2008-02-25 23:11:25 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)
Comment 1 Patrick Ohly 2008-03-02 21:56:40 UTC
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.
Comment 2 Matthew Barnes 2008-03-03 01:05:18 UTC
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.
Comment 3 Matthew Barnes 2008-03-03 01:57:43 UTC
Tested patch; distcheck passes and no additional compilation warnings.

Committed to trunk (revision 8549).  Thanks Patrick!
Comment 4 Rainer Klier 2008-03-03 08:02:13 UTC
There's a similar issue in  bug #519234
Comment 5 Matthew Barnes 2008-03-03 12:24:20 UTC
(In reply to comment #4)
> There's a similar issue in  bug #519234

No, not similar.
Comment 6 Rainer Klier 2008-03-03 13:25:14 UTC
(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.
Comment 7 Patrick Ohly 2008-03-03 19:40:11 UTC
I suggest we discuss whether bug #519234 is related or not in entry #519234 itself...
Comment 8 Patrick Ohly 2008-08-28 19:45:24 UTC
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?
Comment 9 Patrick Ohly 2008-08-28 19:46:24 UTC
Created attachment 117547 [details] [review]
fixes link order for libebook
Comment 10 Matthew Barnes 2008-08-28 20:21:38 UTC
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.
Comment 11 Patrick Ohly 2008-08-28 20:50:33 UTC
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.