What gcc versions are available in Red Hat Enterprise Linux?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 3
  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Developer Toolset (DTS)

Issue

  • What gcc versions and versions of the C++ standard runtime library are available in Red Hat Enterprise Linux?

Resolution

Primary compiler packages
  • The following gcc packages are available as the default compiler:
    • RHEL7 : gcc 4.8.x
    • RHEL6 : gcc 4.4.x
    • RHEL5 : gcc 4.1.x
    • RHEL4 : gcc 3.4.x
    • RHEL3 : gcc 3.2.x
    • DTS7 : gcc 7.2.x
    • DTS6 : gcc 6.2.x
    • DTS4 : gcc 5.2.x, 5.3.x
    • DTS3 : gcc 4.9.x
    • DTS2 : gcc 4.8.x
    • DTS1 : gcc 4.7.x
Compiler backward compatibility packages

Compatibility packages are available to provide build compatibility with code designed to be built under earlier releases:

  • RHEL7:
    • compat-gcc-44 (gcc 4.4.7 for compatibility with code designed to be built under RHEL6)
  • RHEL6:
    • compat-gcc-34 (gcc 3.4 for compatibility with code designed to be built under RHEL4)
  • RHEL5:
    • compat-gcc-34 (gcc 3.4 for compatibility with code designed to be built under RHEL4)
  • RHEL4:
    • compat-gcc-32 (gcc 3.2 for compatibility with code designed to be built under RHEL3)
  • RHEL3:
    • compat-gcc   (gcc-2.96.x compatible)
Runtime backward compatibility packages

Compatibility packages are available to provide runtime compatibility for binary C++ code that was built under earlier releases:

  • RHEL7:
    • compat-libstdc++-33 (g++ 3.3.x compatible)
  • RHEL6:
    • compat-libstdc++-33 (g++ 3.3 compatible)
    • compat-libstdc++-296 (g++ 2.96.x compatible)
  • RHEL5:
    • compat-libstdc++-33 (g++ 3.3 compatible)
    • compat-libstdc++-296 (g++ 2.96.x compatible)
  • RHEL4:
    • compat-libstdc++-33 (g++ 3.3 compatible)
    • compat-libstdc++-296 (g++ 2.96.x compatible)
Preview packages for forward compatibility testing

Packages of newer gcc versions may be available to facilitate testing of code for compatibility with forthcoming releases:

  • RHEL6: Refer to "Red Hat Developer Toolset" under "Comments" below.
  • RHEL5.8 and later: gcc44 (gcc 4.4, fully supported; see the release notes) . Refer to "Red Hat Developer Toolset" under "Comments" below as well.
  • RHEL5.6 and later: gcc44 (gcc 4.4, fully supported; see the release notes)
  • RHEL5.4 and later: gcc44 (gcc 4.4 Technology Preview; see the release notes)
  • RHEL5.3 and later: gcc43 (gcc 4.3 Technology Preview; see the release notes)

Comments

Using compatibility and preview gcc packages

The compatibility and preview gcc packages provide the compiler binaries under a name that incorporates the version number. For instance, to compile code on Red Hat Enterprise Linux 5.4 using the gcc 4.4 Technology Preview packages, call the compiler as gcc44. When building code that uses a "configure" script, this is best done at configure time:

# env CC=/usr/bin/gcc44 CXX=/usr/bin/g++44 ./configure ...
Red Hat Developer Toolset

Red Hat provides another option via the Red Hat Developer Toolset.

With the developer toolset, developers can choose to take advantage of the latest versions of the GNU developer tool chain, packaged for easy installation on Red Hat Enterprise Linux. This version of the GNU development tool chain is an alternative to the toolchain offered as part of each Red Hat Enterprise Linux release. Of course, developers can continue to use the version of the toolchain provided in Red Hat Enterprise Linux.

The developer toolset gives software developers the ability to develop and compile an application once to run on multiple versions of Red Hat Enterprise Linux (such as Red Hat Enterprise Linux 5 and 6). Compatible with all supported versions of Red Hat Enterprise Linux, the developer toolset is available for users who develop applications for Red Hat Enterprise Linux 5 and 6. Please see the release notes for support of specific minor releases.

Unlike the compatibility and preview gcc packages provided with RHEL itself, the developer toolset packages put their content under a /opt/rh path. The scl ("Software CoLlections") tool is provided to make use of the tool versions from the Developer Toolset easy while minimising the potential for confusion with the regular RHEL tools.

Red Hat provides support to Red Hat Developer Tool Set for all Red Hat customers with an active Red Hat Enterprise Linux Developer subscription.

You will need an active Red Hat Enterprise Linux Developer subscription to gain access to Red Hat Developer Tool set.

For further information on Red Hat Developer Toolset, refer to the relevant release documentation:
https://access.redhat.com/site/documentation/en-US/Red_Hat_Developer_Toolset/.

For further information on Red Hat Enterprise Linux Developer subscription, you may reference the following links:
* Red Hat Discussion
* Red Hat Developer Toolset Support Policy

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.