Red Hat Training

A Red Hat training course is available for Red Hat Developer Toolset

Chapter 2. Red Hat Developer Toolset 4.0 Release

This chapter serves as an overview of Red Hat Developer Toolset 4.0. It sums up its main features and changes, and provides a list of known issues.

2.1. Changes in Red Hat Developer Toolset 4.0

2.1.1. Upgraded Components

All components in Red Hat Developer Toolset 4.0 are shipped as new packages with the devtoolset-4- prefix. The following components have been upgraded in Red Hat Developer Toolset 4.0 compared to the previous release of Red Hat Developer Toolset:
  • Eclipse to version 4.5.0
  • GCC to version 5.2.1
  • binutils to version 2.25
  • elfutils to version 0.163
  • dwz to version 0.12
  • GDB to version 7.10
  • strace to version 4.10
  • SystemTap to version 2.8
  • OProfile to version 1.1.0
For detailed information on changes in Red Hat Developer Toolset 4.0, see Red Hat Developer Toolset User Guide.

2.1.2. Bug Fix and Enhancement Updates

The Red Hat Developer Toolset 4.0 release also includes a bug fix update of Valgrind.

2.1.3. Container Image

Red Hat Developer Toolset 4.0 introduces a pre-built docker-formatted container image, which contains selected toolchain components.
The rhscl/devtoolset-4-toolchain-rhel7 image is available from the Red Hat Container Registry and contains the following Red Hat Developer Toolset components:
  • devtoolset-4-gcc
  • devtoolset-4-gcc-c++
  • devtoolset-4-gcc-fortran
  • devtoolset-4-gdb
For details on how to obtain the image and how to run Red Hat Developer Toolset components using this image, see Red Hat Developer Toolset User Guide.

2.1.4. Dockerfiles

This update introduces the devtoolset-4-dockerfiles subpackage for Red Hat Enterprise Linux 7. This package contains Dockerfiles for selected Red Hat Developer Toolset components, including their Red Hat Enterprise Linux 6 versions, which can be deployed only on Red Hat Enterprise Linux 7 Server. Dockerfiles are text documents that contain instructions for automated building of docker-formatted container images. The resulting container images can be used to run Red Hat Developer Toolset components inside virtual software containers, thus isolating them from the host system and allowing for their rapid deployment. Red Hat Developer Toolset 4.0 includes the following Dockerfiles:
  • devtoolset-4-dyninst
  • devtoolset-4-elfutils
  • devtoolset-4-oprofile
  • devtoolset-4-systemtap (available only for Red Hat Enterprise Linux 7)
  • devtoolset-4-toolchain
  • devtoolset-4-valgrind

2.2. Features

2.2.1. List of Components

Red Hat Developer Toolset 4.0 provides the following components:

Integrated Development Environments

  • Eclipse

Development Tools

  • GNU Compiler Collection (GCC)
  • binutils
  • elfutils
  • dwz

Debugging Tools

  • GNU Debugger (GDB)
  • strace
  • ltrace
  • memstomp

Performance Monitoring Tools

  • SystemTap
  • Valgrind
  • OProfile
  • Dyninst
For details, see the Red Hat Developer Toolset Components table in the Red Hat Developer Toolset User Guide.

2.2.2. Main Features

The Red Hat Developer Toolset version of the GNU Compiler Collection (GCC) has been upgraded to version 5.2.1, which is a change to a new major version of GCC. This brings a number of new features, improved support for various standards, and many bug fixes:
  • Improvements in inter-procedural optimization, link-time optimization, and register allocation.
  • OpenMP 4.0 specification offloading features are now supported by the C and C++ compilers.
  • The default mode for C is now -std=gnu11 instead of -std=gnu89.
  • The Runtime Library (libstdc++) has been greatly improved.
  • GCC now supports new ISA extensions, including AVX-512{BW,DQ,VL,IFMA,VBMI}.
The version of the GNU Debugger (GDB) included in Red Hat Developer Toolset provides the following new features:
  • Support for automatic location and retrieval of executable files from remote targets.
  • GDB and gdbserver are able to access executable and shared-library files without a set sysroot command when attaching to processes running in mount namespaces different from the debugger. This makes it possible to easily attach to processes in containers.
  • Support for auto-loading Python scripts contained in a special section named .debug_gdb_scripts.
  • Support for fork events on extended-remote Linux targets.
Additionally, the Red Hat Developer Toolset version of binutils provides these features:
  • The AVR Tiny microcontrollers and the Andes NDS32 architecture are supported.
  • Support for the Openrisc and OR32 architectures has been replaced with support for the OR1K architecture.
  • The strings utility now searches the entire program, including code sections.
For a full list of changes and features introduced in this release, see Red Hat Developer Toolset User Guide.

2.3. Known Issues

multiple components
The devtoolset-4-package_name-debuginfo packages can conflict with the corresponding packages from the base Red Hat Enterprise Linux system or from other versions of Red Hat Developer Toolset. This namely applies to devtoolset-4-gcc-debuginfo, devtoolset-4-ltrace-debuginfo, devtoolset-4-valgrind-debuginfo, and might apply to any debuginfo packages. Similar conflict can also occur in a multilib environment, where 64-bit debuginfo packages conflict with 32-bit debuginfo packages.
For example, on Red Hat Enterprise Linux 7, devtoolset-4-gcc-debuginfo conflicts with three packages: gcc-base-debuginfo, gcc-debuginfo, and gcc-libraries-debuginfo. On Red Hat Enterprise Linux 6, devtoolset-4-gcc-debuginfo conflicts with one package: gcc-libraries-debuginfo. As a consequence, if conflicting debuginfo packages are installed, attempts to install Red Hat Developer Toolset 4.0 can fail with a transaction check error message similar to the following examples:
file /usr/lib/debug/usr/lib64/libitm.so.1.0.0.debug from install of gcc-base-debuginfo-4.8.3-9.el7.x86_64 conflicts with file from package devtoolset-4-gcc-debuginfo-5.2.1-1.el7.x86_64
file /usr/lib/debug/usr/lib64/libtsan.so.0.0.0.debug from install of gcc-debuginfo-4.8.3-9.el7.x86_64 conflicts with file from package devtoolset-4-gcc-debuginfo-5.2.1-1.el7.x86_64
file /usr/src/debug/gcc-5.2.1-20150716/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/x86_64-redhat-linux/bits/c++config.h from install of gcc-libraries-debuginfo-5.2.1-2.1.el7.x86_64 conflicts with file from package devtoolset-4-gcc-debuginfo-5.2.1-1.el7.x86_64
file /usr/lib/debug/usr/lib64/libcilkrts.so.5.0.0.debug from install of gcc-libraries-debuginfo-4.9.0-6.1.1.el6.x86_64 conflicts with file from package devtoolset-4-gcc-debuginfo-5.2.1-1.el6.x86_64
To work around the problem, manually uninstall the conflicting debuginfo packages prior to installing Red Hat Developer Toolset 4.0. It is advisable to install only the relevant debuginfo packages when necessary and expect such problems to happen.
eclipse component
The devtoolset-4-tycho package conflicts with the devtoolset-3-tycho package. Consequently, if devtoolset-3-tycho is installed, an attempt to install devtoolset-4-tycho fails with the following transaction check error messages:
file /opt/rh/maven30/root/usr/share/xmvn/lib/installer/osgi.jar from install of devtoolset-4-tycho-0.23.0-8.2.el7.noarch conflicts with file from package devtoolset-3-tycho-0.22.0-12.el7.noarch
file /opt/rh/maven30/root/usr/share/xmvn/lib/installer/org.fedoraproject.p2.jar from install of devtoolset-4-tycho-0.23.0-8.2.el7.noarch conflicts with file from package devtoolset-3-tycho-0.22.0-12.el7.noarch
file /opt/rh/maven30/root/usr/share/xmvn/lib/installer/xmvn-p2-installer-plugin.jar from install of devtoolset-4-tycho-0.23.0-8.2.el7.noarch conflicts with file from package devtoolset-3-tycho-0.22.0-12.el7.noarch
Note that the devtoolset-4-tycho and devtoolset-3-tycho packages are not installed by default and are required only for rebuilding Eclipse.
eclipse component
On Red Hat Enterprise Linux 7.2, a bug in the perf tool, which is used to populate the Perf Profile View in Eclipse, causes some of the items in the view not to be properly linked to their respective positions in the Eclipse Editor. While the profiling works as expected, it is not possible to navigate to related positions in the Editor by clicking on parts of the Perl Profile View.
eclipse component
When two or more connections to different Docker hosts are configured in Eclipse's Docker Explorer, Eclipse selects randomly from the available connections when a new Run Configuration for a container is created. Such selection is then impossible to change without deleting the affected Run Configuration. To work around this problem, make sure to have only one connection to a Docker host configured before launching a new container configuration.
valgrind component
Red Hat Developer Toolset supports only the Open MPI application binary interface (ABI) version 1.6, whereas Red Hat Enterprise Linux 7.2 supports Open MPI 1.10. These two versions are binary incompatible. As a consequence, programs that are built against Open MPI 1.10 cannot be run under Valgrind included in Red Hat Developer Toolset. To work around this problem, use the Red Hat Enterprise Linux 7.2 version of Valgrind for programs linked against Open MPI version 1.10.
valgrind component, BZ#869184
The default Valgrind gdbserver support (--vgdb=yes) can cause certain register and flags values to be not always up-to-date due to optimizations done by the Valgrind core. The GDB utility is therefore unable to show certain parameters or variables of programs running under Valgrind. To work around this problem, use the --vgdb=full parameter. Note that programs might run slower under Valgrind when this parameter is used.
valgrind component, BZ#990931
Valgrind must be rebuilt without Red Hat Developer Toolset's GCC installed, or it will be used in preference to Red Hat Enterprise Linux system GCC. The binary files shipped by Red Hat are build using the system GCC. For any testing, Red Hat Developer Toolset's GDB should be used.
elfutils component
Rebuilding of elfutils from source is possible only using the base Red Hat Enterprise Linux toolchain. An attempt to recompile elfutils using Red Hat Developer Toolset will fail.
gdb component
This release of GDB includes an implementation of dynamic types, the Variable Length Array (VLA) patches. Fortran slices and sub-matrices were implemented on top of the previous VLA implementation. This support has not been ported in time for Red Hat Developer Toolset 4.0 release of GDB. Consequently, Fortran slices and sub-matrices, for example, expressions like a(2,2:3), a(1,2:), a(:,:), or a(:), are not supported in this release although they were supported in some of the earlier Red Hat Developer Toolset releases. To work around this problem:
  • Either print the whole array a and filter slices and sub-matrices out of the text output manually or by a script.
  • Or create a new variable only for debugging purposes and assign to it the intended slice or sub-matrix in the Fortran program being debugged. This requires the program's recompilation for the next debugging session.

Other Notes

  • Red Hat Developer Toolset primarily aims to provide a compiler for development of user applications for deployment on multiple versions of Red Hat Enterprise Linux. Operating system components, kernel modules and device drivers generally correspond to a specific version of Red Hat Enterprise Linux, for which the supplied base OS compiler is recommended.
  • Red Hat Developer Toolset 4.0 supports only C, C++ and Fortran development. For other languages, invoke the system version of GCC available on Red Hat Enterprise Linux.
  • Building an application with Red Hat Developer Toolset 4.0 on Red Hat Enterprise Linux (for example, Red Hat Enterprise Linux 7) and then executing that application on an earlier minor version (such as Red Hat Enterprise Linux 6.6.z) may result in runtime errors due to differences in non-toolchain components between Red Hat Enterprise Linux releases. Users are advised to check compatibility carefully. Red Hat supports only execution of an application built with Red Hat Developer Toolset on the same, or a later, supported release of Red Hat Enterprise Linux than the version used to build that application.
  • All code in the non-shared library libstdc++_nonshared.a in Red Hat Developer Toolset 4.0 is licensed under the GNU General Public License v3 with additional permissions granted under Section 7, described in the GCC Runtime Library Exception version 3.1, as published by the Free Software Foundation.
  • The compiler included in Red Hat Developer Toolset emits newer DWARF debugging records than previous compilers available on Red Hat Enterprise Linux. These new debugging records improve the debugging experience in a variety of ways, particularly for C++ and optimized code. However, certain tools are not yet capable of handling the newer DWARF debug records. To generate the older style debugging records, use the options -gdwarf-2 -gstrict-dwarf or -gdwarf-3 -gstrict-dwarf.
  • Some newer library features are statically linked into applications built with Red Hat Developer Toolset to support execution on multiple versions of Red Hat Enterprise Linux. This adds a small additional security risk because regular Red Hat Enterprise Linux errata would not change this code. If the need for developers to rebuild their applications due to such an issue arises, Red Hat will signal this in a security erratum. Developers are strongly advised not to statically link their entire application for the same reasons.
  • Note that error messages related to a missing libitm library when using the -fgnu-tm option require the libitm package to be installed. You can install the package with the following command:
    yum install libitm
  • To use the ccache utility with GCC included in Red Hat Developer Toolset, set your environment correctly. For example:
    ~]$ scl enable devtoolset-4 '/usr/lib64/ccache/gcc -c foo.c'
    Alternatively, you can create a shell with the Red Hat Developer Toolset version of GCC as the default compiler:
    ~]$ scl enable devtoolset-4 'bash'
    After you have created the shell, run the following two commands:
    ~]$ export PATH=/usr/lib64/ccache${PATH:+:${PATH}}
    ~]$ gcc -c foo.c
  • Because the elfutils libraries contained in Red Hat Developer Toolset 4.0 are linked to a client application statically, caution is advised when passing handles to libelf, libdw, and libasm data structures to external code and when passing handles received from external code to libelf, libdw, and libasm.
    Be especially careful when an external library, which is linked dynamically against the system version of elfutils, is passed a pointer to a structure that comes from the Red Hat Developer Toolset 4.0 version of elfutils (or vice versa).
    Generally, data structures used in the Red Hat Developer Toolset 4.0 version of elfutils are not compatible with the Red Hat Enterprise Linux system versions, and structures coming from one should never be touched by the other.
    In applications that use the Red Hat Developer Toolset 4.0 libraries, all code that was linked against the system version of the libraries should be recompiled against the libraries included in Red Hat Developer Toolset 4.0.
  • The elfutils EBL library, which is used internally by libdw, was amended not to open back ends dynamically. Instead, a selection of back ends is compiled in the library itself: Intel x86 (i386), AMD64 and Intel 64 (x86_64), Intel Itanium, and IBM System z. Some functionality may not be available if the client wishes to work with ELF files from architectures other than those mentioned above.
  • With the Red Hat Developer Toolset 4.0 release, you can use Valgrind's libmpiwrap wrapper with either the openmpi package or the compat-openmpi compatibility package. When using Valgrind on Red Hat Enterprise Linux 6, specify whether you want to use the openmpi or compat-openmpi package by updating the LD_PRELOAD environment variable.
    To use the openmpi package with the libmpiwrap wrapper, update LD_PRELOAD as follows:
    LD_PRELOAD=/opt/rh/devtoolset-4/root/usr/lib64/valgrind/libmpiwrap-amd64-linux.so:/usr/lib64/openmpi/lib/libmpi.so /usr/lib64/openmpi/bin/mpirun valgrind ./mpi-hello
    
    Where mpi-hello is compiled with the appropriate mpicc compiler.
    To use the compat-openmpi package with the libmpiwrap wrapper, update LD_PRELOAD as follows:
    LD_PRELOAD=/opt/rh/devtoolset-4/root/usr/lib64/valgrind/libmpiwrap-amd64-linux.so:/usr/lib64/compat-openmpi/lib/libmpi.so /usr/lib64/compat-openmpi/bin/mpirun valgrind ./mpi-hello
    
    Where mpi-hello is compiled with the appropriate mpicc compiler.
    To test that the above works as expected and the MPI calls are intercepted by the wrapper, set the environment variable MPIWRAP_DEBUG to verbose.
  • Some packages managed by the scl utility include privileged services that require sudo. The system sudo clears environment variables and so Red Hat Developer Toolset includes its own sudo shell script, wrapping scl enable. This script does not currently parse or pass normal sudo options, only sudo COMMAND ARGS .... In order to use the system version of sudo from within a Red Hat Developer Toolset-enabled shell, use the /usr/bin/sudo binary.
  • Red Hat Developer Toolset 4.0 includes GCC 5.2, which provides support for Cilk+, an extension to the C and C++ languages for parallel programming. A runtime library, libcilkrts, is included in this release to support the feature. The libcilkrts library will be a part of the gcc-libraries package in the future Red Hat Enterprise Linux releases but the package is not included in all supported Red Hat Enterprise Linux releases. To enable dynamic linkage of binaries and libraries built with Red Hat Developer Toolset 4.0 GCC using Cilk+ features on supported Red Hat Enterprise Linux releases that do not contain libcilkrts, install the libcilkrts.so shared library from Red Hat Developer Toolset 4.0 with such binaries or libraries.
  • Intel have issued erratum HSW136 concerning TSX (Transactional Synchronization Extensions) instructions. Under certain circumstances, software using the Intel TSX instructions may result in unpredictable behavior. TSX instructions may be executed by applications built with Red Hat Developer Toolset GCC under certain conditions. These include use of GCC's experimental Transactional Memory support (using the -fgnu-tm option) when executed on hardware with TSX instructions enabled. The users of Red Hat Developer Toolset are advised to exercise further caution when experimenting with Transaction Memory at this time, or to disable TSX instructions by applying an appropriate hardware or firmware update.
  • The Eclipse SWT graphical library on Red Hat Enterprise Linux 7 uses GTK 3.x. Eclipse Dark Theme is not yet fully stable on GTK 3.x, so this theme is considered a Technology Preview and not supported. For more information about Red Hat Technology Previews, see https://access.redhat.com/support/offerings/techpreview/.
  • To use the Memory Protection Extensions (MPX) feature in GCC, the Red Hat Developer Toolset version of the libmpx library is required, otherwise the application might not link properly.
  • The two binutils linkers, gold and ld, have different ways of handling hidden symbols, which leads to incompatibilities in their behavior. Previously, the gold and ld linkers had inconsistent and incorrect behavior with regard to shared libraries and hidden symbols. There were two scenarios:
    • If a shared library referenced a symbol that existed elsewhere in both hidden and non-hidden versions, the gold linker produced a bogus warning message about the hidden version.
    • If a shared library referenced a symbol that existed elsewhere only as a hidden symbol, the gold linker created an executable, even though it could not work.
    The gold linker has been updated so that it no longer issues bogus warning messages about hidden symbols that also exist in a non-hidden version. The second scenario cannot be solved in the linker. It is up to the programmer to ensure that a non-hidden version of the symbol is available when the application is run.
    As a result, the two linkers' behavior is closer, but they still differ in case of a reference to a hidden symbol that cannot be found elsewhere in a non-hidden version. Unfortunately, there is not a single correct behavior for this situation, so the linkers are allowed to differ.