Bug 29274 - doesn't build with gold, Fedora ld, or LDFLAGS=-Wl,--no-add-needed
Summary: doesn't build with gold, Fedora ld, or LDFLAGS=-Wl,--no-add-needed
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: GLib (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-07-27 09:46 UTC by Simon McVittie
Modified: 2010-08-09 10:42 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (7.12 KB, patch)
2010-07-27 09:47 UTC, Simon McVittie
Details | Splinter Review
Consolidate LDADD variables in tests/examples and make them more complete (7.23 KB, patch)
2010-08-09 03:30 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2010-07-27 09:46:02 UTC
[The tl;dr version: this patch lets you compile dbus-glib on recent Fedora.]

If an executable links against libfoo, and libfoo links against libbar, then GNU BFD ld has traditionally linked the executable explicitly against libbar, allowing it to use symbols from libbar, unless the --no-add-needed option is used.

This is unfortunate for deterministic builds if interdependencies change, and somewhat slow, so GNU gold defaults to --no-add-needed, and Fedora have recently patched the standard (BFD) ld to do the same.
Comment 1 Simon McVittie 2010-07-27 09:47:14 UTC
Please see http://git.collabora.co.uk/?p=user/smcv/dbus-glib-smcv.git;a=shortlog;h=refs/heads/no-add-needed for a patch, and some incidental .gitignore cleanup. I'll attach the most relevant patch here.
Comment 2 Simon McVittie 2010-07-27 09:47:34 UTC
Created attachment 37413 [details] [review]
proposed patch
Comment 3 Simon McVittie 2010-08-09 03:30:12 UTC
Created attachment 37720 [details] [review]
Consolidate LDADD variables in tests/examples and make them more complete

Here's an updated patch, now that the gvalue-to-gvariant branch (which was not --no-add-needed compatible either) has been merged.

I've also updated the .gitignore patches in my git branch to include the new test from that branch:

http://git.collabora.co.uk/?p=user/smcv/dbus-glib-smcv.git;a=shortlog;h=refs/heads/no-add-needed
Comment 4 Colin Walters 2010-08-09 10:16:31 UTC
Review of attachment 37720 [details] [review]:

Looks good to me, thanks!
Comment 5 Simon McVittie 2010-08-09 10:42:35 UTC
Fixed in git for 0.88, thanks.


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.