From Fedora Project Wiki

Revision as of 15:47, 9 November 2016 by Fweimer (talk | contribs) (Created page with "= Fedora 26 C/C++ Compilation Flags Updates = == Summary == This change updates the default C/C++ compilation flags, as determined by the <code>redhat-rpm-config</code> packa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Fedora 26 C/C++ Compilation Flags Updates

Summary

This change updates the default C/C++ compilation flags, as determined by the redhat-rpm-config package.

Owner

Current status

  • Targeted release: Fedora 26
  • Last updated: 2016-11-09
  • Tracker bug: <will be assigned by the Wrangler>

Detailed Description

This change covers the following modifications to the default C and C++ compiler flags in the redhat-rpm-config package.

  • Drop -mtune=atom: This flag was added to improve performance on the Intel Bonnell microarchitecture. Such CPUs are rare these days. In addition, many users of the i686 packages download them for use within a 64-bit x86_64 installation, and only a small part of these Fedora installations use Atom CPUs. Current microarchitectures for Atom CPUs are different from the original Bonnell microarchtecture and would need different GCC flags for tuning, but many current Atom-based devices cannot run Fedora because Fedora does not support their 32-bit UEFI boot environment.
  • Add -Werror=implicit-function-declaration: Implicit function declarations allows a programmer to call functions without declaring them (or including the relevant header files). The official C language specification has not supported implicit function declarations for almost two decades now. GCC still supports them as a GNU extension. Implicit function declarations introduce bugs because these functions use a different calling convention and have a fixed return type of int. Resulting issues are pointer truncation (on 64-bit architectures), exposure of padding bits (particular for bool-returning functions on x86_64), and unexpected lack of hardening. Implicit function declarations are not part of C++ (with or without GNU extensions), and adjusting C code accordingly simplifies reuse in C++ projects.

Benefit to Fedora

i686 binaries will run a little faster on current hardware. C code will be prepared for future C language updates, and can be used more easily in C++ programs.

Scope

  • Proposal owners:

The defaults in redhat-rpm-config need to be changed, as described above.

  • Other developers: Source code which relies on implicit function declarations or implicit ints needs to be adjusted.
  • Release engineering: This change requires a mass rebuild to become fully effective.
  • Policies and guidelines: no changes proposed (change will be implemented through redhat-rpm-config)
  • Trademark approval: N/A (not needed for this Change)

Upgrade/compatibility impact

There will be no impact.

How To Test

Regular regression testing covers this. Program behavior will not change as long as the programs still compiler.

User Experience

There will be no user-visible impact.

Dependencies

The redhat-rpm-config change should be made as soon as possible, well before the first mass rebuild.

Contingency Plan

  • Contingency mechanism: Drop the change.
  • Contingency deadline: Final mass rebuild.
  • Blocks release? No.
  • Blocks product? No.

Documentation

Release Notes

This change does not seem to emet the threshold for the release notes. It is only about internal housekeeping.