User guide
Chapter 4.
39
Compiling and Building
Red Hat Enterprise Linux 6 includes many packages used for software development, inluding tools for
compiling and building source code. This chapter discusses several of these packages and tools used
to compile source code.
4.1. GNU Compiler Collection (GCC)
The GNU Compiler Collection (GCC) is a set of tools for compiling a variety of programming
languages (including C, C++, ObjectiveC,ObjectiveC++, Fortran, and Ada) into highly optimized
machine code. These tools include various compilers (like gcc and g++), run-time libraries (like
libgcc, libstdc++, libgfortran, and libgomp), and miscellaneous other utilities.
4.1.1. GCC Status and Features
GCC for Red Hat Enterprise Linux 6 is based on the 4.4.x release series and includes several bug
fixes, enhancements, and backports from upcoming releases (including the GCC 4.5). However, GCC
4.5 was not considered sufficiently mature for an enterprise distribution when RHEL6 features were
frozen.
This standardization means that as updates to the 4.4 series become available (4.4.1, 4.4.2, ect),
they will be incorporated into the compiler included with RHEL6 as updates. Red Hat may import
additional backports and enhancements from upcoming releases outside the 4.4 series that won't
break compatibility within the Enterprise Linux release. Occassionally, code that was not compliant
to standards may fail to compile or its functionality may change in the process of fixing bugs or
maintaining standards compliant behavior.
Since the previous release of Red Hat Enterprise Linux, GCC has had three major releases: 4.2.x,
4.3.x, and 4.4.x. A selective summary of the expansive list of changes follows.
• The inliner, dead code elimination routines, compile time, and memory usage codes are now
improved. This release also features a new register allocator, instruction scheduler, and software
pipeliner.
• Version 3.0 of the OpenMP specification is now supported for the C, C++, and Fortran compilers.
• Experimental support for the upcoming ISO C++ standard (C++0x) is included. This has support
for auto/inline namespaces, character types, and scoped enumerations. To enable this, use the
compiler options -std=c++0x (which disables GNU extensions) or -std=gnu++0x.
For a more detailed list of the status of C++0x improvements, refer to:
http://gcc.gnu.org/gcc-4.4/cxx0x_status.html
• GCC now incorporates the Variable Tracking at Assignments (VTA) infrastructure. This allows GCC
to better track variables during optimizations so that it can produce improved debugging information
(i.e. DWARF) for the Gnome Debugger, SystemTap, and other tools. For a brief overview of VTA,
refer to Section 5.3, “Variable Tracking at Assignments”.
With VTA you can debug optimized code drastically better than with previous GCC releases, and
you do not have to compile with -O0 to provide a better debugging experience.
• Fortran 2008 is now supported, while support for Fortran 2003 is extended.
For a more detailed list of improvements in GCC, refer to: