Features/ChangeInImplicitDSOLinking

From FedoraProject

< Features(Difference between revisions)
Jump to: navigation, search
(Created page with '= Change to the default behaviour of ld = == Summary == Change the default behaviour of ld. Previously the ld command would default to --add-needed, the change would cause ld to...')
 
m (Owner)
 
(25 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 ==
TBA
+
* Name: Charley Wang, Roland Grunberg
 +
* 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: 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 ==
  
As described in [[User_talk:Valce]], the new default behaviour will help address potential problems further down the line if shared objects ever change their dependencies.
+
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 ==
 
== Scope ==
Line 28: 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 ==
  
Some packages may need to explicitly link shared objects if they have neglected to do so.
+
Some packages and users writing programs may need to explicitly link shared objects if they have neglected to do so.
  
 
== Dependencies ==
 
== Dependencies ==
Line 41: Line 46:
  
 
== Documentation ==
 
== Documentation ==
None yet. A temporary description (still a work-in-progress) is up in [[User_talk:Valce]]
+
Description and example is up in [[UnderstandingDSOLinkChange]]
  
 
== Release Notes ==
 
== Release Notes ==
 
+
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:FeaturePageIncomplete]]
+
[[Category:FeatureAcceptedF13]]

Latest revision as of 22:08, 16 February 2010

Contents

[edit] Change to the default behaviour of ld

[edit] 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.

[edit] Owner

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

[edit] 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

[edit] 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

[edit] 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.

[edit] Scope

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

[edit] 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

[edit] User Experience

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

[edit] Dependencies

None

[edit] Contingency Plan

  • Continue without such capability.

[edit] Documentation

Description and example is up in UnderstandingDSOLinkChange

[edit] 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.