From Fedora Project Wiki
No edit summary
No edit summary
Line 27: Line 27:
* Proposal owners: Add <code>-Wl,--as-needed</code> into RPM_LD_FLAGS (in redhat-rpm-config).
* Proposal owners: Add <code>-Wl,--as-needed</code> into RPM_LD_FLAGS (in redhat-rpm-config).
* Other developers: Nothing should break, but immediate work-around would be to disable this flag (will be provided in redhat-rpm-config) and fix real issue later.
* Other developers: Nothing should break, but immediate work-around would be to disable this flag (will be provided in redhat-rpm-config) and fix real issue later.
* Release engineering: [https://pagure.io/releng/issues #Releng issue number] (mass rebuild is desired after this change).
* Release engineering: [https://pagure.io/releng/issue/7604 #7604] (mass rebuild is desired after this change).
** [[Fedora_Program_Management/ReleaseBlocking/Fedora{{FedoraVersionNumber|next}}|List of deliverables]]: N/A (not a System Wide Change) <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
** [[Fedora_Program_Management/ReleaseBlocking/Fedora{{FedoraVersionNumber|next}}|List of deliverables]]: N/A (not a System Wide Change) <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Policies and guidelines: Add information how to turn it off (TODO link to FPC ticket).
* Policies and guidelines: Add information how to turn it off (TODO link to FPC ticket).

Revision as of 20:26, 2 July 2018

Remove Excessive Linking

Summary

Pass --as-needed flag the linker through default system-wide LDFLAGS.

Owner

  • Name: Igor Gnatenko
  • Email: ignatenkobrain@fedoraproject.org
  • Release notes owner:

Current status

  • Targeted release: Fedora 29
  • Last updated: 2018-07-02
  • Tracker bug: <will be assigned by the Wrangler>

Detailed Description

The flag (--as-needed) tells the linker to link in the produced binary only the libraries containing symbols actually used by the binary itself. This binary can be either a final executale or another library.

The use of the --as-needed flag allows the linker to avoid linking extra libraries in a binary. This not only improves startup times (as the loader does not have to load all the libraries for every step) but might avoid the full initialization of big frameworks.

Benefit to Fedora

No real tests on Fedora has been made, so no real numbers in this section. But theoretically,

  • Better startup times (since loader doesn't have to load all the libraries)
  • Smaller metadata (since less dependencies are recorded in final binaries)

Scope

  • Proposal owners: Add -Wl,--as-needed into RPM_LD_FLAGS (in redhat-rpm-config).
  • Other developers: Nothing should break, but immediate work-around would be to disable this flag (will be provided in redhat-rpm-config) and fix real issue later.
  • Release engineering: #7604 (mass rebuild is desired after this change).
  • Policies and guidelines: Add information how to turn it off (TODO link to FPC ticket).
  • Trademark approval: N/A (not needed for this Change)

Upgrade/compatibility impact

None for end-users. Developers which build their own packages might notice and should be guided how to fix / workaround issue.

How To Test

Install newest redhat-rpm-config package and build your package.

User Experience

See Benefit to Fedora section.

Dependencies

None.

Contingency Plan

  • Contingency mechanism: Owners will revert change in redhat-rpm-config and make it opt-in rather than opt-out.
  • Contingency deadline: Beta freeze.
  • Blocks release? No
  • Blocks product? Everything

Documentation

Only Packaging Guidelines needs to be updated.

Release Notes