Bug 29274

Summary: doesn't build with gold, Fedora ld, or LDFLAGS=-Wl,--no-add-needed
Product: dbus Reporter: Simon McVittie <smcv>
Component: GLibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: John (J5) Palmieri <johnp>
Severity: normal    
Priority: medium CC: rob.taylor
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/smcv/dbus-glib-smcv.git;a=shortlog;h=refs/heads/no-add-needed
Whiteboard:
i915 platform: i915 features:
Attachments: proposed patch
Consolidate LDADD variables in tests/examples and make them more complete

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.