Bug 28043

Summary: tp-glib 0.11.4 fails to build with -Wl,--no-add-needed
Product: Telepathy Reporter: Brian Pepple <bpepple>
Component: tp-glibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/build
Whiteboard:
i915 platform: i915 features:
Attachments: tp-glib build log

Description Brian Pepple 2010-05-09 13:47:05 UTC
Created attachment 35531 [details]
tp-glib build log

telepathy-glib-0.11.4 fails to build due to a change DSO-linking semantics of the gcc compiler in Fedora. Previously calls to the linker (ld) from gcc would result
in dangerous default behaviour where ld would attempt to implicitly satisfy
link requirements. The change will prevent ld from automatically searching in
the dependencies of linked objects.

tp-glib appears to be failing due to gnio-util.o not having dbus-glib linked properly. I gave a quick look to see if I could find where the problem was, but couldn't find it. Hopefully, I can find some time to dig into this a little deeper and find out what the problem is.

http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking
http://fedoraproject.org/wiki/UnderstandingDSOLinkChange
Comment 1 Simon McVittie 2010-05-10 03:27:20 UTC
We have:

ALL_LIBS = \
    @DBUS_LIBS@ \
    @GLIB_LIBS@
...
libtelepathy_glib_internal_la_LIBADD = $(ALL_LIBS)
...
libtelepathy_glib_la_LIBADD = libtelepathy-glib-internal.la

which always used to work. @DBUS_LIBS@ includes both dbus-glib and libdbus.

libtelepathy-glib-internal.la is a libtool noinst (static) convenience library, while libtelepathy-glib.la is an ordinary shared library with no additional sources (so it just wraps libtelepathy-glib-internal.la in a shared library ABI).

It's conceivable that we also need to add $(ALL_LIBS) to libtelepathy_glib_la_LIBADD, but I'd rather not do that if we don't need to - as I understand it, libtool should arrange for that to happen anyway?

Since none of the telepathy-glib upstream developers are Fedora users (as far as I know), it'd be very useful if you could explain how to give an unmodified ld this behaviour. From the descriptions on the Fedora wiki, it sounds like the change might have been to make "ld" equivalent to "ld --no-add-needed", for which some Debian bugs have been filed since it's also the default behaviour of the "gold" linker?
Comment 2 Simon McVittie 2010-05-10 04:20:34 UTC
The problem with -Wl,--no-add-needed was actually in the regression tests; my branch should fix it.

I'll do a 0.11.5 release soon, possibly later today, which should have this fix.
Comment 3 Simon McVittie 2010-05-10 08:37:42 UTC
review+ from Guillaume, merged to master, will be in 0.11.5 shortly. I hope this fixes it in Fedora too.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.