Red Hat Developer Toolset 1.x User Guide - Linux
Red Hat Developer Toolset 1.x User Guide - Linux
Red Hat Developer Toolset 1.x User Guide - Linux
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 1<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.1<br />
<strong>User</strong> <strong>Guide</strong><br />
Installing and Using <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
Edition 1<br />
Jaromír Hradílek<br />
<strong>Red</strong> <strong>Hat</strong> Engineering Content Services<br />
jhradilek@redhat.com<br />
Jacquelynn East<br />
<strong>Red</strong> <strong>Hat</strong> Engineering Content Services<br />
jeast@redhat.com<br />
Matt Newsome<br />
<strong>Red</strong> <strong>Hat</strong> Software Engineering<br />
mnewsome@redhat.com
2 Legal Notice<br />
Legal Notice<br />
Copyright © 2012, 2013 <strong>Red</strong> <strong>Hat</strong>, Inc.<br />
The text of and illustrations in this document are licensed by <strong>Red</strong> <strong>Hat</strong> under a Creative Commons<br />
Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at<br />
http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this<br />
document or an adaptation of it, you must provide the URL for the original version.<br />
<strong>Red</strong> <strong>Hat</strong>, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section<br />
4d of CC-BY-SA to the fullest extent permitted by applicable law.<br />
<strong>Red</strong> <strong>Hat</strong>, <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong>, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo,<br />
and RHCE are trademarks of <strong>Red</strong> <strong>Hat</strong>, Inc., registered in the United States and other countries.<br />
<strong>Linux</strong>® is the registered trademark of Linus Torvalds in the United States and other countries.<br />
Java® is a registered trademark of Oracle and/or its affiliates.<br />
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States<br />
and/or other countries.<br />
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other<br />
countries.<br />
All other trademarks are the property of their respective owners.<br />
1801 Varsity Drive<br />
Raleigh, NC 27606-2072 USA<br />
Phone: +1 919 754 3700<br />
Phone: 888 733 4281<br />
Fax: +1 919 754 3701
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 3<br />
Abstract<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is a <strong>Red</strong> <strong>Hat</strong> offering for developers on the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
platform. The <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>User</strong> <strong>Guide</strong> provides an overview of this product, explains how<br />
to invoke and use the <strong>Developer</strong> <strong>Toolset</strong> versions of the tools, and links to resources with more in-depth<br />
information.
4 Table of Contents<br />
Table of Contents<br />
Preface<br />
1. Document Conventions<br />
1.1. Typographic Conventions<br />
1.2. Pull-quote Conventions<br />
1.3. Notes and Warnings<br />
2. Getting Help and Giving Feedback<br />
2.1. Do You Need Help?<br />
2.2. We Need Feedback!<br />
I. Introduction<br />
1. <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.1. About <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.2. Main Features<br />
1.3. Compatibility<br />
1.4. Getting Access to <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.4.1. Using RHN Classic<br />
1.4.2. Using <strong>Red</strong> <strong>Hat</strong> Subscription Management<br />
1.5. Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.6. Updating <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.7. Uninstalling <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.8. Additional Resources<br />
II. Development Tools<br />
2. GNU Compiler Collection (GCC)<br />
2.1. GNU C Compiler<br />
2.1.1. Installing the C Compiler<br />
2.1.2. Using the C Compiler<br />
2.1.3. Running a C Program<br />
2.2. GNU C++ Compiler<br />
2.2.1. Installing the C++ Compiler<br />
2.2.2. Using the C++ Compiler<br />
2.2.3. Running a C++ Program<br />
2.3. GNU Fortran Compiler<br />
2.3.1. Installing the Fortran Compiler<br />
2.3.2. Using the Fortran Compiler<br />
2.3.3. Running a Fortran Program<br />
2.4. Additional Resources<br />
3. GNU Debugger (GDB)<br />
3.1. Installing the GNU Debugger<br />
3.2. Preparing a Program for Debugging<br />
3.3. Running the GNU Debugger<br />
3.4. Listing Source Code<br />
3.5. Setting Breakpoints<br />
3.6. Starting Execution<br />
3.7. Displaying Current Values<br />
3.8. Continuing Execution<br />
3.9. Additional Resources
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 5<br />
4. binutils<br />
4.1. Installing binutils<br />
4.2. Using the GNU Assembler<br />
4.3. Using the GNU Linker<br />
4.4. Using Other Binary Tools<br />
4.5. Additional Resources<br />
5. elfutils<br />
5.1. Installing elfutils<br />
5.2. Using elfutils<br />
5.3. Additional Resources<br />
6. dwz<br />
6.1. Installing dwz<br />
6.2. Using dwz<br />
6.3. Additional Resources<br />
III. Performance Monitoring Tools<br />
7. SystemTap<br />
7.1. Installing SystemTap<br />
7.2. Using SystemTap<br />
7.3. Additional Resources<br />
8. Valgrind<br />
8.1. Installing Valgrind<br />
8.2. Using Valgrind<br />
8.3. Additional Resources<br />
9. OProfile<br />
9.1. Installing OProfile<br />
9.2. Using OProfile<br />
9.3. Additional Resources<br />
IV. Integrated Development Environments<br />
10. Eclipse<br />
10.1. Installing Eclipse<br />
10.2. Running Eclipse<br />
10.3. Additional Resources<br />
V. Getting Help<br />
11. Accessing <strong>Red</strong> <strong>Hat</strong> Product Documentation<br />
12. Accessing the Customer Portal<br />
12.1. The Plan Menu<br />
12.2. The Deploy Menu<br />
12.3. The Connect Menu<br />
13. Contacting Global Support Services<br />
13.1. Gathering Required Information<br />
13.2. Escalating an Issue<br />
13.3. Re-opening a Service Request<br />
13.4. Additional Resources<br />
A. Changes in Version 1.0<br />
A.1. Changes in GCC 4.7.0
6 Table of Contents<br />
A.1.1. Status and Features<br />
A.1.2. Language Compatibility<br />
A.1.3. ABI Compatibility<br />
A.1.4. Debugging Compatibility<br />
A.1.5. Other Compatibility<br />
A.2. Changes in GDB 7.4<br />
A.2.1. New Features<br />
A.2.2. Compatibility Changes<br />
A.3. Changes in binutils 2.22.52<br />
A.3.1. GNU Linker<br />
A.3.2. GNU Assembler<br />
A.3.3. Other Binary Tools<br />
B. Changes in Version 1.1<br />
B.1. Changes in GCC 4.7.2<br />
B.1.1. C++11 Compatibility<br />
B.1.2. Fortran<br />
B.1.3. Architecture-specific Options<br />
B.2. Changes in GDB 7.5<br />
B.3. Changes in binutils 2.23.51<br />
B.3.1. GNU Linker<br />
B.3.2. GNU Assembler<br />
B.3.3. Other Binary Tools<br />
B.4. Changes in elfutils 0.154<br />
B.5. Changes in Valgrind 3.8.1<br />
B.6. Changes in OProfile 0.154<br />
C. Revision History<br />
Index
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 7<br />
Preface<br />
1. Document Conventions<br />
This manual uses several conventions to highlight certain words and phrases and draw attention to<br />
specific pieces of information.<br />
In PDF and paper editions, this manual uses typefaces drawn from the Liberation Fonts set. The<br />
Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative<br />
but equivalent typefaces are displayed. Note: <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 and later includes the<br />
Liberation Fonts set by default.<br />
1.1. Typographic Conventions<br />
Four typographic conventions are used to call attention to specific words and phrases. These<br />
conventions, and the circumstances they apply to, are as follows.<br />
Mono-spaced Bold<br />
Used to highlight system input, including shell commands, file names and paths. Also used to highlight<br />
keys and key combinations. For example:<br />
To see the contents of the file my_next_bestselling_novel in your current working<br />
directory, enter the cat my_next_bestselling_novel command at the shell prompt<br />
and press Enter to execute the command.<br />
The above includes a file name, a shell command and a key, all presented in mono-spaced bold and all<br />
distinguishable thanks to context.<br />
Key combinations can be distinguished from an individual key by the plus sign that connects each part of<br />
a key combination. For example:<br />
Press Enter to execute the command.<br />
Press Ctrl+Alt+F2 to switch to a virtual terminal.<br />
The first example highlights a particular key to press. The second example highlights a key combination:<br />
a set of three keys pressed simultaneously.<br />
If source code is discussed, class names, methods, functions, variable names and returned values<br />
mentioned within a paragraph will be presented as above, in mono-spaced bold. For example:<br />
File-related classes include filesystem for file systems, file for files, and dir for<br />
directories. Each class has its own associated set of permissions.<br />
Proportional Bold<br />
This denotes words or phrases encountered on a system, including application names; dialog box text;<br />
labeled buttons; check-box and radio button labels; menu titles and sub-menu titles. For example:<br />
Choose System → Preferences → Mouse from the main menu bar to launch Mouse<br />
Preferences. In the Buttons tab, click the Left-handed mouse check box and click<br />
Close to switch the primary mouse button from the left to the right (making the mouse<br />
suitable for use in the left hand).<br />
To insert a special character into a gedit file, choose Applications → Accessories →<br />
Character Map from the main menu bar. Next, choose Search → Find… from the
8 Preface<br />
Character Map menu bar, type the name of the character in the Search field and click<br />
Next. The character you sought will be highlighted in the Character Table. Double-click<br />
this highlighted character to place it in the Text to copy field and then click the Copy<br />
button. Now switch back to your document and choose Edit → Paste from the gedit menu<br />
bar.<br />
The above text includes application names; system-wide menu names and items; application-specific<br />
menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all<br />
distinguishable by context.<br />
Mono-spaced Bold Italic or Proportional Bold Italic<br />
Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or variable<br />
text. Italics denotes text you do not input literally or displayed text that changes depending on<br />
circumstance. For example:<br />
To connect to a remote machine using ssh, type ssh username@domain.name at a shell<br />
prompt. If the remote machine is example.com and your username on that machine is<br />
john, type ssh john@example.com.<br />
The mount -o remount file-system command remounts the named file system. For<br />
example, to remount the /home file system, the command is mount -o remount /home.<br />
To see the version of a currently installed package, use the rpm -q package command. It<br />
will return a result as follows: package-version-release.<br />
Note the words in bold italics above — username, domain.name, file-system, package, version and<br />
release. Each word is a placeholder, either for text you enter when issuing a command or for text<br />
displayed by the system.<br />
Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and<br />
important term. For example:<br />
Publican is a DocBook publishing system.<br />
1.2. Pull-quote Conventions<br />
Terminal output and source code listings are set off visually from the surrounding text.<br />
Output sent to a terminal is set in mono-spaced roman and presented thus:<br />
books Desktop documentation drafts mss photos stuff svn<br />
books_tests Desktop1 downloads images notes scripts svgs<br />
Source-code listings are also set in mono-spaced roman but add syntax highlighting as follows:
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 9<br />
package org.jboss.book.jca.ex1;<br />
import javax.naming.InitialContext;<br />
public class ExClient<br />
{<br />
public static void main(String args[])<br />
throws Exception<br />
{<br />
InitialContext iniCtx = new InitialContext();<br />
Object ref = iniCtx.lookup("EchoBean");<br />
EchoHome home = (EchoHome) ref;<br />
Echo echo = home.create();<br />
System.out.println("Created Echo");<br />
}<br />
}<br />
System.out.println("Echo.echo('Hello') = " + echo.echo("Hello"));<br />
1.3. Notes and Warnings<br />
Finally, we use three visual styles to draw attention to information that might otherwise be overlooked.<br />
Note<br />
Notes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a note should<br />
have no negative consequences, but you might miss out on a trick that makes your life easier.<br />
Important<br />
Important boxes detail things that are easily missed: configuration changes that only apply to the<br />
current session, or services that need restarting before an update will apply. Ignoring a box<br />
labeled 'Important' will not cause data loss but may cause irritation and frustration.<br />
Warning<br />
Warnings should not be ignored. Ignoring warnings will most likely cause data loss.<br />
2. Getting Help and Giving Feedback<br />
2.1. Do You Need Help?<br />
If you experience difficulty with a procedure described in this documentation, visit the <strong>Red</strong> <strong>Hat</strong> Customer<br />
Portal at http://access.redhat.com. Through the customer portal, you can:<br />
search or browse through a knowledgebase of technical support articles about <strong>Red</strong> <strong>Hat</strong> products.<br />
submit a support case to <strong>Red</strong> <strong>Hat</strong> Global Support Services (GSS).<br />
access other product documentation.<br />
<strong>Red</strong> <strong>Hat</strong> also hosts a large number of electronic mailing lists for discussion of <strong>Red</strong> <strong>Hat</strong> software and
10 Preface<br />
technology. You can find a list of publicly available mailing lists at https://www.redhat.com/mailman/listinfo.<br />
Click on the name of any mailing list to subscribe to that list or to access the list archives.<br />
2.2. We Need Feedback!<br />
If you find a typographical error in this manual, or if you have thought of a way to make this manual<br />
better, we would love to hear from you! Please submit a report in Bugzilla: http://bugzilla.redhat.com/<br />
against the product <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>.<br />
When submitting a bug report, be sure to mention the manual's identifier: doc-<strong>User</strong>_<strong>Guide</strong><br />
If you have a suggestion for improving the documentation, try to be as specific as possible when<br />
describing it. If you have found an error, please include the section number and some of the surrounding<br />
text so we can find it easily.
Part I. Introduction<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 11
12 Chapter 1. <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
Chapter 1. <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.1. About <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is a <strong>Red</strong> <strong>Hat</strong> offering for developers on the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
platform, and provides a complete set of development and performance analysis tools that can be<br />
installed and used on multiple versions of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong>. Executables built with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> toolchain can then also be deployed and run on multiple versions of <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong>. For detailed compatibility information, refer to Section 1.3, “Compatibility”.<br />
Critically, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> does not replace the default system tools provided with <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong> 5 or 6 when installed on those platforms. Instead, a parallel set of developer tools<br />
provides an alternative, newer version of those tools for optional use by developers. The default<br />
compiler and debugger, for example, remain those provided by the base <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
system.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> differs from “Technology Preview” compiler releases previously supplied in<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> in two important respects:<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> can be used on multiple major and minor releases of <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong>, as detailed in Section 1.3, “Compatibility”.<br />
Unlike Technology Preview compilers and other tools shipped in earlier <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong>,<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is fully supported under <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> Subscription Level<br />
Agreements, is functionally complete, and is intended for production use.<br />
Important bug fixes and security errata will be issued to <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> subscribers in a<br />
similar manner to <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> for two years from the release of each major version release.<br />
New major versions of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> will be released annually, providing significant<br />
updates for existing components and adding major new components. A single minor release, issued six<br />
months after each new major version release, will provide a smaller update of bug fixes, security errata,<br />
and new minor components.<br />
Additionally, the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> Application Compatibility Specification also applies to <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> (subject to some constraints on the use of newer C++11 language features, detailed<br />
in Section A.1.3, “ABI Compatibility”).<br />
Important<br />
Applications and libraries provided by <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> do not replace the <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong> system versions, nor are they used in preference to the system versions. Using<br />
a framework called Software Collections, an additional set of developer tools is installed into<br />
the /opt directory and is explicitly enabled by the user on demand using the supplied scl utility.<br />
1.2. Main Features<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 provides current versions of the following tools:<br />
GNU Compiler Collection (GCC) version 4 .7.2;<br />
GNU Debugger (GDB) version 7.5;<br />
binutils version 2.23.51;<br />
elfutils version 0.154 ;<br />
dwz version 0.7;
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 13<br />
SystemTap version 1.8;<br />
Valgrind version 3.8.1;<br />
OProfile version 0.9.7.<br />
In particular, the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> version of the GNU Compiler Collection (GCC) provides<br />
the following features:<br />
Support for the Fortran programming language.<br />
Experimental support for the C++11 standard.<br />
Experimental support for C++11 atomic types and Transactional Memory.<br />
Improved support for link-time optimization (LTO).<br />
Improved support for interprocedural optimization.<br />
New -Ofast general optimization level.<br />
New string length optimization pass.<br />
Various compile time and memory usage improvements.<br />
Support for OpenMP 3.1, an API specification for parallel programming.<br />
Optimization for various new Intel and AMD processors.<br />
The version of the GNU Debugger (GDB) included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides the<br />
following features:<br />
Improved and expanded support for Python scripting.<br />
Improved handling of C++ debugee executables.<br />
Improved inferior control commands.<br />
Improved support for ambiguous line specifications.<br />
Improved tracepoint support.<br />
Multi-program debugging.<br />
Additionally, the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> version of binutils provides these features:<br />
The new gold linker, which is smaller and faster than ld. Note that gold is not the default linker<br />
and must be explicitly enabled by using the alternatives command.<br />
Support for link-time optimization (LTO) in conjunction with GCC.<br />
Support for build-IDs, unique numbers to identify executables.<br />
Support for the IFUNC and UNIQUE symbols that are used by glibc to improve performance. Due<br />
to dependencies on a particular version of the glibc library, these symbols are only available on<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.<br />
Compressed debug sections for smaller debug info files.<br />
For a full list of changes and features introduced in this release, refer to Appendix B, Changes in Version<br />
1.1.<br />
1.3. Compatibility<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 is available for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 and 6, both for 32-bit and 64-<br />
bit Intel and AMD architectures. Table 1.1, “<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 Compatibility Matrix”<br />
illustrates the support for binaries built with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> on a certain version of <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong> when those binaries are run on various other versions of this system.<br />
For ABI compatibility information, refer to Section A.1.3, “ABI Compatibility”.
14 Chapter 1. <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
Table 1.1. <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 Compatibility Matrix<br />
“Buil<br />
d<br />
with”<br />
“Run on”<br />
< 5.6 5.6<br />
EUS<br />
5.7 5.8 5.9 6.0<br />
EUS<br />
6.1<br />
EUS<br />
6.2<br />
EUS<br />
< 5.6 Unsupported version of the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> host<br />
5.6<br />
EUS<br />
5.7 Unsupported version of the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> host<br />
5.8 Unsupported version of the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> host<br />
5.9<br />
6.0<br />
EUS<br />
6.1<br />
EUS<br />
6.2<br />
EUS<br />
6.3<br />
6.4<br />
Unsupported<br />
Supported<br />
Unsupported version of the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> host<br />
6.3 6.4<br />
1.4. Getting Access to <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is an offering that is distributed as part of the developer subscriptions listed<br />
in Table 1.2, “Subscriptions that provide <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”. Depending on the subscription<br />
management service with which you registered your <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system, you can either<br />
enable <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> by using the <strong>Red</strong> <strong>Hat</strong> Subscription Management, or by using RHN<br />
Classic.<br />
For detailed instructions on how to enable <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> using RHN Classic or <strong>Red</strong> <strong>Hat</strong><br />
Subscription Management, refer to the respective section below. For information on how to register your<br />
system with one of these subscription management services, see the <strong>Red</strong> <strong>Hat</strong> Subscription<br />
Management <strong>Guide</strong>.<br />
Important<br />
If you are running a version of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> prior to 5.9 or 6.4, you will be unable to<br />
download <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> through <strong>Red</strong> <strong>Hat</strong> Subscription Management. To obtain <strong>Red</strong><br />
<strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, you will need to either update to <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.9 or 6.4, or<br />
register your system with RHN Classic. For more information, refer to<br />
https://access.redhat.com/knowledge/solutions/129003.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 15<br />
Table 1.2. Subscriptions that provide <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
SKU<br />
RH2282403<br />
RH2264664<br />
RH2262474<br />
RH3482727<br />
RH3413336<br />
RH3414706<br />
RH3474212<br />
RH3437268<br />
SER0402<br />
SER0403<br />
Subscription Name<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> <strong>Developer</strong> Support, Professional<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> <strong>Developer</strong> Support, Enterprise<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> <strong>Developer</strong> Suite<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> <strong>Developer</strong> Workstation, Professional<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> <strong>Developer</strong> Workstation, Enterprise<br />
30 day Self-Supported <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> <strong>Developer</strong> Workstation<br />
Evaluation<br />
60 day Supported <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> <strong>Developer</strong> Workstation Evaluation<br />
90 day Supported <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> <strong>Developer</strong> Workstation Evaluation<br />
1-year Unsupported Partner Evaluation <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
1-year Unsupported <strong>Red</strong> <strong>Hat</strong> Advanced Partner Subscription<br />
1.4 .1. Using RHN Classic<br />
If your system is registered with RHN Classic, complete the following steps to subscribe to <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong>:<br />
1. Display a list of all channels that are available to you in order to determine the exact name of the<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> channel. To do so, type the following at a shell prompt as root:<br />
rhn-channel --available-channels<br />
The name of the channel depends on the specific version of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> you are<br />
using and is in the rhel-architecture-variant-dts-version format, where architecture<br />
is the system's CPU architecture (x86_64 or i386), variant is the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
system variant (server or workstation), and version is the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system<br />
version (5 or 6).<br />
2. Subscribe the system to the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> channel by running the following<br />
command as root:<br />
rhn-channel --add --channel=channel_name<br />
Replace channel_name with the name you determined in the previous step.<br />
3. To verify the list of channels you are subscribed to, at any time, run as root:<br />
rhn-channel --list<br />
Once the system is subscribed, you can install <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> as described in Section 1.5,<br />
“Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”. For more information on how to register your system with RHN<br />
Classic, refer to the <strong>Red</strong> <strong>Hat</strong> Subscription Management <strong>Guide</strong>.<br />
1.4 .2. Using <strong>Red</strong> <strong>Hat</strong> Subscription Management<br />
If your system is registered with <strong>Red</strong> <strong>Hat</strong> Subscription Management, complete the following steps to<br />
attach a subscription that provides access to the repository for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, and then<br />
enable that repository:<br />
1. Display a list of all subscriptions that are available for your system to determine the pool ID of a<br />
subscription that provides <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>. To do so, type the following at a shell<br />
prompt as root:
16 Chapter 1. <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
subscription-manager list --available<br />
For each available subscription, this command displays its name, unique identifier, expiration date,<br />
and other details related to your subscription. The pool ID is listed on a line beginning with Pool<br />
Id.<br />
For a complete list of subscriptions that provide access to <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, refer to<br />
Table 1.2, “Subscriptions that provide <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”.<br />
2. Attach the appropriate subscription to your system by running the following command as root:<br />
subscription-manager subscribe --pool=pool_id<br />
Replace pool_id with the pool ID you determined in the previous step. To verify the list of<br />
subscriptions your system has currently attached, at any time, run as root:<br />
subscription-manager list --consumed<br />
3. Display a list of available Yum repositories to retrieve repository metadata and to determine the<br />
exact name of the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> repositories. As root, type:<br />
yum repolist all<br />
The repository names depend on the specific version of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> you are using,<br />
and are in the following format:<br />
rhel-variant-dts-version-rpms<br />
rhel-variant-dts-version-debug-rpms<br />
rhel-variant-dts-version-source-rpms<br />
Replace variant with the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system variant (server or workstation),<br />
and version with the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version (5 or 6).<br />
4. Enable the appropriate repository. On <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6, you can do so by running the<br />
following command as root:<br />
yum-config-manager --enable repository<br />
On <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5, which does not support the yum-config-manager tool, edit the<br />
/etc/yum.repos.d/redhat.repo file, locate the relevant [repository] section, and set the<br />
value of the enabled option to 1:<br />
enabled = 1<br />
Once the subscription is attached to the system, you can install <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> as<br />
described in Section 1.5, “Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”. For more information on how to register<br />
your system using <strong>Red</strong> <strong>Hat</strong> Subscription Management and associate it with subscriptions, refer to the<br />
<strong>Red</strong> <strong>Hat</strong> Subscription Management <strong>Guide</strong>.<br />
1.5. Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is distributed as a collection of RPM packages. To install the tools and<br />
libraries provided by <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, ensure that the system is associated with an<br />
appropriate subscription (see Section 1.4, “Getting Access to <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”), and install<br />
the devtoolset-1.1 package by typing the following at a shell prompt as root:
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 17<br />
yum install devtoolset-1.1<br />
This installs the GNU Compiler Collection, GNU Debugger, binutils, the scl utility, and other dependent<br />
packages to the system. You can also install any of the additional packages listed in the Package<br />
Manifest section of the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 Release Notes by running the command in the<br />
following form as root:<br />
yum install package_name<br />
For example, to install libitm and devtoolset-1.1-gdb-gdbserver, type:<br />
yum install libitm devtoolset-1.1-gdb-gdbserver<br />
To install debugging information for any of the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> packages, run as root:<br />
debuginfo-install package_name<br />
1.6. Updating <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
Before updating an existing installation of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> on your system, make sure the<br />
devtoolset-1.0-gcc-debuginfo package is not installed. To do so, type the following at a shell prompt as<br />
root:<br />
yum remove devtoolset-1.0-gcc-debuginfo<br />
Then run the following command as root to update your <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> installation:<br />
yum update<br />
This updates all packages on your <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system, including the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> versions of the GNU Compiler Collection, GNU Debugger, binutils, and other dependent<br />
packages. Note that if you need additional packages with debugging information for any of the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> packages (such as devtoolset-1.1-gcc-debuginfo), you can install them at any time by<br />
using the following command as root:<br />
debuginfo-install package_name<br />
1.7. Uninstalling <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
To uninstall <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> packages from your system, type the following at a shell prompt<br />
as root:<br />
yum remove devtoolset-1.1\*<br />
This removes the GNU Compiler Collection, GNU Debugger, binutils, and other packages that are part of<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> from the system. To uninstall the scl utility as well, type as root:<br />
yum remove scl-utils\*<br />
Note that uninstallation of the tools provided by <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> does not affect the <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong> system versions of these tools.
18 Chapter 1. <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.8. Additional Resources<br />
For more information about <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong>, refer to the<br />
resources listed below.<br />
Online Documentation<br />
<strong>Red</strong> <strong>Hat</strong> Subscription Management <strong>Guide</strong> — The <strong>Red</strong> <strong>Hat</strong> Subscription Management <strong>Guide</strong> provides<br />
detailed information on how to manage subscriptions on <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong>.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 Release Notes — The Release Notes for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.1 contain more information about this product.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 <strong>Developer</strong> <strong>Guide</strong> — The <strong>Developer</strong> <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6<br />
provides more information on the Eclipse IDE, libraries and runtime support, compiling and building,<br />
debugging, and profiling on this system.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 Installation <strong>Guide</strong> — The Installation <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
6 explains how to obtain, install, and update the system.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 Installation <strong>Guide</strong> — The Installation <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
5 explains how to obtain, install, and update the system.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 Deployment <strong>Guide</strong> — The Deployment <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6 documents relevant information regarding the deployment, configuration, and administration<br />
of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 Deployment <strong>Guide</strong> — The Deployment <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 5 documents relevant information regarding the deployment, configuration, and administration<br />
of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.<br />
See Also<br />
Appendix B, Changes in Version 1.1 provides a comprehensive list of changes and improvements<br />
over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system versions of the GNU Compiler Collection, GNU Debugger,<br />
and binutils, as well as information about the language, ABI, and debugging compatibility.
Part II. Development Tools<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 19
20 Chapter 2. GNU Compiler Collection (GCC)<br />
Chapter 2. GNU Compiler Collection (GCC)<br />
The GNU Compiler Collection, commonly abbreviated GCC, is a portable compiler suite with support<br />
for a wide selection of programming languages.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is distributed with GCC 4 .7.2. This version is more recent than the version<br />
included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> and provides numerous bug fixes and enhancements, including<br />
optimization for various new Intel and AMD processors, support for OpenMP 3.1 and link-time<br />
optimization. This version also includes experimental support for the C++11 standard, C++11 atomic<br />
types, and Transactional Memory. For a detailed list of changes, refer to Section B.1, “Changes in GCC<br />
4.7.2”.<br />
2.1. GNU C Compiler<br />
2.1.1. Installing the C Compiler<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, the GNU C compiler is provided by the devtoolset-1.1-gcc package, and is<br />
automatically installed with devtoolset-1.1 as described in Section 1.5, “Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong>”.<br />
2.1.2. Using the C Compiler<br />
To compile a C program on the command line, run the gcc compiler as follows:<br />
scl enable devtoolset-1.1 'gcc -o output_file source_file...'<br />
This creates a binary file named output_file in the current working directory. If the -o option is<br />
omitted, the compiler creates a file named a.out by default.<br />
When you are working on a project that consists of several source files, it is common to compile an<br />
object file for each of the source files first and then link these object files together. This way, when you<br />
change a single source file, you can recompile only this file without having to compile the entire project.<br />
To compile an object file on the command line, run the following command:<br />
scl enable devtoolset-1.1 'gcc -o object_file -c source_file'<br />
This creates an object file named object_file. If the -o option is omitted, the compiler creates a file<br />
named after the source file with the .o file extension. To link object files together and create a binary file,<br />
run:<br />
scl enable devtoolset-1.1 'gcc -o output_file object_file...'<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> gcc as default:<br />
scl enable devtoolset-1.1 'bash'
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 21<br />
Note<br />
To verify the version of gcc you are using at any point, type the following at a shell prompt:<br />
which gcc<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s gcc executable path will begin with /opt. Alternatively, you can use<br />
the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> gcc:<br />
gcc -v<br />
Important<br />
Some newer library features are statically linked into applications built with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> to support execution on multiple versions of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong>. This adds a small<br />
additional security risk as normal <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> errata would not change this code. If<br />
the need for developers to rebuild their applications due to such an issue arises, <strong>Red</strong> <strong>Hat</strong> will<br />
signal this via a security erratum. <strong>Developer</strong>s are strongly advised not to statically link their entire<br />
application for the same reasons.<br />
Example 2.1. Compiling a C Program on the Command Line<br />
Imagine that you have a source file named hello.c with the following contents:<br />
#include <br />
int main(int argc, char *argv[]) {<br />
printf("Hello, World!\n");<br />
return 0;<br />
}<br />
To compile this source code on the command line by using the gcc compiler from <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong>, type:<br />
~]$ scl enable devtoolset-1.1 'gcc -o hello hello.c'<br />
This creates a new binary file called hello in the current working directory.<br />
2.1.3. Running a C Program<br />
When gcc compiles a program, it creates an executable binary file. To run this program on the command<br />
line, change to the directory with the executable file and type:<br />
./file_name
22 Chapter 2. GNU Compiler Collection (GCC)<br />
Example 2.2. Running a C Program on the Command Line<br />
Assuming that you have successfully compiled the hello binary file as shown in Example 2.1,<br />
“Compiling a C Program on the Command Line”, you can run it by typing the following at a shell prompt:<br />
~]$ ./hello<br />
Hello, World!<br />
2.2. GNU C++ Compiler<br />
2.2.1. Installing the C++ Compiler<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, the GNU C++ compiler is provided by the devtoolset-1.1-gcc-c++<br />
package, and is automatically installed with the devtoolset-1.1 package as described in Section 1.5,<br />
“Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”.<br />
2.2.2. Using the C++ Compiler<br />
To compile a C++ program on the command line, run the g++ compiler as follows:<br />
scl enable devtoolset-1.1 'g++ -o output_file source_file...'<br />
This creates a binary file named output_file in the current working directory. If the -o option is<br />
omitted, the g++ compiler creates a file named a.out by default.<br />
When you are working on a project that consists of several source files, it is common to compile an<br />
object file for each of the source files first and then link these object files together. This way, when you<br />
change a single source file, you can recompile only this file without having to compile the entire project.<br />
To compile an object file on the command line, run the following command:<br />
scl enable devtoolset-1.1 'g++ -o object_file -c source_file'<br />
This creates an object file named object_file. If the -o option is omitted, the g++ compiler creates a<br />
file named after the source file with the .o file extension. To link object files together and create a binary<br />
file, run:<br />
scl enable devtoolset-1.1 'g++ -o output_file object_file...'<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> g++ as default:<br />
scl enable devtoolset-1.1 'bash'
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 23<br />
Note<br />
To verify the version of g++ you are using at any point, type the following at a shell prompt:<br />
which g++<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s g++ executable path will begin with /opt. Alternatively, you can use<br />
the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> g++:<br />
g++ -v<br />
Important<br />
Some newer library features are statically linked into applications built with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> to support execution on multiple versions of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong>. This adds a small<br />
additional security risk as normal <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> errata would not change this code. If<br />
the need for developers to rebuild their applications due to such an issue arises, <strong>Red</strong> <strong>Hat</strong> will<br />
signal this via a security erratum. <strong>Developer</strong>s are strongly advised not to statically link their entire<br />
application for the same reasons.<br />
Example 2.3. Compiling a C++ Program on the Command Line<br />
Imagine that you have a source file named hello.cpp with the following contents:<br />
#include <br />
using namespace std;<br />
int main(int argc, char *argv[]) {<br />
cout
24 Chapter 2. GNU Compiler Collection (GCC)<br />
Example 2.4 . Running a C++ Program on the Command Line<br />
Assuming that you have successfully compiled the hello binary file as shown in Example 2.3,<br />
“Compiling a C++ Program on the Command Line”, you can run it by typing the following at a shell<br />
prompt:<br />
~]$ ./hello<br />
Hello, World!<br />
2.3. GNU Fortran Compiler<br />
2.3.1. Installing the Fortran Compiler<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, the GNU Fortran compiler is provided by the devtoolset-1.1-gcc-gfortran<br />
package, and is automatically installed with devtoolset-1.1 as described in Section 1.5, “Installing <strong>Red</strong><br />
<strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”.<br />
2.3.2. Using the Fortran Compiler<br />
To compile a Fortran program on the command line, run the gfortran compiler as follows:<br />
scl enable devtoolset-1.1 'gfortran -o output_file source_file...'<br />
This creates a binary file named output_file in the current working directory. If the -o option is<br />
omitted, the compiler creates a file named a.out by default.<br />
When you are working on a project that consists of several source files, it is common to compile an<br />
object file for each of the source files first and then link these object files together. This way, when you<br />
change a single source file, you can recompile only this file without having to compile the entire project.<br />
To compile an object file on the command line, run the following command:<br />
scl enable devtoolset-1.1 'gfortran -o object_file -c source_file'<br />
This creates an object file named object_file. If the -o option is omitted, the compiler creates a file<br />
named after the source file with the .o file extension. To link object files together and create a binary file,<br />
run:<br />
scl enable devtoolset-1.1 'gfortran -o output_file object_file...'<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> gfortran as default:<br />
scl enable devtoolset-1.1 'bash'
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 25<br />
Note<br />
To verify the version of gfortran you are using at any point, type the following at a shell<br />
prompt:<br />
which gfortran<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s gfortran executable path will begin with /opt. Alternatively, you<br />
can use the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> gfortran:<br />
gfortran -v<br />
Important<br />
Some newer library features are statically linked into applications built with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> to support execution on multiple versions of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong>. This adds a small<br />
additional security risk as normal <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> errata would not change this code. If<br />
the need for developers to rebuild their applications due to such an issue arises, <strong>Red</strong> <strong>Hat</strong> will<br />
signal this via a security erratum. <strong>Developer</strong>s are strongly advised not to statically link their entire<br />
application for the same reasons.<br />
Example 2.5. Compiling a Fortran Program on the Command Line<br />
Imagine that you have a source file named hello.f with the following contents:<br />
program hello<br />
print *, "Hello, World!"<br />
end program hello<br />
To compile this source code on the command line by using the gfortran compiler from <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong>, type:<br />
~]$ scl enable devtoolset-1.1 'gfortran -o hello hello.f'<br />
This creates a new binary file called hello in the current working directory.<br />
2.3.3. Running a Fortran Program<br />
When gfortran compiles a program, it creates an executable binary file. To run this program on the<br />
command line, change to the directory with the executable file and type:<br />
./file_name
26 Chapter 2. GNU Compiler Collection (GCC)<br />
Example 2.6. Running a Fortran Program on the Command Line<br />
Assuming that you have successfully compiled the hello binary file as shown in Example 2.5,<br />
“Compiling a Fortran Program on the Command Line”, you can run it by typing the following at a shell<br />
prompt:<br />
~]$ ./hello<br />
Hello, World!<br />
2.4. Additional Resources<br />
A detailed description of the GNU Compiler Collections and its features is beyond the scope of this book.<br />
For more information, refer to the resources listed below.<br />
Installed Documentation<br />
gcc(1) — The manual page for the gcc compiler provides detailed information on its usage; with few<br />
exceptions, g++ accepts the same command line options as gcc. To display the manual page for the<br />
version included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, type:<br />
scl enable devtoolset-1.1 'man gcc'<br />
gfortran(1) — The manual page for the gfortran compiler provides detailed information on its<br />
usage. To display the manual page for the version included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, type:<br />
scl enable devtoolset-1.1 'man gfortran'<br />
C++ Standard Library Documentation — Documentation on the C++ standard library can be optionally<br />
installed by typing the following at a shell prompt as root:<br />
yum install devtoolset-1.1-libstdc++-docs<br />
Once installed, HTML documentation is available at /opt/rh/devtoolset-<br />
1.1/root/usr/share/doc/devtoolset-1.1-libstdc++-docs-4.7.2/html/index.html.<br />
Online Documentation<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 <strong>Developer</strong> <strong>Guide</strong> — The <strong>Developer</strong> <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6<br />
provides in-depth information about GCC.<br />
Using the GNU Compiler Collection — The official GCC manual provides an in-depth description of<br />
the GNU compilers and their usage.<br />
The GNU C++ Library — The GNU C++ library documentation provides detailed information about<br />
the GNU implementation of the standard C++ library.<br />
The GNU Fortran Compiler — The GNU Fortran compiler documentation provides detailed<br />
information on gfortran's usage.<br />
See Also<br />
Section B.1, “Changes in GCC 4.7.2” provides a comprehensive list of features and improvements<br />
over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version of the GNU Compiler Collection, as well as<br />
information about the language, ABI, and debugging compatibility.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 27<br />
Chapter 1, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides an overview of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and more<br />
information on how to install it on your system.<br />
Chapter 3, GNU Debugger (GDB) provides information on how to debug programs written in C, C++,<br />
and Fortran.<br />
Chapter 4, binutils explains how to use the binutils, a collection of binary tools to inspect and<br />
manipulate object files and binaries.<br />
Chapter 5, elfutils explains how to use elfutils, a collection of binary tools to inspect and manipulate<br />
ELF files.<br />
Chapter 10, Eclipse provides a general introduction to the Eclipse development environment, and<br />
describes how to use it with the tools from <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>.
28 Chapter 3. GNU Debugger (GDB)<br />
Chapter 3. GNU Debugger (GDB)<br />
The GNU Debugger, commonly abbreviated as GDB, is a command line tool that can be used to debug<br />
programs written in various programming languages. It allows you to inspect memory within the code<br />
being debugged, control the execution state of the code, detect the execution of particular sections of<br />
code, and much more.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is distributed with GDB 7.5. This version is more recent than the version<br />
included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> and provides numerous bug fixes and enhancements, including<br />
improved support for Python scripting, ambiguous line specifications, and tracepoints, as well as<br />
improved inferior control commands and handling of C++ debugee executables. For a detailed list of<br />
changes, refer to Section B.2, “Changes in GDB 7.5”.<br />
3.1. Installing the GNU Debugger<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, the GNU Debugger is provided by the devtoolset-1.1-gdb package, and is<br />
automatically installed with devtoolset-1.1 as described in Section 1.5, “Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong>”.<br />
3.2. Preparing a Program for Debugging<br />
Compiling Programs with Debugging Information<br />
To compile a C program with debugging information that can be read by the GNU Debugger, make sure<br />
the gcc compiler is run with the -g option. To do so on the command line, use a command in the<br />
following form:<br />
scl enable devtoolset-1.1 'gcc -g -o output_file input_file...'<br />
Similarly, to compile a C++ program with debugging information, run:<br />
scl enable devtoolset-1.1 'g++ -g -o output_file input_file...'
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 29<br />
Example 3.1. Compiling a C Program With Debugging Information<br />
Imagine you have a source file named fibonacci.c with the following contents:<br />
#include <br />
#include <br />
int main (int argc, char *argv[]) {<br />
unsigned long int a = 0;<br />
unsigned long int b = 1;<br />
unsigned long int sum;<br />
while (b < LONG_MAX) {<br />
printf("%ld ", b);<br />
sum = a + b;<br />
a = b;<br />
b = sum;<br />
}<br />
return 0;<br />
}<br />
To compile this program on the command line using GCC from <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> with<br />
debugging information for the GNU Debugger, type:<br />
~]$ scl enable devtoolset-1.1 'gcc -g -o fibonacci fibonacci.c'<br />
This creates a new binary file called fibonacci in the current working directory.<br />
Installing Debugging Information for Existing Packages<br />
To install debugging information for a package that is already installed on the system, type the following<br />
at a shell prompt as root:<br />
debuginfo-install package_name<br />
Note that the yum-utils package must be installed for the debuginfo-install utility to be available on<br />
your system.<br />
Example 3.2. Installing Debugging Information for the glibc Package<br />
To install debugging information for the glibc package, type:<br />
~]# debuginfo-install glibc<br />
Loaded plugins: product-id, refresh-packagekit, subscription-manager<br />
--> Running transaction check<br />
---> Package glibc-debuginfo.x86_64 0:2.12-1.47.el6_2.5 will be installed<br />
...<br />
3.3. Running the GNU Debugger
30 Chapter 3. GNU Debugger (GDB)<br />
To run the GNU Debugger on a program you want to debug, type the following at a shell prompt:<br />
scl enable devtoolset-1.1 'gdb file_name'<br />
This starts the gdb debugger in interactive mode and displays the default prompt, (gdb). To quit the<br />
debugging session and return to the shell prompt, run the following command at any time:<br />
quit<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> gdb as default:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of gdb you are using at any point, type the following at a shell prompt:<br />
which gdb<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s gdb executable path will begin with /opt. Alternatively, you can use<br />
the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> gdb:<br />
gdb -v<br />
Example 3.3. Running the gdb Utility on the fibonacci Binary File<br />
Assuming that you have successfully compiled the fibonacci binary file as shown in Example 3.1,<br />
“Compiling a C Program With Debugging Information”, you can start debugging it with gdb by typing<br />
the following at a shell prompt:<br />
~]$ scl enable devtoolset-1.1 'gdb fibonacci'<br />
GNU gdb (GDB) <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> (7.4.50.20120120-43.el6)<br />
Copyright (C) 2012 Free Software Foundation, Inc.<br />
License GPLv3+: GNU GPL version 3 or later <br />
This is free software: you are free to change and redistribute it.<br />
There is NO WARRANTY, to the extent permitted by law. Type "show copying"<br />
and "show warranty" for details.<br />
This GDB was configured as "x86_64-redhat-linux-gnu".<br />
For bug reporting instructions, please see:<br />
.<br />
(gdb)<br />
3.4. Listing Source Code<br />
To view the source code of the program you are debugging, run the following command:
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 31<br />
list<br />
Before you start the execution of the program you are debugging, gdb displays first ten lines of the<br />
source code and any subsequent use of this command lists another ten lines. Once you start the<br />
execution, gdb displays the lines that are surrounding the line on which the execution stops, typically<br />
when you set a breakpoint.<br />
You can also display the code that is surrounding a particular line. To do so, run the command in the<br />
following form:<br />
list [file_name:]line_number<br />
Similarly, to display the code that is surrounding the beginning of a particular function, run:<br />
list [file_name:]function_name<br />
Note that you can change the number of lines the list command displays by running the following<br />
command:<br />
set listsize number<br />
Example 3.4 . Listing the Source Code of the fibonacci Binary File<br />
The fibonacci.c file listed in Example 3.1, “Compiling a C Program With Debugging Information”<br />
has exactly 17 lines. Assuming that you have compiled it with debugging information and you want the<br />
gdb utility to be capable of listing the entire source code, you can run the following command to<br />
change the number of listed lines to 20:<br />
(gdb) set listsize 20<br />
You can now display the entire source code of the file you are debugging by running the list<br />
command with no additional arguments:<br />
(gdb) list<br />
1 #include <br />
2 #include <br />
3<br />
4 int main (int argc, char *argv[]) {<br />
5 unsigned long int a = 0;<br />
6 unsigned long int b = 1;<br />
7 unsigned long int sum;<br />
8<br />
9 while (b < LONG_MAX) {<br />
10 printf("%ld ", b);<br />
11 sum = a + b;<br />
12 a = b;<br />
13 b = sum;<br />
14 }<br />
15<br />
16 return 0;<br />
17 }
32 Chapter 3. GNU Debugger (GDB)<br />
Setting a New Breakpoint<br />
To set a new breakpoint at a certain line, run the following command:<br />
break [file_name:]line_number<br />
You can also set a breakpoint on a certain function:<br />
break [file_name:]function_name<br />
Example 3.5. Setting a New Breakpoint<br />
Assuming that you have compiled the fibonacci.c file listed in Example 3.1, “Compiling a C<br />
Program With Debugging Information” with debugging information, you can set a new breakpoint at line<br />
10 by running the following command:<br />
(gdb) break 10<br />
Breakpoint 1 at 0x4004e5: file fibonacci.c, line 10.<br />
Listing Breakpoints<br />
To display a list of currently set breakpoints, run the following command:<br />
info breakpoints<br />
Example 3.6. Listing Breakpoints<br />
Assuming that you have followed the instructions in Example 3.5, “Setting a New Breakpoint”, you can<br />
display the list of currently set breakpoints by running the following command:<br />
(gdb) info breakpoints<br />
Num Type Disp Enb Address What<br />
1 breakpoint keep y 0x00000000004004e5 in main at fibonacci.c:10<br />
Deleting Existing Breakpoints<br />
To delete a breakpoint that is set at a certain line, run the following command:<br />
clear line_number<br />
Similarly, to delete a breakpoint that is set on a certain function, run:<br />
clear function_name<br />
You can also delete all breakpoints at once. To do so, run the clear command with no additional<br />
arguments:<br />
clear
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 33<br />
Example 3.7. Deleting an Existing Breakpoint<br />
Imagine that you have accidentally set a breakpoint at a wrong line and you want to remove it.<br />
Assuming that you have compiled the fibonacci.c file listed in Example 3.1, “Compiling a C<br />
Program With Debugging Information” with debugging information, you can set a new breakpoint at line<br />
7 by running the following command:<br />
(gdb) break 7<br />
Breakpoint 2 at 0x4004e3: file fibonacci.c, line 7.<br />
To remove this breakpoint, type:<br />
(gdb) clear 7<br />
Deleted breakpoint 2<br />
3.6. Starting Execution<br />
To start execution of the program you are debugging, run the following command:<br />
run<br />
If the program accepts any command line arguments, you can provide them as arguments to the run<br />
command:<br />
run argument…<br />
The execution stops when a first breakpoint (if any) is reached, when an error occurs, or when the<br />
program terminates.<br />
Example 3.8. Executing the fibonacci Binary File<br />
Assuming that you have followed the instructions in Example 3.5, “Setting a New Breakpoint”, you can<br />
execute the fibonacci binary file by running the following command:<br />
(gdb) run<br />
Starting program: /home/john/fibonacci<br />
Breakpoint 1, main (argc=1, argv=0x7fffffffe4d8) at fibonacci.c:10<br />
10 printf("%ld ", b);<br />
3.7. Displaying Current Values<br />
The gdb utility allows you to display the value of almost anything that is relevant to the program, from a<br />
variable of any complexity to a valid expression or even a library function. However, the most common<br />
task is to display the value of a variable.<br />
To display the current value of a certain variable, run the following command:
34 Chapter 3. GNU Debugger (GDB)<br />
print variable_name<br />
Example 3.9. Displaying the Current Values of Variables<br />
Assuming that you have followed the instructions in Example 3.8, “Executing the fibonacci Binary File”<br />
and the execution of the fibonacci binary stopped after reaching the breakpoint at line 10, you can<br />
display the current values of variables a and b as follows:<br />
(gdb) print a<br />
$1 = 0<br />
(gdb) print b<br />
$2 = 1<br />
3.8. Continuing Execution<br />
To resume the execution of the program you are debugging after it reached a breakpoint, run the<br />
following command:<br />
continue<br />
The execution stops again when another breakpoint is reached. To skip a certain number of breakpoints<br />
(typically when you are debugging a loop), you can run the continue command in the following form:<br />
continue number<br />
The gdb utility also allows you to stop the execution after executing a single line of code. To do so, run:<br />
step<br />
Finally, you can execute a certain number of lines by using the step command in the following form:<br />
step number
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 35<br />
Example 3.10. Continuing the Execution of the fibonacci Binary File<br />
Assuming that you have followed the instructions in Example 3.8, “Executing the fibonacci Binary File”<br />
and the execution of the fibonacci binary stopped after reaching the breakpoint at line 10, you can<br />
resume the execution by running the following command:<br />
(gdb) continue<br />
Continuing.<br />
Breakpoint 1, main (argc=1, argv=0x7fffffffe4d8) at fibonacci.c:10<br />
10 printf("%ld ", b);<br />
The execution stops the next time the breakpoint is reached. To execute next three lines of code, type:<br />
(gdb) step 3<br />
13 b = sum;<br />
This allows you to verify the current value of the sum variable before it is assigned to b:<br />
(gdb) print sum<br />
$3 = 2<br />
3.9. Additional Resources<br />
A detailed description of the GNU Debugger and all its features is beyond the scope of this book. For<br />
more information, refer to the resources listed below.<br />
Online Documentation<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 <strong>Developer</strong> <strong>Guide</strong> — The <strong>Developer</strong> <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6<br />
provides more information on the GNU Debugger and debugging.<br />
GDB Documentation — The official GDB documentation includes the GDB <strong>User</strong> Manual and other<br />
reference material.<br />
See Also<br />
Section B.2, “Changes in GDB 7.5” provides a comprehensive list of features and improvements over<br />
the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version of the GNU Debugger.<br />
Chapter 1, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides an overview of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and more<br />
information on how to install it on your system.<br />
Chapter 2, GNU Compiler Collection (GCC) provides further information on how to compile programs<br />
written in C, C++, and Fortran.<br />
Chapter 10, Eclipse provides a general introduction to the Eclipse development environment, and<br />
describes how to use it with the tools from <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>.
36 Chapter 4. binutils<br />
Chapter 4. binutils<br />
binutils is a collection of various binary tools such as the GNU linker, GNU assembler, and other<br />
utilities that allow you to inspect and manipulate object files and binaries. Refer to Table 4.1, “Tools<br />
Included in binutils for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>” for a complete list of binary tools that are distributed<br />
with the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> version of binutils.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is distributed with binutils 2.23.51. This version is more recent than the<br />
version included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> and provides numerous bug fixes and enhancements,<br />
including the new gold linker, several new command line options, improvements to the linker script<br />
language, and support for link-time optimization, compressed debug sections, and new instruction sets.<br />
For a detailed list of changes, refer to Section B.3, “Changes in binutils 2.23.51”.<br />
Table 4 .1. Tools Included in binutils for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
Name<br />
addr2line<br />
ar<br />
as<br />
c++filt<br />
elfedit<br />
gprof<br />
ld<br />
ld.bfd<br />
ld.gold<br />
nm<br />
objcopy<br />
objdump<br />
ranlib<br />
readelf<br />
size<br />
strings<br />
strip<br />
Description<br />
Translates addresses into file names and line numbers.<br />
Creates, modifies, and extracts files from archives.<br />
The GNU assembler.<br />
Decodes mangled C++ symbols.<br />
Examines and edits ELF files.<br />
Display profiling information.<br />
The GNU linker.<br />
An alternative to the GNU linker.<br />
A new ELF linker.<br />
Lists symbols from object files.<br />
Copies and translates object files.<br />
Displays information from object files.<br />
Generates an index to the contents of an archive to make access to this<br />
archive faster.<br />
Displays information about ELF files.<br />
Lists section sizes of object or archive files.<br />
Displays printable character sequences in files.<br />
Discards all symbols from object files.<br />
4.1. Installing binutils<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, binutils are provided by the devtoolset-1.1-binutils package, and are<br />
automatically installed with devtoolset-1.1 as described in Section 1.5, “Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong>”.<br />
4.2. Using the GNU Assembler<br />
To produce an object file from an assembly language program, run the as tool as follows:<br />
scl enable devtoolset-1.1 'as [option...] -o object_file source_file'<br />
This creates an object file named object_file in the current working directory.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 37<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> as as default:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of as you are using at any point, type the following at a shell prompt:<br />
which as<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s as executable path will begin with /opt. Alternatively, you can use<br />
the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> as:<br />
as -v<br />
4.3. Using the GNU Linker<br />
To create an executable binary file or a library from object files, run the ld tool as follows:<br />
scl enable devtoolset-1.1 'ld [option...] -o output_file object_file...'<br />
This creates a binary file named output_file in the current working directory. If the -o option is<br />
omitted, the compiler creates a file named a.out by default.<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> ld as default:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of ld you are using at any point, type the following at a shell prompt:<br />
which ld<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s ld executable path will begin with /opt. Alternatively, you can use<br />
the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> ld:<br />
ld -v<br />
4.4. Using Other Binary Tools<br />
The binutils provide many binary tools other than a linker and assembler. For a complete list of these
38 Chapter 4. binutils<br />
tools, refer to Table 4.1, “Tools Included in binutils for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”.<br />
To execute any of the tools that are part of binutils, run the command as follows:<br />
scl enable devtoolset-1.1 'tool [option...] file_name'<br />
Refer to Table 4.1, “Tools Included in binutils for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>” for a list of tools that are<br />
distributed with binutils. For example, to use the objdump tool to inspect an object file, type:<br />
scl enable devtoolset-1.1 'objdump [option...] object_file'<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> binary tools as default:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of binutils you are using at any point, type the following at a shell prompt:<br />
which objdump<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s objdump executable path will begin with /opt. Alternatively, you<br />
can use the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> objdump:<br />
objdump -v<br />
4.5. Additional Resources<br />
A detailed description of binutils is beyond the scope of this book. For more information, refer to the<br />
resources listed below.<br />
Installed Documentation<br />
as(1), ld(1), addr2line(1), ar(1), c++filt(1), elfedit(1), gprof(1), nm(1), objcopy(1), objdump(1),<br />
ranlib(1), readelf(1), size(1), strings(1), strip(1), — Manual pages for various binutils tools<br />
provide more information about their respective usage. To display a manual page for the version<br />
included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, type:<br />
scl enable devtoolset-1.1 'man tool'<br />
Online Documentation<br />
Documentation for binutils — The binutils documentation provides an in-depth description of the<br />
binary tools and their usage.<br />
See Also<br />
Section B.3, “Changes in binutils 2.23.51” provides a comprehensive list of features and<br />
improvements over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version of binutils.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 39<br />
Chapter 1, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides an overview of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and more<br />
information on how to install it on your system.<br />
Chapter 5, elfutils explains how to use elfutils, a collection of binary tools to inspect and manipulate<br />
ELF files.<br />
Chapter 2, GNU Compiler Collection (GCC) provides information on how to compile programs written<br />
in C, C++, and Fortran.
4 0 Chapter 5. elfutils<br />
Chapter 5. elfutils<br />
elfutils is a collection of various binary tools such as eu-objdump, eu-readelf, and other utilities<br />
that allow you to inspect and manipulate ELF files. Refer to Table 5.1, “Tools Included in elfutils for <strong>Red</strong><br />
<strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>” for a complete list of binary tools that are distributed with the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> version of elfutils.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is distributed with elfutils 0.154 . This version is more recent than the<br />
version included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> and provides numerous bug fixes and enhancements.<br />
Table 5.1. Tools Included in elfutils for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
Name<br />
eu-addr2line<br />
eu-ar<br />
eu-elfcmp<br />
eu-elflint<br />
eu-findtextrel<br />
eu-make-debugarchive<br />
eu-nm<br />
eu-objdump<br />
eu-ranlib<br />
eu-readelf<br />
eu-size<br />
eu-strings<br />
eu-strip<br />
eu-unstrip<br />
Description<br />
Translates addresses into file names and line numbers.<br />
Creates, modifies, and extracts files from archives.<br />
Compares relevant parts of two ELF files for equality.<br />
Verifies that ELF files are compliant with the generic ABI (gABI) and<br />
processor-specific supplement ABI (psABI) specification.<br />
Locates the source of text relocations in files.<br />
Creates an offline archive for debugging.<br />
Lists symbols from object files.<br />
Displays information from object files.<br />
Generates an index to the contents of an archive to make access to this<br />
archive faster.<br />
Displays information about ELF files.<br />
Lists section sizes of object or archive files.<br />
Displays printable character sequences in files.<br />
Discards all symbols from object files.<br />
Combines stripped files with separate symbols and debug information.<br />
5.1. Installing elfutils<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, elfutils is provided by the devtoolset-1.1-elfutils package, and is<br />
automatically installed with devtoolset-1.1 as described in Section 1.5, “Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong>”.<br />
5.2. Using elfutils<br />
To execute any of the tools that are part of elfutils, run the command as follows:<br />
scl enable devtoolset-1.1 'tool [option...] file_name'<br />
Refer to Table 5.1, “Tools Included in elfutils for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>” for a list of tools that are<br />
distributed with elfutils. For example, to use the eu-objdump tool to inspect an object file, type:<br />
scl enable devtoolset-1.1 'eu-objdump [option...] object_file'<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong>
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 4 1<br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> binary tools as default:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of elfutils you are using at any point, type the following at a shell prompt:<br />
which eu-objdump<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s eu-objdump executable path will begin with /opt. Alternatively,<br />
you can use the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> eu-objdump:<br />
eu-objdump -V<br />
5.3. Additional Resources<br />
A detailed description of elfutils is beyond the scope of this book. For more information, refer to the<br />
resources listed below.<br />
See Also<br />
Chapter 1, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides an overview of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and more<br />
information on how to install it on your system.<br />
Chapter 4, binutils explains how to use the binutils, a collection of binary tools to inspect and<br />
manipulate object files and binaries.<br />
Chapter 2, GNU Compiler Collection (GCC) provides information on how to compile programs written<br />
in C, C++, and Fortran.
4 2 Chapter 6. dwz<br />
Chapter 6. dwz<br />
dwz is a command line tool that attempts to optimize DWARF debugging information contained in ELF<br />
shared libraries and ELF executables for size. To do so, dwz replaces DWARF information<br />
representation with equivalent smaller representation where possible, and reduces the amount of<br />
duplication by using techniques from Appendix E of the DWARF Standard.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is distributed with dwz 0.7.<br />
6.1. Installing dwz<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, the dwz utility is provided by the devtoolset-1.1-dwz package, and is<br />
automatically installed with devtoolset-1.1 as described in Section 1.5, “Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong>”.<br />
6.2. Using dwz<br />
To optimize DWARF debugging information in a binary file, run the dwz tool as follows:<br />
scl enable devtoolset-1.1 'dwz [option...] file_name'<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> dwz as default:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of dwz you are using at any point, type the following at a shell prompt:<br />
which dwz<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s dwz executable path will begin with /opt. Alternatively, you can use<br />
the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> dwz:<br />
dwz -v<br />
6.3. Additional Resources<br />
A detailed description of dwz and its features is beyond the scope of this book. For more information,<br />
refer to the resources listed below.<br />
Installed Documentation<br />
dwz(1) — The manual page for the dwz utility provides detailed information on its usage. To display<br />
the manual page for the version included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, type:
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 4 3<br />
scl enable devtoolset-1.1 'man dwz'<br />
See Also<br />
Chapter 1, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides an overview of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and more<br />
information on how to install it on your system.<br />
Chapter 2, GNU Compiler Collection (GCC) provides information on how to compile programs written<br />
in C, C++, and Fortran.<br />
Chapter 4, binutils explains how to use the binutils, a collection of binary tools to inspect and<br />
manipulate object files and binaries.<br />
Chapter 5, elfutils explains how to use elfutils, a collection of binary tools to inspect and manipulate<br />
ELF files.
4 4 Part III. Performance Monitoring Tools<br />
Part III. Performance Monitoring Tools
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 4 5<br />
Chapter 7. SystemTap<br />
SystemTap is a tracing and probing tool that allows users to monitor the activities of the entire system<br />
without needing to instrument, recompile, install, and reboot. It is programmable with a custom scripting<br />
language, which gives it expressiveness (to trace, filter, and analyze) and reach (to look into the running<br />
kernel and applications).<br />
SystemTap can monitor various types of events, such as function calls within the kernel or applications,<br />
timers, tracepoints, performance counters, and so on. Some included example scripts produce output<br />
similar to netstat, ps, top, and iostat, others include pretty-printed function callgraph traces or tools<br />
for working around security bugs.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is distributed with SystemTap 1.8.<br />
Table 7.1. Tools Distributed with SystemTap for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
Name<br />
stap<br />
staprun<br />
stapsh<br />
stap-prep<br />
stap-merge<br />
stap-report<br />
Description<br />
Translates probing instructions into C code, builds a kernel module, and<br />
loads it into a running <strong>Linux</strong> kernel.<br />
Loads, unloads, attaches to, and detaches from kernel modules built with<br />
the stap utility.<br />
Serves as a remote shell for SystemTap.<br />
Determines and—if possible—downloads the kernel information packages<br />
that are required to run SystemTap.<br />
Merges per-CPU files. This script is automatically executed when the stap<br />
utility is executed with the -b command line option.<br />
Gathers important information about the system for the purpose of reporting<br />
a bug in SystemTap.<br />
7.1. Installing SystemTap<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, SystemTap is provided by the devtoolset-1.1-systemtap package, and is<br />
automatically installed with devtoolset-1.1 as described in Section 1.5, “Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong>”.<br />
In order to place instrumentation into the <strong>Linux</strong> kernel, SystemTap may also require installation of<br />
additional packages with debugging information. To determine which packages to install, run the stapprep<br />
utility as follows:<br />
scl enable devtoolset-1.1 'stap-prep'<br />
Note that if you execute this command as the root user, the utility automatically offers the packages for<br />
installation. For more information on how to install these packages on your system, refer to the <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong> SystemTap Beginners <strong>Guide</strong>.<br />
7.2. Using SystemTap<br />
To execute any of the tools that are part of SystemTap, type the following at a shell prompt:<br />
scl enable devtoolset-1.1 'tool [option...]'
4 6 Chapter 7. SystemTap<br />
Refer to Table 7.1, “Tools Distributed with SystemTap for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>” for a list of tools<br />
that are distributed with SystemTap. For example, to run the stap tool to build an instrumentation<br />
module, type:<br />
scl enable devtoolset-1.1 'stap [option...] argument...'<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> SystemTap as default:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of SystemTap you are using at any point, type the following at a shell<br />
prompt:<br />
which stap<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s stap executable path will begin with /opt. Alternatively, you can<br />
use the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> SystemTap:<br />
stap -V<br />
7.3. Additional Resources<br />
A detailed description of SystemTap and its features is beyond the scope of this book. For more<br />
information, refer to the resources listed below.<br />
Installed Documentation<br />
stap(1) — The manual page for the stap command provides detailed information on its usage, as<br />
well as references to other related manual pages. To display the manual page for the version<br />
included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, type:<br />
scl enable devtoolset-1.1 'man stap'<br />
staprun(8) — The manual page for the staprun command provides detailed information on its<br />
usage. To display the manual page for the version included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, type:<br />
scl enable devtoolset-1.1 'man staprun'<br />
SystemTap Tapset Reference Manual — HTML documentation on the most common tapset<br />
definitions is located at /opt/rh/devtoolset-1.1/root/usr/share/doc/devtoolset-1.1-<br />
systemtap-client-1.8/index.html.<br />
Online Documentation<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 SystemTap Beginners <strong>Guide</strong> — The SystemTap Beginners <strong>Guide</strong> for<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 provides an introduction to SystemTap and its usage.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 SystemTap Beginners <strong>Guide</strong> — The SystemTap Beginners <strong>Guide</strong> for
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 provides an introduction to SystemTap and its usage.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 SystemTap Tapset Reference — The SystemTap Tapset Reference for<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 provides further details about SystemTap.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 SystemTap Tapset Reference — The SystemTap Tapset Reference for<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 provides further details about SystemTap.<br />
The SystemTap Documentation — The official SystemTap documentation provides further<br />
documentation on SystemTap, as well as numerous examples of SystemTap scripts.<br />
See Also<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 4 7<br />
Chapter 1, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides an overview of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and more<br />
information on how to install it on your system.<br />
Chapter 8, Valgrind explains how to use Valgrind to profile applications and detect memory errors<br />
and memory management problems, such as the use of uninitialized memory, improper allocation and<br />
freeing of memory, and the use of improper arguments in system calls.<br />
Chapter 9, OProfile explains how to use OProfile to determine which sections of code consume the<br />
greatest amount of CPU time and why.
4 8 Chapter 8. Valgrind<br />
Chapter 8. Valgrind<br />
Valgrind is an instrumentation framework that ships with a number of tools to profile applications. It can<br />
be used to detect various memory errors and memory management problems, such as the use of<br />
uninitialized memory or improper allocation and freeing of memory, or to identify the use of improper<br />
arguments in system calls. For a complete list of profiling tools that are distributed with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> version of Valgrind, refer to Table 8.1, “Tools Distributed with Valgrind for <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong>”.<br />
Valgrind profiles an application by rewriting it and instrumenting the rewritten binary. This allows you to<br />
profile your application without the need to recompile it, but it also makes Valgrind significantly slower<br />
than other profilers, especially when performing extremely detailed runs. It is therefore not suited to<br />
debugging time-specific issues, or kernel-space debugging.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is distributed with Valgrind 3.8.1. This version is more recent than the<br />
version included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> and provides numerous bug fixes and enhancements.<br />
Table 8.1. Tools Distributed with Valgrind for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
Name<br />
Memcheck<br />
Cachegrind<br />
Callgrind<br />
Helgrind<br />
DRD<br />
Massif<br />
Description<br />
Detects memory management problems by intercepting system calls and<br />
checking all read and write operations.<br />
Identifies the sources of cache misses by simulating the level 1 instruction<br />
cache (I1), level 1 data cache (D1), and unified level 2 cache (L2).<br />
Generates a call graph representing the function call history.<br />
Detects synchronization errors in multithreaded C, C++, and Fortran<br />
programs that use POSIX threading primitives.<br />
Detects errors in multithreaded C and C++ programs that use POSIX<br />
threading primitives or any other threading concepts that are built on top of<br />
these POSIX threading primitives.<br />
Monitors heap and stack usage.<br />
8.1. Installing Valgrind<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, Valgrind is provided by the devtoolset-1.1-valgrind package, and is<br />
automatically installed with devtoolset-1.1. If you intend to use Valgrind to profile parallel programs that<br />
use the Message Passing Interface (MPI) protocol, install the devtoolset-1.1-valgrind-openmpi package.<br />
For detailed information about how to install <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and related packages to your<br />
system, refer to Section 1.5, “Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”.<br />
8.2. Using Valgrind<br />
To run any of the Valgrind tools on a program you want to profile, type the following at a shell prompt:<br />
scl enable devtoolset-1.1 'valgrind [--tool=tool] program [option...]'<br />
Refer to Table 8.1, “Tools Distributed with Valgrind for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>” for a list of tools that<br />
are distributed with Valgrind. The argument of the --tool command line option must be specified in<br />
lower case, and if this option is omitted, Valgrind uses Memcheck by default. For example, to run<br />
Cachegrind on a program to identify the sources of cache misses, type:
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 4 9<br />
scl enable devtoolset-1.1 'valgrind --tool=cachegrind program [option...]'<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> Valgrind as default:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of Valgrind you are using at any point, type the following at a shell prompt:<br />
which valgrind<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s valgrind executable path will begin with /opt. Alternatively, you<br />
can use the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> Valgrind:<br />
valgrind --version<br />
8.3. Additional Resources<br />
A detailed description of Valgrind and its features is beyond the scope of this book. For more<br />
information, refer to the resources listed below.<br />
Installed Documentation<br />
valgrind(1) — The manual page for the valgrind utility provides detailed information on how to<br />
use Valgrind. To display the manual page for the version included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>,<br />
type:<br />
scl enable devtoolset-1.1 'man valgrind'<br />
Valgrind Documentation — HTML documentation for Valgrind is located at /opt/rh/devtoolset-<br />
1.1/root/usr/share/doc/devtoolset-1.1-valgrind-3.8.1/html/index.html.<br />
Online Documentation<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 <strong>Developer</strong> <strong>Guide</strong> — The <strong>Developer</strong> <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6<br />
provides more information about Valgrind and its Eclipse plug-in.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 Performance Tuning <strong>Guide</strong> — The Performance Tuning <strong>Guide</strong> for <strong>Red</strong><br />
<strong>Hat</strong> Enterprise <strong>Linux</strong> 6 provides more detailed information about using Valgrind to profile applications.<br />
See Also<br />
Chapter 1, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides an overview of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and more<br />
information on how to install it on your system.<br />
Chapter 7, SystemTap provides an introduction to SystemTap and explains how to use it to monitor<br />
the activities of a running system.<br />
Chapter 9, OProfile explains how to use OProfile to determine which sections of code consume the<br />
greatest amount of CPU time and why.
50 Chapter 8. Valgrind
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 51<br />
Chapter 9. OProfile<br />
OProfile is a low overhead, system-wide profiler that uses the performance monitoring hardware on the<br />
processor to retrieve information about the kernel and executables on the system, such as when<br />
memory is referenced, the number of level 2 cache (L2) requests, and the number of hardware interrupts<br />
received. It consists of a configuration utility, a daemon for collecting data, and a number of tools that can<br />
be used to transform the data into a human-readable form. For a complete list of tools that are<br />
distributed with the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> version of OProfile, refer to Table 9.1, “Tools Distributed<br />
with OProfile for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>”.<br />
OProfile profiles an application without adding any instrumentation by recording the details of every nth<br />
event. This allows it to consume fewer resources than Valgrind, but also causes its samples to be less<br />
precise. Unlike Valgrind, which only collects data for a single process and its children in user-space,<br />
OProfile is well suited to collect system-wide data on both user-space and kernel-space processes, and<br />
requires root privileges to run.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is distributed with OProfile 0.9.7. This version is more recent than the<br />
version included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> and provides numerous bug fixes and enhancements.<br />
Table 9.1. Tools Distributed with OProfile for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
Name<br />
oprofiled<br />
opcontrol<br />
opannotate<br />
oparchive<br />
opgprof<br />
ophelp<br />
opimport<br />
opjitconv<br />
opreport<br />
Description<br />
The OProfile daemon that collects profiling data.<br />
Starts, stops, and configures the OProfile daemon.<br />
Generates an annotated source file or assembly listing form the profiling<br />
data.<br />
Generates a directory containing executable, debug, and sample files.<br />
Generates a summary of a profiling session in a format compatible with<br />
gprof.<br />
Displays a list of available events.<br />
Converts a sample database file from a foreign binary format to the native<br />
format.<br />
Converts a just-in-time (JIT) dump file to the Executable and Linkable<br />
Format (ELF).<br />
Generates image and symbol summaries of a profiling session.<br />
9.1. Installing OProfile<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, OProfile is provided by the devtoolset-1.1-oprofile package, and is<br />
automatically installed with devtoolset-1.1 as described in Section 1.5, “Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong>”.<br />
9.2. Using OProfile<br />
To run any of the tools that are distributed with OProfile, type the following at a shell prompt as root:<br />
scl enable devtoolset-1.1 'tool [option...]'<br />
Refer to Table 9.1, “Tools Distributed with OProfile for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>” for a list of tools that<br />
are distributed with Valgrind. For example, to use the ophelp command to list available events in the<br />
XML format, type:
52 Chapter 9. OProfile<br />
scl enable devtoolset-1.1 'ophelp -X'<br />
Note that you can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalent. This<br />
allows you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> OProfile as default:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of OProfile you are using at any point, type the following at a shell prompt:<br />
which opcontrol<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s opcontrol executable path will begin with /opt. Alternatively, you<br />
can use the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> OProfile:<br />
opcontrol --version<br />
9.3. Additional Resources<br />
A detailed description of OProfile and its features is beyond the scope of this book. For more information,<br />
refer to the resources listed below.<br />
Installed Documentation<br />
oprofile(1) — The manual page named oprofile provides an overview of OProfile and available<br />
tools. To display the manual page for the version included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, type:<br />
scl enable devtoolset-1.1 'man oprofile'<br />
opannotate(1), oparchive(1), opcontrol(1), opgprof(1), ophelp(1), opimport(1), opreport(1) —<br />
Manual pages for various tools distributed with OProfile provide more information on their respective<br />
usage. To display the manual page for the version included in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, type:<br />
scl enable devtoolset-1.1 'man tool'<br />
Online Documentation<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 <strong>Developer</strong> <strong>Guide</strong> — The <strong>Developer</strong> <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6<br />
provides more information on OProfile.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 Deployment <strong>Guide</strong> — The Deployment <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6 describes in detail how to install, configure, and start using OProfile on this system.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 Deployment <strong>Guide</strong> — The Deployment <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 5 describes in detail how to install, configure, and start using OProfile on this system.<br />
See Also<br />
Chapter 1, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides an overview of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and more<br />
information on how to install it on your system.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 53<br />
Chapter 7, SystemTap provides an introduction to SystemTap and explains how to use it to monitor<br />
the activities of a running system.<br />
Chapter 8, Valgrind explains how to use Valgrind to profile applications and detect memory errors<br />
and memory management problems, such as the use of uninitialized memory, improper allocation and<br />
freeing of memory, and the use of improper arguments in system calls.
54 Part IV. Integrated Development Environments<br />
Part IV. Integrated Development Environments
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 55<br />
Chapter 10. Eclipse<br />
Eclipse is a powerful development environment that provides tools for each phase of the development<br />
process. It integrates a variety of disparate tools into a unified environment to create a rich development<br />
experience, provides a fully configurable user interface, and features a pluggable architecture that allows<br />
for extension in a variety of ways. For instance, the Valgrind plug-in allows programmers to perform<br />
memory profiling, otherwise performed on the command line, through the Eclipse user interface.<br />
Eclipse provides a graphical development environment alternative to traditional interaction with command<br />
line tools and as such, it is a welcome alternative to developers who do not want to use the command<br />
line interface. The traditional, mostly command line based <strong>Linux</strong> tools suite (such as gcc or gdb) and<br />
Eclipse offer two distinct approaches to programming.<br />
Figure 10.1. Sample Eclipse Session<br />
10.1. Installing Eclipse<br />
In <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6, the Eclipse development environment is distributed as a set of several<br />
smaller packages such as eclipse-cdt, which provides C/C++ support, eclipse-jdt, which provides<br />
support for Java, or eclipse-valgrind, which integrates various Valgrind tools into Eclipse. In addition, a<br />
package group named Eclipse is available to make it easier to install all packages that form the<br />
Eclipse integrated development environment at the same time.<br />
To install the Eclipse package group and all its dependencies on your system, type the following at a<br />
shell prompt as root:<br />
yum groupinstall Eclipse
56 Chapter 10. Eclipse<br />
This installs eclipse-cdt, eclipse-jdt, eclipse-valgrind, and other packages to the system from the <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong> 6 x86/x86_64 Supplementary channel. To install all Eclipse packages, run as root:<br />
yum install eclipse-\*<br />
Note<br />
Eclipse is part of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> rather than <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>. It is only<br />
available for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 on 32-bit and 64-bit Intel and AMD architectures, and<br />
supports only C and C++ development. The <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 version does not provide<br />
support for the Fortran programming language.<br />
10.2. Running Eclipse<br />
To start Eclipse with support for the GNU Compiler Collection and GNU Debugger from <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong>, type the following at a shell prompt:<br />
scl enable devtoolset-1.1 'eclipse'<br />
This invokes the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> Eclipse IDE using the <strong>Developer</strong> <strong>Toolset</strong> gcc compiler and<br />
gdb debugger instead of the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalents.<br />
Important<br />
If you are working on a project that you previously built with the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> version<br />
of the GNU Compiler Collection, make sure that you discard all previous build results. To do so,<br />
open the project in Eclipse and select Project → Clean from the menu.<br />
You can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalents. This allows<br />
you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> gcc and gdb as the default compiler and<br />
debugger for Eclipse:<br />
scl enable devtoolset-1.1 'bash'<br />
Note<br />
To verify the version of gcc you are using at any point, type the following at a shell prompt:<br />
which gcc<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s gcc executable path will begin with /opt. Alternatively, you can use<br />
the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> gcc:<br />
gcc -v<br />
During its startup, Eclipse prompts you to select a workspace, that is, a directory in which you want to
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 57<br />
store your projects. Either use ~/workspace/, which is the default option, or click the Browse button to<br />
browse your file system and select a custom directory. You can also select the Use this as the<br />
default and do not ask again check box to prevent Eclipse from prompting you the next time<br />
you run it. When you are done, click the OK button to confirm the selection and proceed with the startup.<br />
10.3. Additional Resources<br />
A detailed description of Eclipse and all its features is beyond the scope of this book. For more<br />
information, refer to the resources listed below.<br />
Installed Documentation<br />
Eclipse includes a built-in Help system which provides extensive documentation for each integrated<br />
feature and tool. This greatly decreases the initial time investment required for new developers to<br />
become fluent in its use. The use of this Help section is detailed in the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
<strong>Developer</strong> <strong>Guide</strong> linked below.<br />
Online Documentation<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 <strong>Developer</strong> <strong>Guide</strong> — The <strong>Developer</strong> <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6<br />
provides more information on Eclipse, including a description of the user interface, overview of<br />
available development toolkits, or instructions on how to use it to build RPM packages.<br />
See Also<br />
Chapter 1, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> provides an overview of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> and more<br />
information on how to install it on your system.<br />
Chapter 2, GNU Compiler Collection (GCC) provides information on how to compile programs written<br />
in C, C++, and Fortran on the command line.
58 Part V. Getting Help<br />
Part V. Getting Help
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 59<br />
Chapter 11. Accessing <strong>Red</strong> <strong>Hat</strong> Product Documentation<br />
<strong>Red</strong> <strong>Hat</strong> Product Documentation located at https://access.redhat.com/knowledge/docs/ serves as a<br />
central source of information. It is currently translated in 22 languages and for each product, it provides<br />
different kinds of books from release and technical notes to installation, user, and reference guides in<br />
HTML, PDF, and EPUB formats.<br />
Below is a brief list of documents that are directly or indirectly relevant to this book.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 Release Notes — The Release Notes for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
1.1 provide more information about this product.<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 Software Collections <strong>Guide</strong> — The Software Collections <strong>Guide</strong> for<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 explains the concept of Software Collections and documents the scl<br />
tool.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 <strong>Developer</strong> <strong>Guide</strong> — The <strong>Developer</strong> <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6<br />
provides detailed information about libraries and runtime support, compiling and building, debugging,<br />
and profiling.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 Installation <strong>Guide</strong> — The Installation <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
6 explains how to obtain, install, and update the system.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 Installation <strong>Guide</strong> — The Installation <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
5 explains how to obtain, install, and update the system.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 Deployment <strong>Guide</strong> — The Deployment <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6 documents relevant information regarding the deployment, configuration, and administration<br />
of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 Deployment <strong>Guide</strong> — The Deployment <strong>Guide</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 5 documents relevant information regarding the deployment, configuration, and administration<br />
of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.
60 Chapter 12. Accessing the Customer Portal<br />
Chapter 12. Accessing the Customer Portal<br />
The Customer Portal is available to all <strong>Red</strong> <strong>Hat</strong> subscribers and can be accessed at<br />
https://access.redhat.com/home. This web page serves as a pointer to a vast number of resources but<br />
of most interest to developers are the Plan, Deploy, and Connect menus. These include links to all the<br />
resources needed during each stage of the development.<br />
12.1. The Plan Menu<br />
Figure 12.1. The Plan Menu<br />
In the Plan menu are resources needed to plan a development project. These menu items provide<br />
proven resources to implement the best solution the first time. This includes:<br />
Webinars<br />
The Webinars page contains information on upcoming <strong>Red</strong> <strong>Hat</strong> and open source events around<br />
the world. Here you can register for upcoming webinars or watch archived ones on demand.<br />
Success Stories<br />
Read the success stories of other <strong>Red</strong> <strong>Hat</strong> customers to learn how leading organizations are<br />
finding unbeatable value, performance, security and reliability with <strong>Red</strong> <strong>Hat</strong> solutions.<br />
Product Documentation<br />
This provides a list of links to the various <strong>Red</strong> <strong>Hat</strong> documents, including books for <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong>, Identity Management and Infrastructure, <strong>Red</strong> <strong>Hat</strong> Enterprise Storage, JBoss<br />
Enterprise Middleware, and System Management.<br />
Reference Architectures<br />
Reference Architectures contains a list of whitepapers that detail technical case studies of<br />
solutions that have been built, tested, and bench-marked by senior <strong>Red</strong> <strong>Hat</strong> engineers. They<br />
explain the capabilities and limitations of a given solution, as well as detailed notes on how to<br />
implement the solution.<br />
Evaluations & Demos<br />
You can download free evaluations of various <strong>Red</strong> <strong>Hat</strong> products from here, including <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong>, <strong>Red</strong> <strong>Hat</strong> Enterprise Virtualization, <strong>Red</strong> <strong>Hat</strong> Storage Appliance, and JBoss<br />
Enterprise Middleware evaluations.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 61<br />
Certified Hardware<br />
This section has information on what systems, components, and peripherals <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong> 6, 5, and 4 support.<br />
12.2. The Deploy Menu<br />
Figure 12.2. The Deploy Menu<br />
In the Deploy menu are resources needed to deploy a development project. This includes:<br />
Getting Started<br />
The Getting Started page has links to information to help get up and running with <strong>Red</strong> <strong>Hat</strong><br />
subscriptions, including product registration information, accessing your resources, and<br />
engaging in global support. It also has links to a <strong>Red</strong> <strong>Hat</strong> Welcome Kit and a Quick <strong>Guide</strong> to<br />
<strong>Red</strong> <strong>Hat</strong> Support.<br />
Downloads<br />
Here is where you can download all that <strong>Red</strong> <strong>Hat</strong> offers with descriptions of what each entails.<br />
Activate a New Subscription<br />
After purchasing a <strong>Red</strong> <strong>Hat</strong> subscription this is where you go to activate it. Note that the<br />
Activate a New Subscription section requires you to enter your <strong>Red</strong> <strong>Hat</strong> login and<br />
password.<br />
Support Essentials<br />
Here you can find a list of articles and group discussions, viewable by new posts, most popular,<br />
and recent comments, as well as the most recent <strong>Red</strong> <strong>Hat</strong> errata.<br />
Security<br />
<strong>Red</strong> <strong>Hat</strong> releases errata to address bugs, provide enhancements, or to fix security<br />
vulnerabilities. With each erratum an advisory is supplied to give the details of the issues being<br />
fixed, as well as how to obtain and install the required software packages. This section has<br />
information about the errata, including:<br />
Checking the security update policy and lifetime for all <strong>Red</strong> <strong>Hat</strong> products
62 Chapter 12. Accessing the Customer Portal<br />
Getting the latest security updates for <strong>Red</strong> <strong>Hat</strong> products<br />
Getting notified of new security updates<br />
Finding out if a specific CVE affects a <strong>Red</strong> <strong>Hat</strong> product<br />
Reporting a security vulnerability<br />
How we measure security vulnerabilities<br />
Security Response Team mission and standards of service<br />
Support<br />
This is where all the information regarding <strong>Red</strong> <strong>Hat</strong> support can be found, including links for:<br />
Support Cases<br />
Support Programs<br />
Product Life Cycles<br />
Supported Environments<br />
Help & Assistance<br />
Site Help<br />
12.3. The Connect Menu<br />
Figure 12.3. The Connect Menu<br />
The Connect menu allows you to connect to the industry's best engineers and collaborate with industry<br />
peers. This includes:<br />
Knowledgebase<br />
The Knowledgebase contains a large number of whitepapers on a variety of topics which can<br />
serve as another source of documentation for your project. Note that the Knowledgebase<br />
section requires you to enter your <strong>Red</strong> <strong>Hat</strong> login and password.<br />
Groups<br />
This section allows users to join a group to collaborate on the documents. They can also<br />
create and comment on discussions to interact with other customers, <strong>Red</strong> <strong>Hat</strong> support staff,<br />
and certified engineers. Note that the Groups section requires you to enter your <strong>Red</strong> <strong>Hat</strong> login<br />
and password.<br />
Videos
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 63<br />
A number of videos on how to get vital solutions, useful tips, product demonstrations, and inside<br />
information can be accessed from here. You can also rate and comment on all of the videos.<br />
Tech Briefs<br />
Tech briefs provide practical advice to help solve real-world problems with <strong>Red</strong> <strong>Hat</strong> products.<br />
Each tech brief provides a detailed use case covering best practices, how-to instructions, or<br />
detailed discussions on how to use <strong>Red</strong> <strong>Hat</strong> technology effectively, and are reviewed and<br />
tested by <strong>Red</strong> <strong>Hat</strong> engineers.<br />
Source<br />
This is the kernel source browser and contains links to all the kernel sources broken into each<br />
individual patch, unlike the kernel srpm which is shipped as one big patch. Note that the<br />
Source section requires you to enter your <strong>Red</strong> <strong>Hat</strong> login and password.<br />
Support Cases<br />
This is where users can view all their support cases, make changes or view any updates. Note<br />
that the Support Cases section requires you to enter your <strong>Red</strong> <strong>Hat</strong> login and password.
64 Chapter 13. Contacting Global Support Services<br />
Chapter 13. Contacting Global Support Services<br />
Unless you have a Self-Support subscription, when both the <strong>Red</strong> <strong>Hat</strong> Documentation website and<br />
Customer Portal fail to provide the answers to your questions, you can contact Global Support<br />
Services (GSS).<br />
13.1. Gathering Required Information<br />
Several items of information should be gathered before contacting GSS.<br />
Background Information<br />
Ensure you have the following background information at hand before calling GSS:<br />
Hardware type, make, and model on which the product runs<br />
Software version<br />
Latest upgrades<br />
Any recent changes to the system<br />
An explanation of the problem and the symptoms<br />
Any messages or significant information about the issue<br />
Note<br />
If you ever forget your <strong>Red</strong> <strong>Hat</strong> login information, it can be recovered at<br />
https://access.redhat.com/site/help/LoginAssistance.html.<br />
Diagnostics<br />
The diagnostics report for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> is required as well. This report is also known as a<br />
sosreport and the program to create the report is provided by the sos package. To install the sos<br />
package and all its dependencies on your system, type the following at a shell prompt as root:<br />
yum install sos<br />
To generate the report, run as root:<br />
sosreport<br />
For more information, access the Knowledgebase article at https://access.redhat.com/kb/docs/DOC-<br />
3593.<br />
Account and Contact Information<br />
In order to help you, GSS requires your account information to customize their support, as well contact<br />
information to get back to you. When you contact GSS ensure you have your:<br />
<strong>Red</strong> <strong>Hat</strong> customer number or <strong>Red</strong> <strong>Hat</strong> Network (RHN) login name<br />
Company name<br />
Contact name<br />
Preferred method of contact (phone or email) and contact information (phone number or email<br />
address)
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 65<br />
Issue Severity<br />
Determining an issue's severity is important to allow the GSS team to prioritize their work. There are four<br />
levels of severity.<br />
Severity 1 (urgent)<br />
A problem that severely impacts your use of the software for production purposes. It halts your<br />
business operations and has no procedural work around.<br />
Severity 2 (high)<br />
A problem where the software is functioning but production is severely reduced. It causes a<br />
high impact to business operations and no work around exists.<br />
Severity 3 (medium)<br />
A problem that involves partial, non-critical loss of the use of the software. There is a medium to<br />
low impact on your business and business continues to function by utilizing a work around.<br />
Severity 4 (low)<br />
A general usage question, report of a documentation error, or a recommendation for a future<br />
product improvement.<br />
For more information on determining the severity level of an issue, refer to<br />
https://access.redhat.com/support/policy/severity.<br />
Once the issue severity has been determined, submit a service request through the Customer Portal<br />
under the Connect option, or at https://access.redhat.com/support/contact/technicalSupport.html. Note<br />
that you need your <strong>Red</strong> <strong>Hat</strong> login details in order to submit service requests.<br />
If the severity is level 1 or 2, then follow up your service request with a phone call. Contact information<br />
and business hours are found at https://access.redhat.com/support/contact/technicalSupport.html.<br />
If you have a premium subscription, then after hours support is available for Severity 1 and 2 cases.<br />
Turn-around rates for both premium subscriptions and standard subscription can be found at<br />
https://access.redhat.com/support/offerings/production/sla.html.<br />
13.2. Escalating an Issue<br />
If you feel as though an issue is not being handled correctly or adequately, you can escalate it. There<br />
are two types of escalation:<br />
Technical escalation<br />
If an issue is not being resolved appropriately or if you need a more senior resource to attend<br />
to it.<br />
Management escalation<br />
If the issue has become more severe or you believe it requires a higher priority.
66 Chapter 13. Contacting Global Support Services<br />
More information on escalation, including contacts, is available at<br />
https://access.redhat.com/support/policy/mgt_escalation.html.<br />
13.3. Re-opening a Service Request<br />
If more relevant information regarding a closed service request (such as the problem reoccurring), you<br />
can re-open it via the <strong>Red</strong> <strong>Hat</strong> Customer Portal at<br />
https://access.redhat.com/support/policy/mgt_escalation.html or by calling your local support center, the<br />
details of which can be found at https://access.redhat.com/support/contact/technicalSupport.html.<br />
Important<br />
In order to re-open a service request, you need the original service request number.<br />
13.4. Additional Resources<br />
For more information, refer to the resources listed below.<br />
Online Documentation<br />
Getting Started — The Getting Started page serves as a starting point for people who purchased a<br />
<strong>Red</strong> <strong>Hat</strong> subscription, and offers the <strong>Red</strong> <strong>Hat</strong> Welcome Kit and Quick <strong>Guide</strong> to <strong>Red</strong> <strong>Hat</strong> Support for<br />
download.<br />
How can a RHEL Self-Support subscription be used? — A Knowledgebase article for customers with<br />
a Self-Support subscription.<br />
<strong>Red</strong> <strong>Hat</strong> Global Support Services and public mailing lists — A Knowledgebase article that answers<br />
frequent questions about public <strong>Red</strong> <strong>Hat</strong> mailing lists.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 67<br />
Changes in Version 1.0<br />
This appendix documents new features and compatibility changes introduced in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> 1.0.<br />
A.1. Changes in GCC 4.7.0<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 is distributed with GCC 4 .7.0, which provides a number of bug fixes and<br />
feature enhancements over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version. Below is a comprehensive list<br />
of new features and compatibility changes in this release. For details on how to use these new features,<br />
refer to the GCC documentation.<br />
A.1.1. Status and Features<br />
A.1.1.1. C++11<br />
GCC 4.7 provides experimental support for building applications compliant with C++11 using the -<br />
std=c++11 or -std=gnu++11 command line options. However, there is no guarantee for compatibility<br />
between C++11 code compiled by different versions of the compiler. Refer to Section A.1.3.1, “C++ ABI”<br />
for details.<br />
The C++ runtime library, libstdc++, supports a majority of the C++11 features. However, there is no<br />
or only partial support for some features such as certain properties on type traits or regular<br />
expressions. For details, refer to the libstdc++ documentation, which also lists implementationdefined<br />
behavior.<br />
Support for C++11 exception_ptr and future requires changes to the exception handling runtime in<br />
the system libstdc++ package. These changes will be distributed through the normal Z-stream channel.<br />
Refer to the Guidance on Experimental Features in gcc version 4.7.0 section in the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> 1.0 Release Notes for more information.<br />
A.1.1.2. C11<br />
GCC 4.7 provides experimental support for some of the features from the C11 revision of the ISO C<br />
standard, and in addition to the previous (now deprecated) -std=c1x and -std=gnu1x command line<br />
options, gcc now accepts -std=c11 and -std=gnu11. Note that since this support is experimental, it<br />
may change incompatibly in future releases.<br />
Examples for features that are supported are Unicode strings (including the predefined macros<br />
__STDC_UTF_16__ and __STDC_UTF_32__), nonreturning functions (_Noreturn and<br />
), and alignment support (_Alignas, _Alignof, max_align_t, and ).<br />
A.1.1.3. Parallelism and Concurrency<br />
GCC 4 .7 provides improved support for programming parallel applications:<br />
1. The GCC compilers support the OpenMP API specification for parallel programming, version 3.1.<br />
Refer to the OpenMP website for more information on this specification.<br />
2. The C++11 and C11 standards provide programming abstractions for multi-threaded programs.<br />
The respective standard libraries include programming abstractions for threads and threadrelated<br />
features such as locks, condition variables, or futures. These new versions of the<br />
standard also define a memory model that precisely specifies the runtime behavior of a multithreaded<br />
program, such as the guarantees provided by compilers and the constraints<br />
programmers have to pay attention to when writing multi-threaded programs.<br />
Note that support for the memory model is still experimental (see below for details). For more
68 Changes in Version 1.0<br />
information about the status of support for C++11 and C11, refer to Section A.1.1.1, “C++11” and<br />
Section A.1.1.2, “C11” respectively.<br />
The rest of this section describes two new GCC features in more detail. Both these features make it<br />
easier for programmers to handle concurrency (such as when multiple threads do not run truly in parallel<br />
but instead have to synchronize concurrent access to shared state), and both provide atomicity for<br />
access to memory but differ in their scope, applicability, and complexity of runtime support.<br />
C++11 Types and GCC Built-ins for Atomic Memory Access<br />
C++11 has support for atomic types. Access to memory locations of this type is atomic, and appears as<br />
one indivisible access even when other threads access the same memory location concurrently. The<br />
atomicity is limited to a single read or write access or one of the other atomic operations supported by<br />
such types (for example, two subsequent operations executed on a variable of atomic type are each<br />
atomic separately, but do not form one joint atomic operation).<br />
An atomic type is declared as atomic, where T is the non-atomic base type and must be trivially<br />
copyable (for example, atomic is an atomic integer). GCC does not yet support any base type T,<br />
but only those that can be accessed atomically with the atomic instructions offered by the target<br />
architecture. This is not a significant limitation in practice, given that atomics are primarily designed to<br />
expose hardware primitives in an architecture-independent fashion; pointers and integrals that are not<br />
larger than a machine word on the target are supported as base types. Using base types that are not<br />
yet supported results in link-time errors.<br />
The code generated for operations on atomic types, including the memory orders, implements the<br />
semantics specified in the C++11 standard. However, support for the C++11 memory model is still<br />
experimental, and for example GCC might not always preserve data-race freedom when optimizing code.<br />
GCC also supports new built-ins for atomic memory accesses, which follow the design of the memory<br />
model and new atomic operations. The former set of synchronization built-ins (that is, those prefixed<br />
with __sync) are still supported.<br />
Transactional Memory<br />
Transactional Memory (TM) allows programs to declare that a piece of code is supposed to execute as<br />
a transaction, that is, virtually atomically and in isolation from other transactions. GCC's transactional<br />
memory runtime library, libitm, then ensures this atomicity guarantee when executing the compiled<br />
program. Compared to atomic memory accesses, it is a higher-level programming abstraction, because it<br />
is not limited to single memory locations, does not require special data types for the data it modifies, and<br />
because transactions can contain arbitrary code and be nested within other transactions (with some<br />
restrictions explained subsequently).<br />
GCC implements transactions as specified in the Draft Specification for Transactional Language<br />
Constructs for C++, version 1.1. This draft does not yet specify the language constructs for C, but GCC<br />
already supports a C-compatible subset of the constructs when compiling C source code.<br />
The main language constructs are transaction statements and expressions, and are declared by the<br />
__transaction_atomic or __transaction_relaxed keywords followed by a compound<br />
statement or expression, respectively. The following example illustrates how to increment a global<br />
variable y if another variable x has a value less than 10:<br />
__transaction_atomic { if (x < 10) y++; }<br />
This happens atomically even in a multi-threaded execution of the program. In particular, even though<br />
the transaction can load x and y and store to y, all these memory accesses are virtually executed as<br />
one indivisible step.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 69<br />
Note that in line with the C++11 memory model, programs that use transactions must be free of data<br />
races. Transactions are guaranteed to be virtually executed serially in a global total order that is<br />
determined by the transactional memory implementation and that is consistent with and contributes to<br />
the happens-before order enforced by the rest of the program (that is, transaction semantics are<br />
specified based on the C++11 memory model, see the draft specification linked above). Nonetheless, if a<br />
program is not data-race-free, then it has undefined behavior. For example, a thread can first initialize<br />
some data and then make it publicly accessible by code like this:<br />
init(data);<br />
__transaction_atomic { data_public = true;} // data_public is initially false<br />
Another thread can then safely use the data, for instance:<br />
__transaction_atomic { if (data_public) use(data); }<br />
However, the following code has a data race and thus results in undefined behavior:<br />
__transaction_atomic { temp = copy(data); if (data_public) use(temp); }<br />
Here, copy(data) races with init(data) in the initializing thread, because this can be executed<br />
even if data_public is not true. Another example for data races is one thread accessing a variable x<br />
transactionally and another thread accessing it nontransactionally at potentially the same time. Note that<br />
the data can be safely reclaimed using code like this (assuming only one thread ever does this):<br />
__transaction_atomic { data_public = false; }<br />
destruct(data);<br />
Here, destruct() does not race with potential concurrent uses of the data because after the<br />
transaction finishes, it is guaranteed that data_public is false and thus data is private. See the<br />
specification and the C++11 memory model for more background information about this.<br />
Note that even if transactions are required to virtually execute in a total order, this does not mean that<br />
they execute mutually exclusive in time. Transactional memory implementations attempt to run<br />
transactions as much in parallel as possible to provide scalable performance.<br />
There are two variants of transactions: atomic transactions (__transaction_atomic) and relaxed<br />
transactions (__transaction_relaxed). The former guarantee atomicity with regard to all other code,<br />
but allow only code that is known to not include nontransactional kinds of synchronization, such as<br />
atomic or volatile memory access. In contrast, relaxed transactions allow all code (for example calls to I/O<br />
functions), but only provide atomicity with regard to other transactions. Therefore, atomic transactions<br />
can be nested within other atomic and relaxed transactions, but relaxed transactions can only be nested<br />
within other relaxed transactions. Furthermore, relaxed transactions are likely to be executed with less<br />
performance, but this depends on the implementation and available hardware.<br />
GCC verifies these restrictions statically at compile time (for example, the requirements on code allowed<br />
to be called from within atomic transactions). This has implications for when transactions call functions<br />
that are defined within other compilation unit (source file) or within libraries. To enable such crosscompilation-unit<br />
calls for transactional code, the respective functions must be marked to contain code<br />
that is safe to use from within atomic transactions. Programmers can do so by adding the<br />
transaction_safe function attribute to the declarations of these functions and by including this<br />
declaration when defining the function. In turn, GCC then verifies that the code in these functions is safe<br />
for atomic transactions and generates code accordingly. If the programmer does not follow these<br />
constraints and/or steps, compile-time or link-time errors occur. Note that within a compilation unit, GCC<br />
detects automatically whether a function is safe for use within transactions, and the attributes therefore<br />
typically do not need to be added. See the draft specification linked above for further details.
70 Changes in Version 1.0<br />
GCC's transactional memory support is designed in such a way that it does not decrease the<br />
performance of programs that do not use transactions, nor the performance of nontransactional code,<br />
except due to the normal kinds of interference by concurrent threads that use the same resources such<br />
as the CPU.<br />
Transactional Memory support in GCC and libitm is still experimental, and both the ABI and API could<br />
change in the future if this is required due to the evolution of the specification of the language<br />
constructs, or due to implementation requirements. Note that when executing applications built with the -<br />
gnu-tm command line option, it is currently a prerequisite to also have the appropriate version of the<br />
libitm.so.1 shared library installed. Refer to the Guidance on Experimental Features in gcc version<br />
4.7.0 section in the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 Release Notes for more information.<br />
A.1.1.4 . Architecture-specific Options<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 is only available for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 and 6, both for the 32-bit<br />
and 64-bit Intel and AMD architectures. Consequently, the options described below are only relevant to<br />
these architectures.<br />
Optimization for several processors is now available through the command line options described in<br />
Table A.1, “Processor Optimization Options”.<br />
Table A.1. Processor Optimization Options<br />
Option<br />
-march=core2 and -mtune=core2<br />
-march=corei7 and -mtune=corei7<br />
-march=corei7-avx and -mtune=corei7-<br />
avx<br />
-march=core-avx-i<br />
-march=core-avx2<br />
-march=bdver2 and -mtune=bdver2<br />
-march=btver1 and -mtune=btver1<br />
-march=bdver1 and -mtune=bdver1<br />
Description<br />
Optimization for Intel Core 2 processors.<br />
Optimization for Intel Core i3, i5, and i7<br />
processors.<br />
Optimization for Intel Core i3, i5, and i7<br />
processors with AVX.<br />
Optimization for the Intel processor code-named<br />
Ivy Bridge with RDRND, FSGSBASE, and F16C.<br />
Optimization for a next-generation processor from<br />
Intel with AVX2, FMA, BMI, BMI2, and LZCNT.<br />
Optimization for AMD family 15h processors<br />
code-named Piledriver.<br />
Optimization for AMD family 14 processors codenamed<br />
Bobcat.<br />
Optimization for AMD family 15 processors codenamed<br />
Bulldozer.<br />
Support for various processor-specific intrinsics and instructions is now available through the command<br />
line options described in Table A.2, “Support for Processor-specific Intrinsics and Instructions”.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 71<br />
Table A.2. Support for Processor-specific Intrinsics and Instructions<br />
Option<br />
-mavx2<br />
-mbmi2<br />
-mlzcnt<br />
-mfma<br />
-mfsgsbase<br />
-mrdrnd<br />
-mf16c<br />
-mtbm<br />
-mbmi<br />
-mcrc32<br />
-mmovbe<br />
-mxop, -mfma4, and -<br />
mlwp<br />
-mabm<br />
-mpopcnt<br />
Description<br />
Support for Intel AVX2 intrinsics, built-in functions, and code generation.<br />
Support for Intel BMI2 intrinsics, built-in functions, and code generation.<br />
Implementation and automatic generation of __builtin_clz* using the<br />
lzcnt instruction.<br />
Support for Intel FMA3 intrinsics and code generation.<br />
Enables the generation of new segment register read/write instructions<br />
through dedicated built-ins.<br />
Support for the Intel rdrnd instruction.<br />
Support for two additional AVX vector conversion instructions.<br />
Support for TBM (Trailing Bit Manipulation) built-in functions and code<br />
generation.<br />
Support for AMD's BMI (Bit Manipulation) built-in functions and code<br />
generation.<br />
Support for crc32 intrinsics.<br />
Enables the use of the movbe instruction to implement<br />
__builtin_bswap32 and __builtin_bswap64.<br />
Support for the XOP, FMA4, and LWP instruction sets for the AMD Orochi<br />
processors.<br />
Enables the use of the popcnt and lzcnt instructions on AMD<br />
processors.<br />
Enables the use of the popcnt instruction on both AMD and Intel<br />
processors.<br />
When using the x87 floating-point unit, GCC now generates code that conforms to ISO C99 in terms of<br />
handling of floating-point excess precision. This can be enabled by -fexcess-precision=standard<br />
and disabled by -fexcess-precision=fast. This feature is enabled by default when using<br />
standards conformance options such as -std=c99.<br />
A.1.1.5. Link-time Optimization<br />
Link-time optimization (LTO) is a compilation technique in which GCC generates an internal<br />
representation of each compiled input file in addition to the native code, and writes both to the output<br />
object file. Subsequently, when several object files are linked together, GCC uses the internal<br />
representations of the compiled code to optimize inter-procedurally across all the compilation units. This<br />
can potentially improve the performance of the generated code (for example, functions defined in one file<br />
can potentially be inlined when called in another file).<br />
To enable LTO, the -flto option needs to be specified at both compile time and link time. For further<br />
details, including interoperability with linkers and parallel execution of LTO, refer to the documentation for<br />
-flto in the GCC 4.7.0 Manual. Also note that the internal representation is not a stable interface, so<br />
LTO will only apply to code generated by the same version of GCC.<br />
Note<br />
Use of Link-time Optimization with debug generation is not yet supported in gcc-4.7 and so use of<br />
the -flto and the -g options together is unsupported in <strong>Developer</strong> <strong>Toolset</strong>.
72 Changes in Version 1.0<br />
A.1.1.6. Miscellaneous<br />
-Ofast is now supported as a general optimization level. It operates similar to -O3, adds options that<br />
can yield better-optimized code, but in turn might invalidate standards compliance (for example, -ffastmath<br />
is enabled by -Ofast).<br />
GCC can now inform users about cases in which code generation might be improved by adding<br />
attributes such as const, pure, and noreturn to functions declared in header files. Use the -<br />
Wsuggest-attribute=[const|pure|noreturn] command line option to enable this.<br />
Assembler code can now make use of a goto feature that allows for jumps to labels in C code.<br />
A.1.2. Language Compatibility<br />
In this section, we describe the compatibility between the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> compilers and the<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system compilers at the programming-language level (for example, differences<br />
in the implementation of language standards such as C99, or changes to the warnings generated by -<br />
Wall).<br />
Some of the changes are a result of bug fixing, and some old behaviors have been intentionally changed<br />
in order to support new standards, or relaxed in standards-conforming ways to facilitate compilation or<br />
runtime performance. Some of these changes are not visible to the naked eye and will not cause<br />
problems when updating from older versions. However, some of these changes are visible, and can<br />
cause grief to users porting to <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s version of GCC. The following text attempts<br />
to identify major issues and suggests solutions.<br />
A.1.2.1. C<br />
Constant expressions are now handled by GCC in a way that conforms to C90 and C99. For code<br />
expressions that can be transformed into constants by the compiler but are in fact not constant<br />
expressions as defined by ISO C, this may cause warnings or errors.<br />
Ill-formed redeclarations of library functions are not accepted anymore by the compiler. In particular, a<br />
function with a signature similar to the built-in declaration of a library function (for example, abort() or<br />
memcpy()) must be declared with extern "C" to be considered as a redeclaration, otherwise it is illformed.<br />
Duplicate Member<br />
Consider the following struct declaration:<br />
struct A { int *a; union { struct { int *a; }; }; };<br />
Previously, this declaration used to be diagnosed just by the C++ compiler, now it is diagnosed also by<br />
the C compiler. Because of the anonymous unions and structs, there is ambiguity about what .a actually<br />
refers to and one of the fields therefore needs to be renamed.<br />
A.1.2.2. C++<br />
Header Dependency Changes<br />
, , and other STL headers that previously included as an<br />
implementation detail (to get some feature macros for gthr*.h purposes) no longer do so, because it<br />
was a C++ standard violation. This can result in diagnostic output similar to the following:
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 73<br />
error: ‘truncate’ was not declared in this scope<br />
error: ‘sleep’ was not declared in this scope<br />
error: ‘pipe’ was not declared in this scope<br />
error: there are no arguments to 'offsetof' that depend on a template<br />
parameter, so a declaration of 'offsetof' must be available<br />
To fix this, add the following line early in the source or header files that need it:<br />
#include <br />
Many of the standard C++ library include files have been edited to no longer include to get<br />
namespace-std-scoped versions of size_t and ptrdiff_t. As such, C++ programs that used the<br />
macros NULL or offsetof without including will no longer compile. The diagnostic<br />
produced is similar to the following:<br />
error: 'ptrdiff_t' does not name a type<br />
error: 'size_t' has not been declared<br />
error: 'NULL' was not declared in this scope<br />
error: there are no arguments to 'offsetof' that depend on a template<br />
parameter, so a declaration of 'offsetof' must be available<br />
To fix this issue, add the following line:<br />
#include <br />
Name Lookup Changes<br />
G++ no longer performs an extra unqualified lookup that it incorrectly performed in the past. Instead, it<br />
implements the two-phase lookup rules correctly, and an unqualified name used in a template must have<br />
an appropriate declaration that:<br />
1. is either in scope at the point of the template's definition, or<br />
2. can be found by argument-dependent lookup at the point of instantiation.<br />
Code that incorrectly depends on a second unqualified lookup at the point of instantiation (such as<br />
finding functions declared after the template or in dependent bases) will result in compile-time errors.<br />
In some cases, the diagnostics provided by G++ include hints how to fix the bugs. Consider the following<br />
code:<br />
template<br />
int t(T i)<br />
{<br />
return f(i);<br />
}<br />
int f(int i)<br />
{<br />
return i;<br />
}<br />
int main()<br />
{<br />
return t(1);<br />
}<br />
The following diagnostics output will be produced:
74 Changes in Version 1.0<br />
In instantiation of ‘int t(T) [with T = int]’<br />
required from here<br />
error: ‘f’ was not declared in this scope, and no declarations were found by<br />
argument-dependent lookup at the point of instantiation [-fpermissive]<br />
note: ‘int f(int)’ declared here, later in the translation unit<br />
To correct the error in this example, move the declaration of function f() before the definition of<br />
template function t(). The -fpermissive compiler flag turns compile-time errors into warnings and<br />
can be used as a temporary workaround.<br />
Uninitialized const<br />
Consider the following declaration:<br />
struct A { int a; A (); };<br />
struct B : public A { };<br />
const B b;<br />
An attempt to compile this code now fails with the following error:<br />
error: uninitialized const ‘b’ [-fpermissive]<br />
note: ‘const struct B’ has no user-provided default constructor<br />
This happens, because B does not have a user-provided default constructor. Either an initializer needs<br />
to be provided, or the default constructor needs to be added.<br />
Visibility of Template Instantiations<br />
The ELF symbol visibility of a template instantiation is now properly constrained by the visibility of its<br />
template arguments. For instance, users that instantiate standard library components like std::vector<br />
with hidden user defined types such as struct my_hidden_struct can now expect hidden visibility<br />
for std::vector symbols. As a result, users that compile with the -<br />
fvisibility=hidden command line option should be aware of the visibility of types included from the<br />
library headers used. If the header does not explicitly control symbol visibility, types from those headers<br />
will be hidden, along with instantiations that use those types. For instance, consider the following code:<br />
#include <br />
// template std::vector has default visibility<br />
#include <br />
// struct tm has hidden visibility<br />
template class std::vector; // instantiation has hidden visibility<br />
One approach to adjusting the visibility of a library header is to create a forwarding header on<br />
the -I include path consisting of the following:<br />
#pragma GCC visibility push(default)<br />
#include_next <br />
#pragma GCC visibility push<br />
<strong>User</strong>-defined Literal Support<br />
When compiling C++ with the -std={c++11,c++0x,gnu++11,gnu++0x} command line option, GCC<br />
4.7.0 unlike older versions supports user-defined literals, which are incompatible with some valid ISO<br />
C++03 code. In particular, white space is now needed after a string literal before something that could<br />
be a valid user defined literal. Consider the following code:<br />
const char *p = "foobar"__TIME__;
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 75<br />
In C++03, the __TIME__ macro expands to some string literal and is concatenated with the other one. In<br />
C++11, __TIME__ is not expanded and instead, operator "" __TIME__ is being looked up, which<br />
results in a warning like:<br />
error: unable to find string literal operator ‘operator"" __TIME__’<br />
This applies to any string literal followed without white space by some macro. To fix this, add some white<br />
space between the string literal and the macro name.<br />
Taking the Address of Temporary<br />
Consider the following code:<br />
struct S { S (); int i; };<br />
void bar (S *);<br />
void foo () { bar (&S ()); }<br />
Previously, an attempt to compile this code produced a warning message, now it fails with an error. This<br />
can be fixed by adding a variable and passing the address of this variable instead of the temporary. The<br />
-fpermissive compiler flag turns compile-time errors into warnings and can be used as a temporary<br />
workaround.<br />
Miscellaneous<br />
G++ now sets the predefined macro __cplusplus to the correct value: 199711L for C++98/03, and<br />
201103L for C++11.<br />
G++ now properly re-uses stack space allocated for temporary objects when their lifetime ends, which<br />
can significantly lower stack consumption for some C++ functions. As a result of this, some code with<br />
undefined behavior will now break.<br />
When an extern declaration within a function does not match a declaration in the enclosing context, G++<br />
now properly declares the name within the namespace of the function rather than the namespace which<br />
was open just before the function definition.<br />
G++ now implements the proposed resolution of the C++ standard's core issue 253. Default initialization<br />
is allowed if it initializes all subobjects, and code that fails to compile can be fixed by providing an<br />
initializer such as:<br />
struct A { A(); };<br />
struct B : A { int i; };<br />
const B b = B();<br />
Access control is now applied to typedef names used in a template, which may cause G++ to reject<br />
some ill-formed code that was accepted by earlier releases. The -fno-access-control option can<br />
be used as a temporary workaround until the code is corrected.<br />
G++ now implements the C++ standard's core issue 176. Previously, G++ did not support using the<br />
injected-class-name of a template base class as a type name, and lookup of the name found the<br />
declaration of the template in the enclosing scope. Now lookup of the name finds the injected-classname,<br />
which can be used either as a type or as a template, depending on whether or not the name is<br />
followed by a template argument list. As a result of this change, some code that was previously accepted<br />
may be ill-formed, because:<br />
1. the injected-class-name is not accessible because it is from a private base, or<br />
2. the injected-class-name cannot be used as an argument for a template parameter.
76 Changes in Version 1.0<br />
In either of these cases, the code can be fixed by adding a nested-name-specifier to explicitly name the<br />
template. The first can be worked around with -fno-access-control, the second is only rejected<br />
with -pedantic.<br />
A.1.2.3. C/C++ Warnings<br />
GCC 4.7.0 adds a number of new warnings that are either enabled by default, or by using the -Wall<br />
option. Although these warnings do not result in compilation failure on their own, often -Wall is used in<br />
conjunction with -Werror, causing these warnings to act like errors. This section provides a list of<br />
these new or newly enabled warnings. Unless noted otherwise, these warnings apply to both C and<br />
C++.<br />
The behavior of the -Wall command line option has changed and now includes the new warning flags -<br />
Wunused-but-set-variable and, with -Wall -Wextra, -Wunused-but-set-parameter. This<br />
may result in new warnings in code that compiled cleanly with previous versions of GCC. For example,<br />
consider the following code:<br />
void fn (void)<br />
{<br />
int foo;<br />
foo = bar (); /* foo is never used. */<br />
}<br />
The following diagnostic output will be produced:<br />
warning: variable "foo" set but not used [-Wunused-but-set-variable]<br />
To fix this issue, first see if the unused variable or parameter can be removed without changing the<br />
result or logic of the surrounding code. If not, annotate it with __attribute__((__unused__)). As a<br />
workaround, you can use the -Wno-error=unused-but-set-variable or -Wno-error=unusedbut-set-parameter<br />
command line option.<br />
The -Wenum-compare option causes GCC to report a warning when values of different enum types<br />
are being compared. Previously, this option only worked for C++ programs, but now it works for C as<br />
well. This warning is enabled by -Wall and may be avoided by using a type cast.<br />
Casting integers to larger pointer types now causes GCC to display a warning by default. To disable<br />
these warnings, use the -Wno-int-to-pointer-cast option, which is available for both C and C++.<br />
Conversions between NULL and non-pointer types now cause GCC to report a warning by default.<br />
Previously, these warnings were only displayed when explicitly using -Wconversion. To disable these<br />
warnings, use the new -Wno-conversion-null command line option.<br />
GCC can now warn when a class that has virtual functions and a non-virtual destructor is destroyed by<br />
using delete. This is unsafe to do because the pointer might refer to a base class that does not have<br />
a virtual destructor. The warning is enabled by -Wall and by a new command line option, -Wdeletenon-virtual-dtor.<br />
New -Wc++11-compat and -Wc++0x-compat options are now available. These options cause GCC<br />
to display a warning about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++<br />
2011 (such as identifiers in ISO C++ 1998 that are keywords in ISO C++ 2011). This warning is enabled<br />
by -Wall and enables the -Wnarrowing option.<br />
A.1.3. ABI Compatibility<br />
This section describes compatibility between the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> compilers and the system
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 77<br />
compilers on the application binary interface (ABI) level.<br />
A.1.3.1. C++ ABI<br />
Because the upstream GCC community development does not guarantee C++11 ABI compatibility<br />
across major versions of GCC, the same applies to use of C++11 with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>.<br />
Consequently, using the -std=c++11 option is supported in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 only when<br />
all C++ objects compiled with that flag have been built using the same major version of <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong>. The mixing of objects, binaries and libraries, built by the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5<br />
or 6 system toolchain GCC using the -std=c++0x or -std=gnu++0x flags, with those built with the -<br />
std=c++11 or -std=gnu++11 flags using the GCC in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is explicitly not<br />
supported.<br />
As later major versions of <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> may use a later major release of GCC, forwardcompatibility<br />
of objects, binaries, and libraries built with the -std=c++11 or -std=gnu++11 options<br />
cannot be guaranteed, and so is not supported.<br />
The default language standard setting for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> is C++98. Any C++98-compliant<br />
binaries or libraries built in this default mode (or explicitly with -std=c++98) can be freely mixed with<br />
binaries and shared libraries built by the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5 or 6 system toolchain GCC. <strong>Red</strong><br />
<strong>Hat</strong> recommends use of this default -std=c++98 mode for production software development.<br />
Important<br />
Use of C++11 features in your application requires careful consideration of the above ABI<br />
compatibility information.<br />
Aside from the C++11 ABI, discussed above, the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> Application Compatibility<br />
Specification is unchanged for <strong>Developer</strong> <strong>Toolset</strong>. When mixing objects built with <strong>Developer</strong> <strong>Toolset</strong> with<br />
those built with the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> v5.x/v6.x toolchain (particularly .o/.a files), the <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> toolchain should be used for any linkage. This ensures any newer library features<br />
provided only by <strong>Developer</strong> <strong>Toolset</strong> are resolved at link-time.<br />
A new standard mangling for SIMD vector types has been added to avoid name clashes on systems with<br />
vectors of varying length. By default the compiler still uses the old mangling, but emits aliases with the<br />
new mangling on targets that support strong aliases. -Wabi will now display a warning about code that<br />
uses the old mangling.<br />
A.1.3.2. Miscellaneous<br />
GCC now optimizes calls to various standard C string functions such as strlen(), strchr(),<br />
strcpy(), strcat() and stpcpy() (as well as their respective _FORTIFY_SOURCE variants) by<br />
transforming them into custom, faster code. This means that there might be fewer or other calls to those<br />
functions than in the original source code. The optimization is enabled by default at -O2 or higher<br />
optimization levels. It is disabled when using -fno-optimize-strlen or when optimizing for size.<br />
When compiling for 32-bit GNU/<strong>Linux</strong> and not optimizing for size, -fomit-frame-pointer is now<br />
enabled by default. The prior default setting can be chosen by using the -fno-omit-frame-pointer<br />
command line option.<br />
Floating-point calculations on x86 targets and in strict C99 mode are now compiled by GCC with a<br />
stricter standard conformance. This might result in those calculations executing significantly slower. It<br />
can be disabled using -fexcess-precision=fast.
78 Changes in Version 1.0<br />
A.1.4 . Debugging Compatibility<br />
GCC now generates DWARF debugging information that uses more or newer DWARF features than<br />
previously. GDB contained in the <strong>Developer</strong> <strong>Toolset</strong> can handle these features, but versions of GDB<br />
older than 7.0 cannot. GCC can be restricted to only generate debugging information with older DWARF<br />
features by using the -gdwarf-2 -gstrict-dwarf or -gdwarf-3 -gstrict-dwarf options (the<br />
latter are handled partially by versions of GDB older than 7.0).<br />
Many tools such as Valgrind, SystemTap, or third-party debuggers utilize debugging information. It is<br />
suggested to use the -gdwarf-2 -gstrict-dwarf options with those tools.<br />
Note<br />
Use of Link-time Optimization with debug generation is not yet supported in gcc-4.7 and so use of<br />
the -flto and the -g options together is unsupported in <strong>Developer</strong> <strong>Toolset</strong>.<br />
A.1.5. Other Compatibility<br />
GCC is now more strict when parsing command line options, and both gcc and g++ report an error<br />
when invalid command line options are used. In particular, when only linking and not compiling code,<br />
earlier versions of GCC ignored all options starting with --. For example, options accepted by the linker<br />
such as --as-needed and --export-dynamic are not accepted by gcc and g++ anymore, and<br />
should now be directed to the linker using -Wl,--as-needed or -Wl,--export-dynamic if that is<br />
intended.<br />
Because of the new link-time optimization feature (see Section A.1.1.5, “Link-time Optimization”), support<br />
for the older intermodule optimization framework has been removed and the -combine command line<br />
option is not accepted anymore.<br />
A.2. Changes in GDB 7.4<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 is distributed with GDB 7.4 , which provides a number of bug fixes and<br />
feature enhancements over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version. Below is a comprehensive list<br />
of new features and compatibility changes in this release. For details on how to use these new features,<br />
refer to the GDB documentation.<br />
A.2.1. New Features<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.2<br />
The following features have been added since the release of the GNU Debugger included in <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong> 6.2:<br />
Support for linespecs has been improved (in particular, a more consistent handling of ambiguous<br />
linespecs, some support for labels in the program's source, and FILE:LINE support now extends to<br />
further linespecs types). Breakpoints are now set on all matching locations in all inferiors and will be<br />
updated according to changes in the inferior.<br />
New inferior control commands skip function and skip file have been added. These<br />
commands can be uses to skip certain functions and files when stepping.<br />
The info threads command now displays the thread name as set by prctl or<br />
pthread_setname_np. In addition, new commands thread name and thread find have been<br />
added. The thread name command accepts a name as an argument and can be used to set the<br />
name of the current thread. The thread find command accepts a regular expression and allows
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 79<br />
the user to find threads that match it.<br />
GDB now provides support for reading and writing a new .gdb_index section. The command gdbadd-index<br />
can be used to add .gdb_index to a file, which allows GDB to load symbols from that<br />
file faster. Note that this feature is already present in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.1 and later.<br />
The watch command has been adapted to accept -location as an optional argument.<br />
Two new special values can now be used when specifying the current search path for<br />
libthread_db: $sdir represents the default system locations of shared libraries, and $pdir<br />
stands for the directory with the libthread that is used by the application.<br />
A new command info macros has been added. This command accepts linespec as an optional<br />
argument and can be used to display the definitions of macros at that linespec location. Note that in<br />
order to do this, the debugged program must be compiled with the -g3 command line option to have<br />
macro information available in it.<br />
A new command alias has been added. This command can be used to create an alias of an<br />
existing command.<br />
The info macro command now accepts -all and -- as valid options.<br />
To display a function parameter's entry value (that is, the value at the time of function entry), the<br />
suffix @entry can be added to the parameter. GDB now displays @entry values in backtraces, if<br />
available.<br />
New set print entry-values and show print entry-values commands have been added.<br />
The set print entry-values command accepts both, compact, default, if-needed, no,<br />
only, and preferred as valid arguments and can be used to enable printing of function<br />
arguments at function entry. The show print entry-values command can be used to determine<br />
whether this feature is enabled.<br />
New set debug entry-values and show debug entry-values commands have been added.<br />
The set debug entry-values command can be used to enable printing of debugging information<br />
for determining frame argument values at function entry and virtual tail call frames.<br />
!command has been added as an alias of shell command.<br />
The watch command now accepts mask mask_value as an argument. This can be used to create<br />
masked watchpoints.<br />
New set extended-prompt and show extended-prompt commands have been added. The<br />
set extended-prompt command enables support for a defined set of escape sequences that<br />
can be used to display various information. The show extended-prompt command can be used<br />
to determine whether the extended prompt is enabled.<br />
New set basenames-may-differ and show basenames-may-differ commands have been<br />
added. The set basenames-may-differ command enables support for source files with multiple<br />
base names. The show basenames-may-differ command can be used to determine whether<br />
this support is enabled. The default option is off to allow faster GDB operations.<br />
A new command line option -ix (or --init-command) has been added. This option acts like -x (or<br />
--command), but is executed before loading the debugged program.<br />
A new command line option -iex (or --init-eval-command) has been added. This option acts<br />
like -ex (or --eval-command), but is executed before loading the debugged program.<br />
The following changes have been made to the C++ language support since the release of the GNU<br />
Debugger included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.2:<br />
When debugging a template instantiation, parameters of the template are now put in scope.<br />
The following changes have been made to the Python scripting support since the release of the GNU<br />
Debugger included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.2:<br />
The register_pretty_printer function in module gdb.printing now takes an optional
80 Changes in Version 1.0<br />
replace argument.<br />
The maint set python print-stack on|off command has been deprecated and will be<br />
deleted in GDB 7.5. The new command set python print-stack none|full|message has<br />
replaced it.<br />
A prompt substitution hook (prompt_hook) is now available to the Python API.<br />
A new Python module gdb.prompt has been added to the GDB Python modules library.<br />
Python commands and convenience-functions located in<br />
data_directory/python/gdb/command/ and data_directory/python/gdb/function/ are<br />
now automatically loaded on GDB start-up.<br />
Blocks now provide four new attributes: global_block, static_block, is_static, and<br />
is_global.<br />
The gdb.breakpoint function has been deprecated in favor of gdb.breakpoints.<br />
A new class gdb.FinishBreakpoint is provided.<br />
Type objects for struct and union types now allow access to the fields using standard Python<br />
dictionary (mapping) methods.<br />
A new event gdb.new_objfile has been added.<br />
A new function deep_items has been added to the gdb.types module.<br />
The function gdb.Write now accepts an optional keyword stream.<br />
Parameters can now be sub-classed in Python, which allows for implementation of the get_set_doc<br />
and get_show_doc functions.<br />
Symbols, Symbol Table, Symbol Table and Line, Object Files, Inferior, Inferior Thread, Blocks, and<br />
Block Iterator APIs now have an is_valid method.<br />
Breakpoints can now be sub-classed in Python, which allows for implementation of the stop function<br />
that is executed each time the inferior reaches that breakpoint.<br />
A new function gdb.lookup_global_symbol has been added. This function can be used to look<br />
up a global symbol.<br />
GDB values in Python are now callable if the value represents a function.<br />
A new module gdb.types has been added.<br />
A new module gdb.printing has been added.<br />
New commands info pretty-printers, enable pretty-printer, and disable prettyprinter<br />
have been added.<br />
A new gdb.parameter("directories") function call is now available.<br />
A new function gdb.newest_frame has been added. This function can be used to return the<br />
newest frame in the selected thread.<br />
The gdb.InferiorThread class now supports a new name attribute.<br />
Support for inferior events has been added. Python scripts can now add observers in order to be<br />
notified of events occurring in the process being debugged.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8<br />
In addition to the above changes, the following features have been added since the release of GNU<br />
Debugger included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8:<br />
For remote targets, debugging of shared libraries is now supported by default.<br />
New commands set observer and show observer have been added. The set observer<br />
command accepts on or off as an argument and can be used to allow or disallow the GNU<br />
Debugger to affect the execution of the debugged program. Use the show observer command to<br />
determine whether observer mode is enabled.<br />
A new convenience variable $_thread has been added. This variable stores the number of the
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 81<br />
current thread.<br />
The source command now accepts -s as a valid option. This option can be used to search for the<br />
script in the source search path regardless of the path in the file name.<br />
Support for tracepoints, including fast and static tracepoints, has been added to gdbserver.<br />
The --batch command line option has been adapted to disable pagination and queries.<br />
Direct support for the reading and writing byte, word, and double-word x86 general purpose registers<br />
such as $al has been added.<br />
The commands command now accepts a range of breakpoints as an argument.<br />
The rbreak command now accepts a file name as part of its argument. This can be used to limit the<br />
functions selected by the supplied regular expression to those that are defined in the specified file.<br />
Support for multi-program (sometimes referred to as multi-executable or multi-exec) debugging has<br />
been added. In particular, the GNU Debugger now supports the following commands:<br />
The add-inferior command can be used to add a new inferior.<br />
The clone-inferior command can be used to create a copy of an inferior with the same<br />
executable loaded.<br />
The remove-inferior command accepts an inferior ID as an argument and can be used to<br />
remove an inferior.<br />
Support for trace state variables has been added. In particular, the GNU Debugger now supports the<br />
following commands:<br />
The tvariable $variable_name [= expression] command can be used to define or<br />
modify a trace state variable.<br />
The info tvariables command can be used to display a list of currently defined trace state<br />
variables and their values.<br />
The delete tvariable $variable_name... command can be used to delete one or more<br />
trace state variables.<br />
A new ftrace has been added. This command accepts a function name, a line number, or an<br />
address as an argument, and can be used to define a fast tracepoint at that location.<br />
Support for disconnected tracing, trace files, and circular trace buffer has been added.<br />
A new teval command has been added. This command accepts one or more expressions to<br />
evaluate at a tracepoint.<br />
The GNU Debugger has been adapted to parse the 0b prefix of binary numbers exactly the same<br />
way as the GNU Compiler Collection.<br />
The GNU Debugger now supports the following commands for process record and replay:<br />
New commands set record memory and show record memory have been added. The<br />
set record memory command accepts on or off as an argument and can be used to enable<br />
or disable stopping the inferior when a memory change of the next instruction cannot be<br />
recorded. Use the show record memory-query command to determine whether this feature<br />
is enabled.<br />
A new command record save has been added. This command accepts a file name as an<br />
argument and can be used to save the execution log to a file.<br />
A new command record restore has been added. This command accepts a file name as an<br />
argument and can be used to restore the execution log from a file.<br />
A new command eval has been added. This command accepts a format string followed by one or<br />
more arguments, transforms it to a command, and then executes it.<br />
A new command save breakpoints has been added. This command accepts a file name as an<br />
argument and can be used to store all currently defined breakpoints to a file. To restore the saved<br />
breakpoints from this file, use the source command.<br />
New commands may-write-registers, set may-write-memory, set may-insertbreakpoints,<br />
set may-insert-tracepoints, set may-insert-fast-tracepoints, and
82 Changes in Version 1.0<br />
set may-interrupt have been added. All of these commands accept either on or off as an<br />
argument, and can be used to set individual permissions for the target.<br />
A new command main info program-spaces has been added. This command can be used to<br />
display information about currently loaded program spaces.<br />
New commands set remote interrupt-sequence and show remote interruptsequence<br />
have been added. The set remote interrupt-sequence command accepts Ctrl-<br />
C, BREAK, and BREAK-g as valid arguments, and can be used to specify which interrupt sequence to<br />
send to the remote target in order to interrupt its execution. Use the show remote interruptsequence<br />
to determine the current setting.<br />
New commands set remote interrupt-on-connect and show remote interrupt-onconnect<br />
have been added. The set remote interrupt-on-connect accepts either on or<br />
off as an argument, and can be used to enable sending an interrupt sequence to the remote target<br />
when the GNU Debugger connects to it. Use the show remote interrupt-on-connect<br />
command to determine whether this feature is enabled.<br />
The set remotebreak and show remotebreak commands have been deprecated and users<br />
are advised to use set remote interrupt-sequence and show remote interruptsequence<br />
instead.<br />
The disassemble command has been adapted to accept two arguments in the form of<br />
start,+length.<br />
The source command can now be used to read commands from Python scripts.<br />
The following changes have been made to the C++ language support since the release of the GNU<br />
Debugger included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8:<br />
Argument-dependent lookup (ADL) now directs function search to the namespaces of its arguments<br />
regardless of whether the namespace has been imported.<br />
In addition to member operators, the GNU Debugger can now look up operators that are:<br />
defined in the global scope,<br />
defined in a namespace and imported via the using directive,<br />
implicitly imported from an anonymous namespace, or<br />
the argument-dependent lookup (ADL operators.<br />
Support for printing of static const class members that are initialized in the class definition has been<br />
enhanced.<br />
Support for importing of namespaces has been added.<br />
The C++ expression parser has been adapted to handle the cast operators static_cast,<br />
dynamic_cast, const_cast, and reinterpret_cast.<br />
The following changes have been made to the Python scripting support since the release of the GNU<br />
Debugger in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8:<br />
The GNU Debugger is now installed with a new directory located at /opt/rh/devtoolset-<br />
1.1/root/usr/share/gdb/python/. This directory serves as a standard location for Python<br />
scripts written for GDB.<br />
The Python API has been adapted to provide access to symbols, symbol tables, program spaces,<br />
breakpoints, inferiors, threads, and frame's code blocks. <strong>User</strong>s are now also allowed to create<br />
custom GDB parameters from the API and manipulate them by using the set and show commands.<br />
New functions gdb.target_charset, gdb.target_wide_charset, gdb.progspaces,<br />
gdb.current_progspace, and gdb.string_to_argv have been added.<br />
A new exception gdb.GdbError has been added.<br />
The GNU Debugger now searches pretty-printers in the current program space.<br />
The GNU Debugger can now enable or disable pretty-printers individually.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 83<br />
The GNU Debugger has been adapted to look for names of Python scripts to automatically load in a<br />
special section named .debug_gdb_scripts.<br />
A.2.2. Compatibility Changes<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.2<br />
The following changes have been made since the release of the GNU Debugger included in <strong>Red</strong> <strong>Hat</strong><br />
Enterprise <strong>Linux</strong> 6.2:<br />
A new command info auto-load has been added and can be used to display the status of<br />
various automatically loaded files. The info auto-load gdb-scripts command lists<br />
automatically loaded canned sequences of commands, info auto-load python-scripts<br />
displays the status of automatically loaded Python scripts, info auto-load local-gdbinit<br />
displays whether a local .gdbinit file in the current working directory is loaded, and info autoload<br />
libthread-db displays whether the inferior-specific thread debugging shared library is<br />
loaded.<br />
New commands set auto-load and show auto-load have been added and can be used to<br />
control automatic loading of files:<br />
The set auto-load gdb-scripts and show auto-load gdb-scripts commands control<br />
automatic loading of GDB scripts.<br />
The set auto-load python-scripts and show auto-load python-scripts<br />
commands control automatic loading of Python scripts.<br />
The set auto-load local-gdbinit and show auto-load local-gdbinit commands<br />
control automatic loading of .gdbinit from the current working directory.<br />
The set auto-load libthread-db and show auto-load libthread-db commands<br />
control automatic loading of inferior-specific libthread_db.<br />
The set auto-load scripts-directory and show auto-load scripts-directory<br />
commands control the list of directories from which to automatically load GDB and Python scripts.<br />
The set auto-load safe-path and show auto-load safe-path commands control the<br />
list of directories from which it is safe to automatically load all previously mentioned items.<br />
The set debug auto-load and show debug auto-load commands control displaying of<br />
debugging information for all previously mentioned items.<br />
The set auto-load off command can be used to disable automatic loading globally. You can<br />
also use show auto-load with no subcommand to display current settings of all previously<br />
mentioned items.<br />
The maint set python auto-load on|off command has been replaced with set autoload<br />
python-scripts on|off.<br />
The maintenance print section-scripts command has been renamed to info autoload<br />
python-scripts [pattern] and is no longer classified as a maintenance-only command.<br />
Support for the Guile extension language has been removed.<br />
The GNU Debugger has been adapted to follow GCC's rules on accessing volatile objects when<br />
reading or writing target state during expression evaluation.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8<br />
No noteworthy changes that affect compatibility have been made in addition to those described above.<br />
A.3. Changes in binutils 2.22.52<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 is distributed with binutils 2.22.52, which provides a number of bug
84 Changes in Version 1.0<br />
fixes and feature enhancements over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version. Below is a<br />
comprehensive list of new features and compatibility changes in this release. For details on how to use<br />
these new features, refer to the binutils documentation.<br />
The GNU assembler (as), GNU linker (ld), newly added ELF linker (gold), and other binary tools that<br />
are part of the binutils are now released under the GNU General Public License, version 3.<br />
A.3.1. GNU Linker<br />
Another ELF linker, gold, is now available in addition to ld, the existing GNU linker. gold is intended to<br />
be a drop-in replacement for ld, so ld's documentation is intended to be the reference documentation.<br />
gold supports most of ld's features, except notable ones such as MRI-compatible linker scripts, crossreference<br />
reports (--cref), and various other minor options. It also provides significantly improved link<br />
time with very large C++ applications.<br />
In <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, the gold linker is not enabled by default. <strong>User</strong>s can explicitly switch<br />
between ld and gold by using the alternatives mechanism.<br />
A.3.1.1. New Features<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.2<br />
The following features have been added since the release of binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6.2:<br />
A new INPUT_SECTION_FLAGS keyword has been added to the linker script language. This<br />
keyword can be used to select input sections by section header flags.<br />
A new SORT_BY_INIT_PRIORITY keyword has been added to the linker script language. This<br />
keyword can be used to sort sections by numerical value of the GCC init_priority attribute<br />
encoded in the section name.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8<br />
In addition to the above changes, the following features have been added since the release of the<br />
binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8:<br />
GNU/<strong>Linux</strong> targets now support the STB_GNU_UNIQUE symbol binding, a GNU extension to the<br />
standard set of ELF symbol bindings. The binding is passed on to the dynamic linker, which ensures<br />
that in the entire process there is only one symbol with the given name and type in use.<br />
Note<br />
The implementation of this feature depends on capabilities only found in newer versions of<br />
the glibc library. Consequently, this feature is currently available in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.<br />
A new command line option --no-export-dynamic has been added. This option can be used to<br />
undo the effect of the -E and --export-dynamic options.<br />
A new command line option --warn-alternate-em has been added. This option can be used to<br />
display a warning if an ELF format object file uses an alternate machine code.<br />
A new linker script function REGION_ALIAS has been added. This function can be used to create<br />
alias names of memory regions.<br />
A new command line option -Ttext-segment address has been added for ELF-based targets.<br />
This option can be used to set the address of the first byte of the text segment.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 85<br />
A new linker script command INSERT has been added. This command can be used to augment the<br />
default script.<br />
In a linker script input section, it is now possible to specify a file within an archive by using the<br />
archive:file syntax.<br />
The --sort-common command line option now accepts ascending and descending as optional<br />
arguments. This can be used to specify which sorting order to use.<br />
A new command line option --build-id has been added for ELF-based targets. This option can be<br />
used to generate a unique per-binary identifier embedded in a note section.<br />
A new command line option --default-script=file_name (or -dT file_name) has been<br />
added. This option can be used to specify a replacement for the built-in linker script.<br />
A new command line option -Bsymbolic-functions has been added. When creating a shared<br />
library, this option will cause references to global function symbols to be bound to the definitions with<br />
the shared library, if such exist.<br />
The new command line options --dynamic-list-cpp-new and --dynamic-list-data have<br />
been added, which can be used to modify the dynamic list.<br />
A.3.1.2. Compatibility Changes<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.2<br />
The following changes have been made since the release of the binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6.2:<br />
The --copy-dt-needed-entries command line option is no longer enabled by default. Instead, -<br />
-no-copy-dt-needed-entries is now the default option.<br />
Evaluation of linker script expressions has been significantly improved. Note that this can negatively<br />
affect scripts that rely on undocumented behavior of the old expression evaluation.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8<br />
In addition to the above changes, the following changes have been made since the release of the<br />
binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8:<br />
The --add-needed command line option has been renamed to --copy-dt-needed-entries in<br />
order to avoid confusion with the --as-needed option.<br />
For GNU/<strong>Linux</strong> systems, the linker no longer processes any relocations made against symbols of the<br />
STT_GNU_IFUNC type. Instead, it emits them into the resulting binary for processing by the loader.<br />
Note<br />
The implementation of this feature depends on capabilities only found in newer versions of<br />
the glibc library. Consequently, this feature is currently available in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.<br />
The --as-needed command line option has been adapted to link in a dynamic library in the<br />
following two cases:<br />
1. if the dynamic library satisfies undefined symbols in regular objects, and<br />
2. if the dynamic library satisfies undefined symbols in other dynamic libraries unless the library<br />
is already found in a DT_NEEDED entry of one of the libraries that are already linked.<br />
The -l:file_name command line option now searches the library path for a file name called<br />
file_name without adding the .a or .so file extension.
86 Changes in Version 1.0<br />
A.3.2. GNU Assembler<br />
A.3.2.1. New Features<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.2<br />
The following features have been added since the release of the binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6.2:<br />
The GNU Assembler no longer requires double ampersands in macros.<br />
A new --compress-debug-sections command line option has been added to enable<br />
compression of DWARF debug information sections in the relocatable output file. Compressed debug<br />
sections are currently supported by the readelf, objdump, and gold tools, but not by ld.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8<br />
In addition to the above changes, the following features have been added since the release of the<br />
binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8:<br />
GNU/<strong>Linux</strong> targets now support gnu_unique_object as a value of the .type pseudo operation.<br />
This value can be used to mark a symbol as globally unique in the entire process.<br />
Support for the new discriminator column in the DWARF line table with a discriminator operand for the<br />
.loc directive has been added.<br />
The .type pseudo operation now accepts a type of STT_GNU_IFUNC. This can be used to indicate<br />
that if the symbol is the target of a relocation, its value should not be used. Instead, the function<br />
should be invoked and its result used as the value.<br />
A new pseudo operation .cfi_val_encoded_addr has been added. This pseudo operation can<br />
be used to record constant addresses in unwind tables without runtime relocation.<br />
A new command line option -msse-check=[none|error|warning] has been added for x86<br />
targets.<br />
The -a command line option now accepts g as a valid sub-option. This combination can be used to<br />
enable assembly listings with additional information about the assembly, including the list of supplied<br />
command line options or the assembler version.<br />
A new command line option -msse2avx has been added for x86 targets. This option can be used to<br />
encode SSE instructions with VEX prefix.<br />
x86 targets now support the Intel XSAVE, EPT, MOVBE, AES, PCLMUL, and AVX/FMA instructions.<br />
New command line options -march=cpu[,+extension…], -mtune=cpu, -<br />
mmnemonic=[att|intel], -msyntax=[att|intel], -mindex-reg, -mnaked-reg, and -<br />
mold-gcc have been added for x86 targets.<br />
New pseudo operations .string16, .string32, and .string64 have been added. These<br />
pseudo operations be used to generate wide character strings.<br />
The i386 port now supports the SSE5 instruction set.<br />
A new pseudo operation .reloc has been added. This pseudo operation serves as a low-level<br />
interface for creating relocations.<br />
A.3.2.2. Compatibility Changes<br />
No noteworthy changes that affect compatibility have been made.<br />
A.3.3. Other Binary Tools<br />
A.3.3.1. New Features
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 87<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.2<br />
The following features have been added since the release of the binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6.2:<br />
The readelf and objdump tools can now display the contents of the .debug.macro sections.<br />
New --dwarf-start and --dwarf-end command line options have been added to the readelf<br />
and objdump tools. These options are used by the new Emacs mode (see the dwarf-mode.el<br />
file).<br />
A new --interleave-width command line option has been added to the objcopy tool to allow<br />
the use of the --interleave to copy a range of bytes from the input to the output.<br />
A new --dyn-syms command line option has been added to the readelf tool. This option can be<br />
used to dump dynamic symbol table.<br />
A new tool, elfedit, has been added to the binutils. This tool can be used to directly manipulate<br />
ELF format binaries.<br />
A new command line option --addresses (or -a for short) has been added to the addr2line<br />
tool. This option can be used to display addresses before function and source file names.<br />
A new command line option --pretty-print (or -p for short) has been added to the addr2line<br />
tool. This option can be used to produce human-readable output.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8<br />
In addition to the above changes, the following features have been added since the release of the<br />
binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8:<br />
A new command line option --insn-width=width has been added to the objdump tool. This<br />
option can be used to specify the number of bytes to be displayed on a single line when<br />
disassembling instructions.<br />
A new command line option --relocated-dump=name|number has been added to the readelf<br />
tool. This option can be used to display the relocated contents of a section as a sequence of bytes.<br />
A new command line option --external-symbols-table=filename has been added to the<br />
gprof tool. This option can be used to read a symbol table from a certain file.<br />
bfd now supports a plugin target, which can be used to get basic support for new file formats by<br />
having the plugin target load the same shared objects used by gold.<br />
The --dwarf (or -W for short) command line option of the objdump tool has been adapted to be<br />
as flexible as the --debug-dump (or -w) option of readelf.<br />
New command line options --prefix=prefix and --prefix-strip=level have been added to<br />
the objdump tool. These options can be used to add absolute paths for the --source (or -S for<br />
short) option.<br />
A new command line option -wL has been added to the readelf tool. This option can be used to<br />
dump decoded contents of the .debug_line section.<br />
“Thin” archives are now supported. Instead of containing object files, such archives contain just<br />
pathnames pointing to those files.<br />
A new command line option -F has been added to the objdump tool. This option can be used to<br />
include file offsets in the disassembly.<br />
A new command line option -c has been added to the readelf tool. This option can be used to<br />
allow string dumps of archive symbol index.<br />
The i386 port now supports the SSE5 instruction set.<br />
A new command line option -p has been added to the readelf tool. This option can be used to<br />
allow string dumps of sections.
88 Changes in Version 1.0<br />
A.3.3.2. Compatibility Changes<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.2<br />
No noteworthy changes that affect compatibility have been made.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.8<br />
The following changes have been made since the release of the binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 5.8:<br />
The --as-needed command line option has been adapted to link in a dynamic library in the<br />
following two cases:<br />
1. if the dynamic library satisfies undefined symbols in regular objects, and<br />
2. if the dynamic library satisfies undefined symbols in other dynamic libraries unless the library<br />
is already found in a DT_NEEDED entry of one of the libraries that are already linked.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 89<br />
Changes in Version 1.1<br />
This appendix documents new features and compatibility changes introduced in <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> 1.1. For a complete list of changes that were introduced in the previous version of the product,<br />
refer to Appendix A, Changes in Version 1.0.<br />
B.1. Changes in GCC 4.7.2<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 is distributed with GCC 4 .7.2, which provides a number of bug fixes and<br />
feature enhancements over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version. The main change in this<br />
version compared to <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 is that Fortran development is now supported.<br />
Additionally, support for Fortran 2003 and 2008 has been significantly improved relative to the GCC<br />
versions shipped with <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> (see details below).<br />
B.1.1. C++11 Compatibility<br />
An asynchronous erratum advisory, RHBA-2012-1127, that changed the ABI in C++11 mode, was<br />
previously published for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0. This change is included by default in <strong>Red</strong> <strong>Hat</strong><br />
<strong>Developer</strong> <strong>Toolset</strong> 1.1. Consequently, any C++11 code compiled with the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0<br />
version of GCC before applying the erratum might be incompatible with C++11 code compiled by the <strong>Red</strong><br />
<strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 version. There is no change in the C++11 ABI between <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />
<strong>Toolset</strong> 1.0 with erratum RHBA-2012-1127 applied and <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1.<br />
B.1.2. Fortran<br />
B.1.2.1. New Features<br />
A new compile flag -fstack-arrays has been added. This flag causes all local arrays to be put on<br />
stack memory, which can significantly improve the performance of some programs. Note that<br />
programs that use very large local arrays may require you to extend your runtime limits for stack<br />
memory.<br />
Compile time has been significantly improved. For example, the improvement may be noticeable when<br />
working with programs that use large array constructors.<br />
To improve code generation and diagnostics, the -fwhole-file compile flag is now enabled by<br />
default, and can be used with a newly supported -fwhole-program flag. To disable it, use the<br />
deprecated -fno-whole-file flag.<br />
A new command line option -M is now supported. Similarly to gcc, this option allows you to generate<br />
Makefile dependencies. Note that the -cpp option may be required as well.<br />
The -finit-real= command line option now supports snan as a valid value. This allows you to<br />
initialize REAL and COMPLEX variables with a signaling NaN (not a number), and requires you to<br />
enable trapping (for example, by using the -ffpe-trap= command line option). Note that compiletime<br />
optimizations may turn a signaling NaN into a quiet NaN.<br />
A new command line option -fcheck= has been added. This option accepts the following<br />
arguments:<br />
The -fcheck=bounds option is equivalent to the -fbounds-check command line option.<br />
The -fcheck=array-temps option is equivalent to the -fcheck-array-temporaries<br />
command line option.<br />
The -fcheck=do option checks for invalid modification of loop iteration variables.<br />
The -fcheck=recursive option checks for recursive calls to subroutines or functions that are<br />
not marked as recursive.<br />
The -fcheck=pointer option performs pointer association checks in calls, but does not<br />
handle undefined pointers nor pointers in expressions.
90 Changes in Version 1.1<br />
The -fcheck=all option enables all of the above options.<br />
A new command line option -fno-protect-parens has been added. This option allows the<br />
compiler to reorder REAL and COMPLEX expressions with no regard to parentheses.<br />
When OpenMP's WORKSHARE is used, array assignments and WHERE will now be run in parallel.<br />
More Fortran 2003 and Fortran 2008 mathematical functions can now be used as initialization<br />
expressions.<br />
The GCC$ compiler directive now enables support for some extended attributes such as STDCALL.<br />
B.1.2.2. Compatibility Changes<br />
The -Ofast command line option now automatically enables the -fno-protect-parens and -<br />
fstack-arrays flags.<br />
Front-end optimizations can now be disabled by the -fno-frontend-optimize option, and<br />
selected by the -ffrontend-optimize option. The former is essentially only desirable if invalid<br />
Fortran source code needs to be compiled (for example, when functions—as compared to<br />
subroutines—have side-effects) or to work around compiler bugs.<br />
The GFORTRAN_USE_STDERR environment variable has been removed, and GNU Fortran now<br />
always prints error messages to standard error.<br />
The -fdump-core command line option and the GFORTRAN_ERROR_DUMPCORE environment<br />
variable have been removed. When encountering a serious error, GNU Fortran now always aborts<br />
the execution of the program.<br />
The -fbacktrace command line option is now enabled by default. When a fatal error occurs, GNU<br />
Fortran now attempts to print a backtrace to standard error before aborting the execution of the<br />
program. To disable this behavior, use the -fno-backtrace option.<br />
GNU Fortran no longer supports the use of the -M command line option to generate Makefile<br />
dependencies for the module path. To perform this operation, use the -J option instead.<br />
To significantly reduce the number of warnings, the -Wconversion command line option now only<br />
displays warnings when a conversion leads to information loss, and a new command line option -<br />
Wconversion-extra has been added to display warnings about other conversions. The -<br />
Wconversion option is now enabled with -Wall.<br />
A new command line option -Wunused-dummy-argument has been added. This option can be<br />
used to display warnings about unused dummy arguments, and is now enabled with -Wall. Note<br />
that the -Wunused-variable option previously also warned about unused dummy arguments.<br />
The COMMON default padding has been changed. Previously, the padding was added before a<br />
variable. Now it is added after a variable to increase the compatibility with other vendors, as well as<br />
to help to obtain the correct output in some cases. Note that this behavior is in contrast with the<br />
behavior of the -falign-commons option.<br />
GNU Fortran no longer links against the libgfortranbegin library. The MAIN__ assembler<br />
symbol is the actual Fortran main program and is invoked by the main function, which is now<br />
generated and put in the same object file as MAIN__. Note that the libgfortranbegin library is<br />
still present for backward compatibility.<br />
B.1.2.3. Fortran 2003 Features<br />
Improved but still experimental support for polymorphism between libraries and programs and for<br />
complicated inheritance patterns.<br />
Generic interface names which have the same name as derived types are now supported, which<br />
allows the creation of constructor functions. Note that Fortran does not support static constructor<br />
functions; only default initialization or an explicit structure-constructor initialization are available.<br />
Automatic (re)allocation: In intrinsic assignments to allocatable variables, the left-hand side will be<br />
automatically allocated (if unallocated) or reallocated (if the shape or type parameter is different). To
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 91<br />
avoid the small performance penalty, you can use a(:) = ... instead of a = ... for arrays and<br />
character strings — or disable the feature using -std=f95 or -fno-realloc-lhs.<br />
Experimental support of the ASSOCIATE construct has been added.<br />
In pointer assignments it is now possible to specify the lower bounds of the pointer and, for a rank-1<br />
or a simply contiguous data-target, to remap the bounds.<br />
Deferred type parameter: For scalar allocatable and pointer variables the character length can now<br />
be deferred.<br />
Namelist variables with allocatable attribute, pointer attribute, and with a non-constant length type<br />
parameter are now supported.<br />
Support has been added for procedure-pointer function results and procedure-pointer components<br />
(including PASS).<br />
Support has been added for allocatable scalars (experimental), DEFERRED type-bound procedures,<br />
and the ERRMSG= argument of the ALLOCATE and DEALLOCATE statements.<br />
The ALLOCATE statement now supports type-specs and the SOURCE= argument.<br />
Rounding (ROUND=, RZ, ...) for output is now supported.<br />
The INT_FAST{8,16,32,64,128}_T format for ISO_C_BINDING intrinsic module type<br />
parameters is now supported.<br />
OPERATOR(*) and ASSIGNMENT(=) are now allowed as GENERIC type-bound procedures (i.e. as<br />
type-bound operators).<br />
B.1.2.4 . Fortran 2003 Compatibility<br />
Extensible derived types with type-bound procedure or procedure pointer with PASS attribute now have<br />
to use CLASS in line with the Fortran 2003 standard; the workaround to use TYPE is no longer<br />
supported.<br />
B.1.2.5. Fortran 2008 Features<br />
A new command line option -std=f2008ts has been added. This option enables support for<br />
programs that conform to the Fortran 2008 standard and the draft Technical Specification (TS)<br />
29113 on Further Interoperability of Fortran with C. For more information, refer to the Chart of Fortran<br />
TS 29113 Features supported by GNU Fortran.<br />
The DO CONCURRENT construct is now supported. This construct can be used to specify that<br />
individual loop iterations do not have any interdependencies.<br />
Full single-image support except for polymorphic coarrays has been added, and can be enabled by<br />
using the -fcoarray=single command line option. Additionally, GNU Fortran now provides<br />
preliminary support for multiple images via an MPI-based coarray communication library. Note that the<br />
library version is not yet usable as remote coarray access is not yet possible.<br />
The STOP and ERROR STOP statements have been updated to support all constant expressions.<br />
The CONTIGUOUS attribute is now supported.<br />
Use of ALLOCATE with the MOLD argument is now supported.<br />
The STORAGE_SIZE intrinsic inquiry function is now supported.<br />
The NORM2 and PARITY intrinsic functions are now supported.<br />
The following bit intrinsics have been added:<br />
the POPCNT and POPPAR bit intrinsics for counting the number of 1 bits and returning the parity;<br />
the BGE, BGT, BLE, and BLT bit intrinsics for bitwise comparisons;<br />
the DSHIFTL and DSHIFTR bit intrinsics for combined left and right shifts;<br />
the MASKL and MASKR bit intrinsics for simple left and right justified masks;<br />
the MERGE_BITS bit intrinsic for a bitwise merge using a mask;
92 Changes in Version 1.1<br />
the SHIFTA, SHIFTL, and SHIFTR bit intrinsics for shift operations;<br />
the transformational bit intrinsics IALL, IANY, and IPARITY.<br />
The EXECUTE_COMMAND_LINE intrinsic subroutine is now supported.<br />
The IMPURE attribute for procedures is now supported. This allows the use of ELEMENTAL<br />
procedures without the restrictions of PURE.<br />
Null pointers (including NULL()) and unallocated variables can now be used as an actual argument<br />
to optional non-pointer, non-allocatable dummy arguments, denoting an absent argument.<br />
Non-pointer variables with the TARGET attribute can now be used as an actual argument to<br />
POINTER dummies with INTENT(IN).<br />
Pointers that include procedure pointers and those in a derived type (pointer components) can now<br />
also be initialized by a target instead of only by NULL.<br />
The EXIT statement (with construct-name) can now be used to leave the ASSOCIATE, BLOCK, IF,<br />
SELECT CASE, and SELECT TYPE constructs in addition to DO.<br />
Internal procedures can now be used as actual arguments.<br />
The named constants INTEGER_KINDS, LOGICAL_KINDS, REAL_KINDS, and CHARACTER_KINDS<br />
of the intrinsic module ISO_FORTRAN_ENV have been added. These arrays contain the supported<br />
'kind' values for the respective types.<br />
The C_SIZEOF module procedures of the ISO_C_BINDINGS intrinsic module and the<br />
COMPILER_VERSION and COMPILER_OPTIONS module procedures of the ISO_FORTRAN_ENV<br />
intrinsic module have been implemented.<br />
The OPEN statement now supports the NEWUNIT= option. This option returns a unique file unit and<br />
therefore prevents inadvertent use of the same unit in different parts of the program.<br />
Unlimited format items are now supported.<br />
The INT{8,16,32} and REAL{32,64,128} format for ISO_FORTRAN_ENV intrinsic module type<br />
parameters are now supported.<br />
It is now possible to use complex arguments with the TAN, SINH, COSH, TANH, ASIN, ACOS, and<br />
ATAN functions. Additionally, the new functions ASINH, ACOSH, and ATANH have been added for real<br />
and complex arguments, and ATAN(Y,X) now serves as an alias for ATAN2(Y,X).<br />
The BLOCK construct has been implemented.<br />
B.1.2.6. Fortran 2008 Compatibility<br />
The implementation of the ASYNCHRONOUS attribute in GCC is now compatible with the candidate draft<br />
of TS 29113: Technical Specification on Further Interoperability with C.<br />
B.1.2.7. Fortran 77 Compatibility<br />
When the GNU Fortran compiler is issued with the -fno-sign-zero option, the SIGN intrinsic now<br />
behaves as if zero were always positive.<br />
B.1.3. Architecture-specific Options<br />
Vectors of type vector long long or vector long are passed and returned using the same<br />
method as other vectors with the VSX instruction set. Previously GCC did not adhere to the ABI for<br />
128-bit vectors with 64-bit integer base types (see GCC PR 48857).<br />
The -mrecip command line option has been added, which indicates whether the reciprocal and<br />
reciprocal square root instructions should be used.<br />
The -mveclibabi=mass command line option has been added. This can be used to enable the<br />
compiler to auto-vectorize mathematical functions using the Mathematical Acceleration Subsystem<br />
library.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 93<br />
The -msingle-pic-base command line option has been added, which instructs the compiler to<br />
avoid loading the PIC base register in function prologues. The PIC base register must be initialized<br />
by the runtime system.<br />
The -mblock-move-inline-limit command line option has been added, which enables the<br />
user to control the maximum size of inlined memcpy calls and similar.<br />
B.2. Changes in GDB 7.5<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 is distributed with GDB 7.5, which provides a number of bug fixes and<br />
feature enhancements over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system versions. Below is a comprehensive<br />
list of new features in this release. For details on how to use these new features, refer to the GDB<br />
documentation.<br />
The following features have been added since the release of the GNU Debugger versions included in<br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.3 and 5.9:<br />
The info os command has been changed and can now display information on several objects<br />
managed by the operating system, in particular:<br />
The info os procgroups command lists process groups.<br />
The info os files command lists file descriptors.<br />
The info os sockets command lists internet-domain sockets.<br />
The info os shm command lists shared-memory regions.<br />
The info os semaphores command lists semaphores.<br />
The info os msg command lists message queues.<br />
The info os modules command lists loaded kernel modules.<br />
GDB now has support for Static Defined Tracing (SDT) probes. Currently, the only implemented back<br />
end is for SystemTap probes (the sys/sdt.h header file). You can set a breakpoint by using the<br />
new -probe, -pstap, or -probe-stap options, and inspect the probe arguments by using the new<br />
$_probe_arg family of convenience variables.<br />
The symbol-reloading option has been deleted.<br />
gdbserver now supports STDIO connections, for example:<br />
(gdb) target remote | ssh myhost gdbserver - hello<br />
GDB is now able to print flag enums. In a flag enum, all enumerator values have no bits in common<br />
when pairwise AND-ed. When GDB prints a value whose type is a flag enum, GDB shows all the<br />
constants; for example, for enum E { ONE = 1, TWO = 2}:<br />
(gdb) print (enum E) 3<br />
$1 = (ONE | TWO)<br />
The file name part of a linespec now matches trailing components of a source file name. For example,<br />
break gcc/expr.c:1000 now sets a breakpoint in the build/gcc/expr.c file, but not in<br />
build/libcpp/expr.c.<br />
The info proc and generate-core-file commands now work on remote targets connected to<br />
gdbserver.<br />
The command info catch has been removed.<br />
The Ada-specific catch exception and catch assert commands now accept conditions at the<br />
end of the command.<br />
The info static-tracepoint-marker command now works on native targets with an inprocess<br />
agent.
94 Changes in Version 1.1<br />
GDB can now set breakpoints on inline functions.<br />
The .gdb_index section has been updated to include symbols for inline functions. By default, GDB<br />
now ignores older .gdb_index sections until their .gdb_index sections can be recreated. The<br />
new command set use-deprecated-index-sections on causes GDB to use any older<br />
.gdb_index sections it finds. If this option is set, the ability to set breakpoints on inline functions is<br />
lost in symbol files with older .gdb_index sections.<br />
The .gdb_index section has also been updated to record more information about each symbol.<br />
GDB now provides Ada support for GDB/MI Variable Objects.<br />
GDB now supports breakpoint always-inserted mode in the record target.<br />
gdbserver now supports evaluation of breakpoint conditions. Note that you can instruct GDB to<br />
send the breakpoint conditions in bytecode form, but gdbserver only reports the breakpoint trigger<br />
to GDB when its condition evaluates to true.<br />
The z0/z1 breakpoint insertion packets have been extended to carry a list of conditional<br />
expressions over to the remote stub depending on the condition evaluation mode. You can use the<br />
set remote conditional-breakpoints-packet command to control the use of this<br />
extension.<br />
A new RSP packet QProgramSignals can be used to specify the signals the remote stub can<br />
pass to the debugged program without GDB involvement.<br />
A new command -info-os has been added as the MI equivalent of info os.<br />
Output logs, such as set logging and related, now include MI output.<br />
New set use-deprecated-index-sections on|off and show use-deprecated-indexsections<br />
on|off commands have been added. These commands allow you to control the use of<br />
deprecated .gdb_index sections.<br />
New catch load and catch unload commands have been added. These commands allow you<br />
to stop execution of a debugged program when a shared library is loaded or unloaded.<br />
A new command enable count has been added. This command allows you to auto-disable a<br />
breakpoint after several hits.<br />
A new command info vtbl has been added. This command allows you to show the virtual method<br />
tables for C++ and Java objects.<br />
A new command explore has been added. It supports two subcommands explore value and<br />
explore type, and allows you to recursively explore values and types of expressions. Note that<br />
this command is only available with Python-enabled GDB.<br />
A new command dprintf location,format,args... has been added. This command allows you<br />
to create a dynamic printf-type breakpoint, which performs a printf-like operation and then<br />
resumes program execution.<br />
New set print symbol and show print symbol commands have been added. These<br />
commands allow you to control whether GDB attempts to display the symbol, if any, that corresponds<br />
to addresses it prints. This functionality is enabled by default, but you can restore the previous<br />
behavior by running the set print symbol off command.<br />
New set breakpoint condition-evaluation and show breakpoint conditionevaluation<br />
commands have been added. These commands allow you to control whether<br />
breakpoint conditions are evaluated by GDB (the host option), or by gdbserver (the target<br />
option). The default option, auto, chooses the most efficient available mode.<br />
New set dprintf-style gdb|call|agent and show dprintf-style commands have been<br />
added. These commands allow you to control the way in which a dynamic printf is performed: the<br />
gdb option requests a GDB printf command, call causes dprintf to call a function in the<br />
inferior, and agent requests that the target agent such as gdbserver does the printing.<br />
New set dprintf-function expression, show dprintf-function, set dprintfchannel<br />
expression, and show dprintf-channel commands have been added. These
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 95<br />
commands allow you to set the function and optional first argument to the call when using the call<br />
style of dynamic printf.<br />
New set disconnected-dprintf on|off and show disconnected-dprintf commands<br />
have been added. These commands allow you to control whether agent-style dynamic printfs<br />
continue to be in effect after GDB disconnects.<br />
The following changes have been made to the Python scripting support since the release of the GNU<br />
Debugger included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.3 and 5.9:<br />
GDB commands implemented in Python can now be put in the gdb.COMMAND_USER command class.<br />
The maint set python print-stack on|off command has been removed and replaced by<br />
set python print-stack.<br />
A new class gdb.printing.FlagEnumerationPrinter has been added. This class can be<br />
used to apply flag enum-style pretty-printing to enums.<br />
The gdb.lookup_symbol function now works correctly when there is no current frame.<br />
The gdb.Symbol object now has an additional attribute line. This attribute holds the line number<br />
in the source at which the symbol was defined.<br />
The gdb.Symbol object now has an additional attribute needs_frame, and a new method value.<br />
The needs_frame attribute indicates whether the symbol requires a frame to compute its value,<br />
and the value method computes the symbol's value.<br />
The gdb.Value object now has a new method referenced_value. This method can be used to<br />
dereference a pointer as well as C++ reference values.<br />
The gdb.Symtab object now has two new methods, global_block and static_block. These<br />
methods return the global and static blocks (as gdb.Block objects) of the underlying symbol table<br />
respectively.<br />
A new method gdb.find_pc_line returns the gdb.Symtab_and_line object associated with a<br />
PC value.<br />
The gdb.Symtab_and_line object now has an additional attribute last. This attribute holds the<br />
end of the address range occupied by the code for the current source line.<br />
B.3. Changes in binutils 2.23.51<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 is distributed with binutils 2.23.51, which provides a number of bug<br />
fixes and feature enhancements over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version. Below is a<br />
comprehensive list of new features in this release.<br />
B.3.1. GNU Linker<br />
The following features have been added since the release of binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6.3 and 5.9:<br />
A new SORT_NONE keyword has been added to the linker script language. This keyword can be<br />
used to disable section sorting.<br />
A new linker-provided symbol, __ehdr_start, has been added. When producing ELF output, this<br />
symbol points to the ELF file header (and nearby program headers) in the program's memory image.<br />
B.3.2. GNU Assembler<br />
The following features have been added since the release of binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6.3 and 5.9:<br />
Support for .bundle_align_mode, .bundle_lock, and .bundle_unlock directives for x86
96 Changes in Version 1.1<br />
targets has been added..<br />
On x86 architectures, the GNU Assembler now allows rep bsf, rep bsr, and rep ret syntax.<br />
B.3.3. Other Binary Tools<br />
The following features have been added since the release of binutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6.3 and 5.9:<br />
Support for dwz -m optimized debug information has been added.<br />
The devtoolset-1.1-binutils-devel package now provides the demangle.h header file.<br />
B.4. Changes in elfutils 0.154<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 is distributed with elfutils 0.154 , which provides a number of bug fixes<br />
and feature enhancements over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version. Below is a comprehensive<br />
list of new features in this release.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.3<br />
The following features have been added since the release of elfutils included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6.3:<br />
libdw now handles compressed debuginfo sections. The dwarf_highpc function now handles<br />
the DWARF 4 DW_AT_high_pc constant form.<br />
eu-elflint now accepts executables produced by the gold linker (see Section A.3, “Changes in<br />
binutils 2.22.52”).<br />
eu-nm now supports C++ demangling.<br />
eu-ar now supports a new modifier D for deterministic output with no UID, GID, or mtime info. The U<br />
modifier is the inverse.<br />
eu-readelf can now print SDT ELF notes (SystemTap probes) and the .gdb_index GDB<br />
section. It can also now print DW_OP_GNU_entry_value and DW_AT_GNU_call_site families of<br />
DIE attributes.<br />
eu-strip now recognizes a new command line option, --reloc-debug-sections.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.9<br />
In addition to the above changes, the following features have been added since the release of elfutils<br />
included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.9:<br />
DWARF 4 is now supported. Support for DW_OP_GNU_implicit_pointer, STB_GNU_UNIQUE<br />
was added.<br />
libdwfl now supports automatic decompression of files compressed with gzip, bzip2 and lzma,<br />
and of <strong>Linux</strong> kernel images made with gzip, bzip2 or lzma. Files named with compression suffixes<br />
are searched for <strong>Linux</strong> kernel images. Core file support was improved. Support has been added for<br />
decoding DWARF CFI into location description form. Support has been added for some new DWARF<br />
3 expression operations, which were previously omitted. A new function, dwfl_dwarf_line, has<br />
been added.<br />
eu-elfcmp has a new flag --ignore-build-id to ignore differing build ID bits. The new flag -<br />
l/--verbose prints all differences.<br />
eu-strip now recognizes a new flag --strip-sections to remove section headers entirely.<br />
libdw has new functions dwarf_next_unit, dwarf_offdie_types, dwarf_lineisa,<br />
dwarf_linediscriminator, dwarf_lineop_index,
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 97<br />
dwarf_getlocation_implicit_pointer, and dwarf_aggregate_size.<br />
eu-addr2line recognizes -F/--flags to print more DWARF line information details.<br />
libelf now supports using more than 65536 program headers in a file. A new function<br />
elf_getphdrnum has been added.<br />
eu-addr2line now accepts the -j/--section=name option in the interests of binutils<br />
compatibility.<br />
libcpu Intel SSE4 disassembler support has been added.<br />
eu-readelf now implements call frame information and exception handling dumping. The -e<br />
command line option has been added; this is enabled implicitly by -a.<br />
B.5. Changes in Valgrind 3.8.1<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 is distributed with Valgrind 3.8.1, which provides a number of bug fixes<br />
and feature enhancements over the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system version. Below is a comprehensive<br />
list of new features in this release.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.3<br />
The following features have been added since the release of Valgrind included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 6.3:<br />
Support for Intel Advanced Vector Extensions (AVX) and Advanced Encryption Standard<br />
(AES) instruction sets has been added. Note that this support is only available for 64-bit code.<br />
A new command line option --soname-synonyms has been added. This option can be used to<br />
inform Memcheck, Massif, Helgrind, and DRD (that is, the tools that replace the malloc function)<br />
that the implementation of malloc is either linked statically into the executable, or is provided by a<br />
shared library other than libc.so. As a result, users can now process both statically linked<br />
programs and programs that use other malloc libraries, such as TCMalloc or JEMalloc. This option<br />
is, however, very general and does not necessarily apply only to malloc-family functions.<br />
A new command line option --redzone-size=number has been added to tools that provide their<br />
own replacement for malloc and other functions. This option allows you to specify the size of the<br />
padding blocks (also known as redzones) that are added before and after each client allocated block.<br />
Smaller values reduce the amount of memory required by Valgrind; bigger numbers increase the<br />
chance to detect blocks that are overrun or underrun.<br />
The leak_check GDB server monitor command now can now be used to control the maximum<br />
number of loss records that Memcheck outputs.<br />
Memcheck now uses less memory when working with applications that allocate a large number of<br />
blocks or that have many partially-defined bytes.<br />
A new GDB server monitor command block_list has been added. This allows Memcheck to list<br />
the addresses and sizes of the blocks of a leak search loss record.<br />
A new GDB server monitor command who_points_at has been added. This allows Memcheck to<br />
list the locations that are pointing at a block.<br />
When the Memcheck tool is executed with a redzone size greater than 0,<br />
VALGRIND_MALLOCLIKE_BLOCK detects an invalid access of these redzones by marking them<br />
noaccess. Similarly, if a redzone size is given for a memory pool, VALGRIND_MEMPOOL_ALLOC<br />
marks the redzones noaccess. Note that this functionality still allows you to find some bugs if the<br />
you have forgotten to mark the pool superblock noaccess.<br />
The performance of Memcheck's memory leak check has been improved. The improvement is<br />
especially significant in cases where there are many leaked blocks or many suppression rules used<br />
to suppress leak reports.<br />
More facilities that can help finding the cause of a data race have been added to DRD, namely the --
98 Changes in Version 1.1<br />
ptrace-addr command line option and the DRD_STOP_TRACING_VAR(x) macro.<br />
The C++ demangler has been updated to support C++ programs compiled by g++ up to at least<br />
version 4.6.<br />
A new command line option --fair-sched=yes has been added. This option allows you to select<br />
round-robin scheduling of threads, improves responsiveness of interactive multithreaded<br />
applications, and improves repeatability of results from the thread checkers Helgrind and DRD. The<br />
pipe-based thread serialization mechanism is selected by default.<br />
Support for running Valgrind on Valgrind has been improved. Tool developers can now use Valgrind<br />
on Helgrind or Memcheck.<br />
gdbserver has been adapted to display the float shadow registers as integer rather than float<br />
values, as the shadow values are mostly used as bit patterns.<br />
The maximum limit for the --num-callers command line option has been increased to 500.<br />
The performance of error matching when there are many suppression records in use has been<br />
improved.<br />
Support for DWARF4 debugging information has been improved.<br />
Support for DWARF debug information compressed with dwz has been added.<br />
Control over the IR optimizer's handling of the tradeoff between performance and precision of<br />
exceptions has been improved. In particular, the --vex-iropt-precise-memory-exns command<br />
line option has been replaced by --vex-iropt-register-updates, which provides extended<br />
functionality and allows the Valgrind gdbserver to always show up-to-date register values to GDB.<br />
Modest performance gains have been achieved by the use of translation chaining for JIT-generated<br />
code.<br />
The memory consumption of the Memcheck tool has been reduced in some scenarios.<br />
Handling of freed memory in the Memcheck tool has been improved, which allows the tool to detect<br />
use-after-free that would previously have been missed.<br />
The performance of the Helgrind tool has been improved. As well, the tool now consumes less<br />
memory, especially when working with large, long running applications that perform many<br />
synchronization events such as lock, unlock, and similar.<br />
Helgrind now displays locksets for both threads involved in a race.<br />
Helgrind now displays error messages that are better formatted and generally easier to understand.<br />
Helgrind now provides facilities and documentation regarding annotation of thread-safe referencecounted<br />
C++ classes.<br />
A new command line option --check-stack-refs=no|yes has been added to Helgrind. This<br />
option allows you to disable race checking on thread stacks. The option is set to yes by default.<br />
A new command line option --free-is-write=no|yes has been added to Helgrind. This option<br />
allows you to enable detection of races where one thread accesses heap memory, but another one<br />
frees it without any coordinating synchronization event. The option is set to no by default.<br />
DRD can now produce XML output.<br />
Support for delayed thread deletion has been added to DRD to detect race conditions that occur<br />
close to the end of a thread (the --join-list-vol option).<br />
The exp-ptrcheck tool has been renamed to exp-sgcheck (Stack and global Array Checking).<br />
The exp-sgcheck tool has been reduced in scope to improve performance and remove checking<br />
that Memcheck does better. In particular, the ability to check for overruns for stack and global arrays<br />
is unchanged, but the ability to check for overruns of heap blocks has been removed.<br />
Valgrind now provides an embedded GDB server, which allows you to control a Valgrind run from<br />
GDB and perform GDB operations such as single stepping, breakpoints, examining data, and so on.<br />
Tool-specific functionality is also available, and it is now possible to query the definedness state of<br />
variables or memory from within GDB when running Memcheck, add arbitrarily large memory<br />
watchpoints, etc. To use the GDB server, start Valgrind with the --vgdb-error=0 command line<br />
option and follow the on-screen instructions.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 99<br />
Support for unfriendly self-modifying code has been improved. A new command line option --smccheck=all-non-file<br />
has been added to add the relevant consistency checks only to code that<br />
originates in non-file-backed mappings. In effect, this confines the consistency checking only to code<br />
that is or might be JIT-generated, and avoids checks on code that must have been compiled ahead<br />
of time. Consequently, this functionality significantly improves the performance of applications that<br />
generate code at run time.<br />
New client requests VALGRIND_DISABLE_ERROR_REPORTING and<br />
VALGRIND_ENABLE_ERROR_REPORTING have been added. These requests enable and disable<br />
error reporting on a per-thread and nestable basis, which is useful for hiding errors in particularly<br />
troublesome pieces of code. The MPI wrapper library, libmpiwrap.c, now uses this facility.<br />
The --mod-funcname command line option has been added to cg_diff.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.9<br />
In addition to the above changes, the following features have been added since the release of Valgrind<br />
included in <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.9:<br />
When running in 64-bit mode, Valgrind now supports the SSE4.2 instruction set with the exception of<br />
SSE4.2 AES instructions. In 32-bit mode, Valgrind only provides support up to and including the<br />
SSSE3 instruction set.<br />
A new processing script cg_diff has been added to Cachegrind. This processing script can find<br />
the difference between two profiles, and can therefore be used to evaluate the performance effects<br />
of a change in a program.<br />
The behavior of the cg_annotate's rarely-used --threshold option has been changed.<br />
Callgrind now supports branch prediction simulation and can optionally count the number of<br />
executed global bus events. Note that in order to use this functionality for a better approximation of a<br />
“Cycle Estimation” as a derived event, you must manually update the event formula in KCachegrind.<br />
To accommodate machines with three levels of caches, both Cachegrind and Callgrind now refer<br />
to the LL (last-level) cache rather than the L2 cache. When Cachegrind or Callgrind auto-detects<br />
the cache configuration of such a machine, it now runs the simulation as if the L2 cache is not<br />
present. Consequently, the results are less likely to match the true result for the machine and should<br />
not be considered authoritative, but provide a general idea about a program's locality.<br />
A new command line option --pages-as-heap has been added to Massif. When this option is<br />
enabled, Massif tracks memory allocations at the level of memory pages (as mapped by mmap, brk<br />
and similar functions) instead of tracking allocations at the level of heap blocks (as allocated with<br />
malloc, new, or new[]). Each mapped page is treated as its own block. Interpreting the page-level<br />
output is harder than the heap-level output, but allows you to account for every byte of memory used<br />
by a program. By default, the --pages-as-heap option is disabled.<br />
New command line options --free-is-write and --trace-alloc have been added to DRD.<br />
The --free-is-write option allows you to detect reading from already freed memory, the --<br />
trace-alloc can be used to trace of all memory allocations and deallocations.<br />
A number of new allocations have been added to DRD. As well, you can now annotate custom barrier<br />
implementations and benign races on static variables.<br />
DRD's happens before and happens after annotations have been enhanced and can be used to<br />
annotate, for example, a smart pointer implementation.<br />
Helgrind's annotation set has been significantly improved to provide a general set of annotations to<br />
describe locks, semaphores, barriers, and condition variables. In addition, Helgrind now supports<br />
annotations to describe thread-safe reference counted heap objects.<br />
A new command line option --show-possibly-lost has been added to Memcheck. By default<br />
this option is enabled and causes the leak detector to show possibly-lost blocks.<br />
A new experimental heap profiler, DHAT (Dynamic Heap Analysis Tool), has been added. DHAT<br />
keeps track of allocated heap blocks, and also inspects every memory reference to see which block
100 Changes in Version 1.1<br />
(if any) is being accessed. This gives a lot of insight into block lifetimes, utilization, turnover, liveness,<br />
and the location of hot and cold fields. You can use DHAT to do hot-field profiling.<br />
Support for unfriendly self-modifying code has been improved, and the extra overhead incurred by --<br />
smc-check=all has been reduced by approximately a factor of 5 as compared with the previous<br />
version of Valgrind.<br />
A new command line option --fullpath-after has been added. This option can be used to<br />
display directory names for source files in error messages, and is combined with a flexible<br />
mechanism for specifying which parts of the paths should be shown.<br />
A new command line option --require-text-symbol has been added. This option stops the<br />
execution if a specified symbol is not found in a given shared object when loaded into the process.<br />
As a result, working with function intercepting and wrapping is now safer and more reliable.<br />
Valgrind now implements more reliable stack unwinding on amd64-linux, particularly in the presence<br />
of function wrappers, and with gcc-4.5 compiled code.<br />
Valgrind now implements modest scalability (performance improvements) for very large, long-running<br />
applications.<br />
Valgrind now provides improved support for analyzing programs that are running in Wine. <strong>User</strong>s can<br />
now include the valgrind/valgrind.h, valgrind/memcheck.h, and valgrind/drd.h<br />
header files in Windows programs that are compiled with MinGW or one of the Microsoft Visual<br />
Studio compilers.<br />
B.6. Changes in OProfile 0.154<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 is distributed with OProfile 0.9.7. Below is a comprehensive list of new<br />
features in this release.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6.3<br />
No noteworthy changes have been made.<br />
Changes Since <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 5.9<br />
The following features have been added since the release of OProfile included in <strong>Red</strong> <strong>Hat</strong> Enterprise<br />
<strong>Linux</strong> 5.9:<br />
Support has been added for AMD family11h, family12h, family14h, and AMD family15h processors.<br />
Generation of XML output has been corrected.<br />
Handling of the --session-dir command line option has been improved and a possible buffer<br />
overflow in the XML generator has been fixed.
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 101<br />
Revision History<br />
Revision 1.1-0 Tue Jan 22 2013 Jaromír Hradílek<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 release of the <strong>User</strong> <strong>Guide</strong>.<br />
Revision 1.0-2 Fri Nov 09 2012 Jaromír Hradílek<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 Beta-2 release of the <strong>User</strong> <strong>Guide</strong>.<br />
Revision 1.0-1 Wed Oct 10 2012 Jaromír Hradílek<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.1 Beta-1 release of the <strong>User</strong> <strong>Guide</strong>.<br />
Revision 1.0-0 Tue Jun 26 2012 Jaromír Hradílek<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 release of the <strong>User</strong> <strong>Guide</strong>.<br />
Revision 0.0-2 Tue May 22 2012 Jaromír Hradílek<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 Beta-2 release of the <strong>User</strong> <strong>Guide</strong>.<br />
Revision 0.0-1 Tue May 1 2012 Jaromír Hradílek<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> 1.0 Beta-1 release of the <strong>User</strong> <strong>Guide</strong>.<br />
Revision 0.0-0 Mon Apr 23 2012 Jaromír Hradílek<br />
Initial creation of the book by Publican.<br />
Index<br />
A<br />
ABI<br />
- compatibility, ABI Compatibility<br />
addr2line<br />
- features, New Features<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
application binary interface (see ABI)<br />
ar<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
as (see GNU assembler)<br />
assembling (see GNU assembler)<br />
B<br />
bfd<br />
- features, New Features<br />
binutils, binutils
102 Revision History<br />
- compatibility, Changes in binutils 2.22.52<br />
- documentation, Additional Resources<br />
- features, Main Features, Changes in binutils 2.22.52<br />
- installation, Installing binutils<br />
- overview, binutils<br />
- usage, Using the GNU Assembler, Using the GNU Linker, Using Other Binary Tools<br />
- version, Main Features, binutils, Changes in binutils 2.22.52, Changes in binutils 2.23.51<br />
C<br />
C programming language<br />
- compiling, Using the C Compiler, Preparing a Program for Debugging<br />
- running, Running a C Program<br />
- support, GNU C Compiler<br />
C++ programming language<br />
- compiling, Using the C++ Compiler, Preparing a Program for Debugging<br />
- running, Running a C++ Program<br />
- support, GNU C++ Compiler<br />
C++11 (see GNU Compiler Collection)<br />
c++filt<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
C11 (see GNU Compiler Collection)<br />
Cachegrind<br />
- overview, Valgrind<br />
- usage, Using Valgrind<br />
Callgrind<br />
- overview, Valgrind<br />
- usage, Using Valgrind<br />
compatibility<br />
- GNU Compiler Collection, Language Compatibility, ABI Compatibility, Debugging<br />
Compatibility, Other Compatibility, C++11 Compatibility, Compatibility Changes, Fortran<br />
2003 Compatibility, Fortran 2008 Compatibility, Fortran 77 Compatibility<br />
- GNU Debugger, Compatibility Changes<br />
- <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, Compatibility<br />
compiling (see GNU Compiler Collection)<br />
Customer Portal, Accessing the Customer Portal<br />
- Connect menu, The Connect Menu<br />
- Deploy menu, The Deploy Menu<br />
- overview, Accessing the Customer Portal<br />
- Plain menu, The Plan Menu
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 103<br />
D<br />
debugging (see GNU Debugger)<br />
<strong>Developer</strong> <strong>Toolset</strong> (see <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>)<br />
documentation<br />
- <strong>Red</strong> <strong>Hat</strong> Product Documentation, Accessing <strong>Red</strong> <strong>Hat</strong> Product Documentation<br />
DRD<br />
- overview, Valgrind<br />
- usage, Using Valgrind<br />
dwz, dwz<br />
- documentation, Additional Resources<br />
- installation, Installing dwz<br />
- overview, dwz<br />
- usage, Using dwz<br />
- version, Main Features, dwz<br />
E<br />
Eclipse, Eclipse<br />
- configuration, Running Eclipse<br />
- documentation, Additional Resources<br />
- installation, Installing Eclipse<br />
- overview, Eclipse<br />
- usage, Running Eclipse<br />
elfedit<br />
- features, New Features<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
elfutils, elfutils<br />
- documentation, Additional Resources<br />
- installation, Installing elfutils<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
- version, Main Features, elfutils, Changes in elfutils 0.154<br />
eu-addr2line<br />
- features, Changes in elfutils 0.154<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-ar<br />
- features, Changes in elfutils 0.154<br />
- overview, elfutils
104 Revision History<br />
- usage, Using elfutils<br />
eu-elfcmp<br />
- features, Changes in elfutils 0.154<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-elflint<br />
- features, Changes in elfutils 0.154<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-findtextrel<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-make-debug-archive<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-nm<br />
- features, Changes in elfutils 0.154<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-objdump<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-ranlib<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-readelf<br />
- features, Changes in elfutils 0.154<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-size<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-strings<br />
- overview, elfutils<br />
- usage, Using elfutils
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 105<br />
eu-strip<br />
- features, Changes in elfutils 0.154<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
eu-unstrip<br />
- overview, elfutils<br />
- usage, Using elfutils<br />
F<br />
feedback<br />
- contact information for this manual, We Need Feedback!<br />
Fortran programming language<br />
- compiling, Using the Fortran Compiler<br />
- running, Running a Fortran Program<br />
- support, GNU Fortran Compiler<br />
G<br />
g++ (see GNU Compiler Collection)<br />
GAS (see GNU assembler)<br />
GCC (see GNU Compiler Collection)<br />
gcc (see GNU Compiler Collection)<br />
GDB (see GNU Debugger)<br />
gfortran (see GNU Compiler Collection)<br />
Global Support Services<br />
- contacting, Contacting Global Support Services<br />
GNU assembler, Using the GNU Assembler<br />
- compatibility, Compatibility Changes<br />
- documentation, Additional Resources<br />
- features, New Features, GNU Assembler<br />
- installation, Installing binutils<br />
- overview, binutils<br />
- usage, Using the GNU Assembler<br />
GNU Binutils (see binutils)<br />
GNU Compiler Collection, GNU Compiler Collection (GCC)<br />
- C support, GNU C Compiler<br />
- C++ support, GNU C++ Compiler<br />
- compatibility, Language Compatibility, ABI Compatibility, Debugging Compatibility, Other<br />
Compatibility, C++11 Compatibility, Compatibility Changes, Fortran 2003 Compatibility,<br />
Fortran 2008 Compatibility, Fortran 77 Compatibility<br />
- documentation, Additional Resources
106 Revision History<br />
- features, Main Features, Status and Features, New Features, Fortran 2003 Features,<br />
Fortran 2008 Features<br />
- Fortran support, GNU Fortran Compiler<br />
- installation, Installing the C Compiler, Installing the C++ Compiler, Installing the Fortran<br />
Compiler<br />
- overview, GNU Compiler Collection (GCC)<br />
- usage, Using the C Compiler, Using the C++ Compiler, Using the Fortran Compiler,<br />
Preparing a Program for Debugging<br />
- version, Main Features, GNU Compiler Collection (GCC), Changes in GCC 4.7.0, Changes<br />
in GCC 4.7.2<br />
GNU Debugger, GNU Debugger (GDB)<br />
- compatibility, Compatibility Changes<br />
- documentation, Additional Resources<br />
- features, Main Features, New Features<br />
- installation, Installing the GNU Debugger<br />
- overview, GNU Debugger (GDB)<br />
- preparation, Preparing a Program for Debugging<br />
- usage, Running the GNU Debugger, Listing Source Code, Setting Breakpoints, Starting<br />
Execution, Displaying Current Values, Continuing Execution<br />
- version, Main Features, GNU Debugger (GDB), Changes in GDB 7.4, Changes in GDB 7.5<br />
GNU linker, Using the GNU Linker<br />
- compatibility, Compatibility Changes<br />
- documentation, Additional Resources<br />
- features, New Features, GNU Linker<br />
- installation, Installing binutils<br />
- overview, binutils<br />
- usage, Using the GNU Linker<br />
gold (see GNU linker)<br />
gprof<br />
- features, New Features<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
GSS (see Global Support Services)<br />
H<br />
Helgrind<br />
- overview, Valgrind<br />
- usage, Using Valgrind<br />
help<br />
- accessing the Customer Portal, Accessing the Customer Portal<br />
- getting help, Do You Need Help?<br />
- Global Support Services, Contacting Global Support Services<br />
- <strong>Red</strong> <strong>Hat</strong> Product Documentation, Accessing <strong>Red</strong> <strong>Hat</strong> Product Documentation
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 107<br />
L<br />
ld (see GNU linker)<br />
linking (see GNU linker)<br />
M<br />
Massif<br />
- overview, Valgrind<br />
- usage, Using Valgrind<br />
Memcheck<br />
- overview, Valgrind<br />
- usage, Using Valgrind<br />
N<br />
nm<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
O<br />
objcopy<br />
- features, New Features<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
objdump<br />
- features, New Features<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
opannotate<br />
- overview, OProfile<br />
- usage, Using OProfile<br />
oparchive<br />
- overview, OProfile<br />
- usage, Using OProfile<br />
opcontrol<br />
- overview, OProfile<br />
- usage, Using OProfile<br />
opgprof<br />
- overview, OProfile<br />
- usage, Using OProfile
108 Revision History<br />
ophelp<br />
- overview, OProfile<br />
- usage, Using OProfile<br />
opimport<br />
- overview, OProfile<br />
- usage, Using OProfile<br />
opjitconv<br />
- overview, OProfile<br />
- usage, Using OProfile<br />
opreport<br />
- overview, OProfile<br />
- usage, Using OProfile<br />
OProfile, OProfile<br />
- documentation, Additional Resources<br />
- installation, Installing OProfile<br />
- overview, OProfile, Changes in OProfile 0.154<br />
- usage, Using OProfile<br />
- version, Main Features, OProfile<br />
oprofiled<br />
- overview, OProfile<br />
- usage, Using OProfile<br />
R<br />
ranlib<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
readelf<br />
- features, New Features<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
<strong>Red</strong> <strong>Hat</strong> Customer Portal (see Customer Portal)<br />
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
- compatibility, Compatibility<br />
- documentation, Additional Resources, Accessing <strong>Red</strong> <strong>Hat</strong> Product Documentation<br />
- features, Main Features<br />
- installation, Installing <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
- overview, About <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
- subscription, Getting Access to <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>
<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> <strong>1.x</strong> <strong>User</strong> <strong>Guide</strong> 109<br />
- support, About <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
- uninstallation, Uninstalling <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
- update, Updating <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
<strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong><br />
- documentation, Additional Resources, Accessing <strong>Red</strong> <strong>Hat</strong> Product Documentation<br />
- supported versions, Compatibility<br />
<strong>Red</strong> <strong>Hat</strong> Subscription Management<br />
- subscription, Using <strong>Red</strong> <strong>Hat</strong> Subscription Management<br />
RHN Classic<br />
- subscription, Using RHN Classic<br />
S<br />
scl (see Software Collections)<br />
size<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
Software Collections<br />
- documentation, Additional Resources, Accessing <strong>Red</strong> <strong>Hat</strong> Product Documentation<br />
- overview, About <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
stap<br />
- overview, SystemTap<br />
- usage, Using SystemTap<br />
stap-merge<br />
- overview, SystemTap<br />
- usage, Using SystemTap<br />
stap-prep<br />
- overview, SystemTap<br />
- usage, Installing SystemTap<br />
stap-report<br />
- overview, SystemTap<br />
- usage, Using SystemTap<br />
staprun<br />
- overview, SystemTap<br />
- usage, Using SystemTap
110 Revision History<br />
stapsh<br />
- overview, SystemTap<br />
- usage, Using SystemTap<br />
strings<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
strip<br />
- overview, binutils<br />
- usage, Using Other Binary Tools<br />
support<br />
- <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>, About <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong><br />
SystemTap, SystemTap<br />
- documentation, Additional Resources<br />
- installation, Installing SystemTap<br />
- overview, SystemTap<br />
- usage, Using SystemTap<br />
- version, Main Features, SystemTap<br />
V<br />
Valgrind, Valgrind<br />
- documentation, Additional Resources<br />
- installation, Installing Valgrind<br />
- overview, Valgrind<br />
- usage, Using Valgrind<br />
- version, Main Features, Valgrind