From Fedora Project Wiki
No edit summary
 
(14 intermediate revisions by 4 users not shown)
Line 2: Line 2:


== Summary ==
== Summary ==
Change the default behaviour of ld. Previously the ld command would default to --add-needed, the change would cause ld to default to --no-add-needed. This will prevent ld from automatically searching in the dependencies of linked objects.
Change DSO-linking semantics of the gcc compiler. Previously calls to the linker (ld) from gcc would result in dangerous default behaviour where ld would attempt to implicitly satisfy link requirements. The proposed change will prevent ld from automatically searching in the dependencies of linked objects.


== Owner ==
== Owner ==
* Name: Charley Wang
* Name: Charley Wang, Roland Grunberg
* E-mail: chwang@redhat.com
* E-mail: chwang at redhat.com, rgrunber at redhat.com


== Current status ==
== Current status ==
* Targeted release: [[Releases/13 | Fedora 13]]  
* Targeted release: [[Releases/13 | Fedora 13]]  
* Last updated: 2009-11-25
* Last updated: 2010-02-09
* Percentage of completion: 50%
* Percentage of completion: 100%
* Mass builds: Have done test builds of ~4000 rpms so far with new ld. Incomplete list of ld-broken packages is at [[DSOLinkBugs]]
* Mass builds: Completed one mass-build of Fedora-13 packages -- a list of packages that were broken at the time of the mass-build can be found at [[DSOLinkBugs]]
* FTBFS builds that failed due to this feature: https://bugzilla.redhat.com/show_bug.cgi?id=564245
* Currently working on resolving a potential issue with weak symbols


== Detailed Description ==
== Detailed Description ==


Change the default behaviour of ld. Previously the ld command would default to --add-needed, the change would cause ld to default to --no-add-needed. This will prevent ld from automatically searching in the dependencies of linked objects.
Change the default behaviour of ld. The current default behaviour causes DT_NEEDED tags to be automatically emitted for all dependencies of linked libraries. Effectively this means that if you link to lib1 and lib1 depends on lib2, then your program will automatically get lib2 regardless of whether lib2 is used in your program itself. There are some problems with this approach. For example, if your program requires symbols from lib2 but relies on the implicit link via lib1, then your program is vulnerable to changes to lib1's dependencies. For more information, please see [[UnderstandingDSOLinkChange]]. There has also been some discussion of this and other related issues on the mailing list: http://www.opensubscriber.com/message/devel@lists.fedoraproject.org/13259010.html


== Benefit to Fedora ==
== Benefit to Fedora ==
Line 29: Line 31:


# Run mass mock builds, notify owners of packages that have problems under the new ld.
# Run mass mock builds, notify owners of packages that have problems under the new ld.
Done.  See https://bugzilla.redhat.com/show_bug.cgi?id=564245


== User Experience ==
== User Experience ==
Line 45: Line 49:


== Release Notes ==
== Release Notes ==
In Fedora 13, the the default behaviour of <code>ld</code> changed. Previously the <code>ld</code> command would default to <code>--add-needed</code>. Now <code>ld</code> to defaults to <code>--no-add-needed</code>.
In Fedora 13, the the default behaviour of <code>ld</code> changed. The new linker behaviour will no longer automatically link dependencies of the specified libraries.  


----
----


[[Category:FeatureReadyForFesco]]
[[Category:FeatureAcceptedF13]]

Latest revision as of 22:08, 16 February 2010

Change to the default behaviour of ld

Summary

Change DSO-linking semantics of the gcc compiler. Previously calls to the linker (ld) from gcc would result in dangerous default behaviour where ld would attempt to implicitly satisfy link requirements. The proposed change will prevent ld from automatically searching in the dependencies of linked objects.

Owner

  • Name: Charley Wang, Roland Grunberg
  • E-mail: chwang at redhat.com, rgrunber at redhat.com

Current status

  • Targeted release: Fedora 13
  • Last updated: 2010-02-09
  • Percentage of completion: 100%
  • Mass builds: Completed one mass-build of Fedora-13 packages -- a list of packages that were broken at the time of the mass-build can be found at DSOLinkBugs
  • FTBFS builds that failed due to this feature: https://bugzilla.redhat.com/show_bug.cgi?id=564245
  • Currently working on resolving a potential issue with weak symbols

Detailed Description

Change the default behaviour of ld. The current default behaviour causes DT_NEEDED tags to be automatically emitted for all dependencies of linked libraries. Effectively this means that if you link to lib1 and lib1 depends on lib2, then your program will automatically get lib2 regardless of whether lib2 is used in your program itself. There are some problems with this approach. For example, if your program requires symbols from lib2 but relies on the implicit link via lib1, then your program is vulnerable to changes to lib1's dependencies. For more information, please see UnderstandingDSOLinkChange. There has also been some discussion of this and other related issues on the mailing list: http://www.opensubscriber.com/message/devel@lists.fedoraproject.org/13259010.html

Benefit to Fedora

As described in UnderstandingDSOLinkChange, the new default behaviour will help address potential problems further down the line if shared objects ever change their dependencies.

Scope

Changes the default behaviour of ld, which will affect compilation.

Test Plan

  1. Run mass mock builds, notify owners of packages that have problems under the new ld.

Done. See https://bugzilla.redhat.com/show_bug.cgi?id=564245

User Experience

Some packages and users writing programs may need to explicitly link shared objects if they have neglected to do so.

Dependencies

None

Contingency Plan

  • Continue without such capability.

Documentation

Description and example is up in UnderstandingDSOLinkChange

Release Notes

In Fedora 13, the the default behaviour of ld changed. The new linker behaviour will no longer automatically link dependencies of the specified libraries.