Chapter 15. Red Hat Developer Toolset Images Red Hat Developer Toolset is a Red Hat offering for developers on the Red Hat Enterprise Linux platform. It provides a complete set of development and performance analysis tools that can be installed and used on multiple versions of Red Hat Enterprise Linux. Executables built with the Red Hat Developer Toolset toolchain can then also be deployed and run on multiple versions of Red Hat Enterprise Linux. For detailed compatibility information, see Red Hat Developer Toolset 12 User Guide . Important Only container images providing the latest version of Red Hat Developer Toolset are supported. 15.1. Running Red Hat Developer Toolset Tools from Pre-Built Container Images To display general usage information for pre-built Red Hat Developer Toolset container images that you have already pulled to your local machine, run the following command as root : To launch an interactive shell within a pre-built container image, run the following command as root : In both of the above commands, substitute the image_name parameter with the name of the container image you pulled to your local system and now want to use. For example, to launch an interactive shell within the container image with selected toolchain components, run the following command as root : Example 15.1. Using GCC in the Pre-Built Red Hat Developer Toolset Toolchain Image This example illustrates how to obtain and launch the pre-built container image with selected toolchain components of the Red Hat Developer Toolset and how to run the gcc compiler within that image. Make sure you have a container environment set up properly on your system by following instructions at Using podman to work with containers in the Managing Containers document. Pull the pre-built toolchain Red Hat Developer Toolset container image from the official Red Hat Container Registry: To launch the container image with an interactive shell, issue the following command: To launch the container as a regular (non-root) user, use the sudo command. To map a directory from the host system to the container file system, include the -v (or --volume ) option in the podman command: In the above command, the host's ~/Source/ directory is mounted as the /src/ directory within the container. Once you are in the container's interactive shell, you can run Red Hat Developer Toolset tools as expected. For example, to verify the version of the gcc compiler, run: Additional Resources For more information about components available in Red Hat Developer Toolset, see the following online resources: Red Hat Developer Toolset 12 User Guide Red Hat Developer Toolset 12.1 Release Notes Red Hat Developer Toolset 12.0 Release Notes 15.2. Red Hat Developer Toolset Toolchain Container Image 15.2.1. Description The Red Hat Developer Toolset Toolchain image provides the GNU Compiler Collection (GCC) and GNU Debugger (GDB). The rhscl/devtoolset-12-toolchain-rhel7 image contains content corresponding to the following packages: Component Version Package gcc 12.2.1 devtoolset-12-gcc g++ devtoolset-12-gcc-c++ gfortran devtoolset-12-gcc-gfortran gdb 11.2 devtoolset-12-gdb Additionally, the devtoolset-12-binutils package is included as a dependency. 15.2.2. Access To pull the rhscl/devtoolset-12-toolchain-rhel7 image, run the following command as root : 15.3. Red Hat Developer Toolset Performance Tools Container Image 15.3.1. Description The Red Hat Developer Toolset Performance Tools image provides a number of profiling and performance measurement tools. The rhscl/devtoolset-12-perftools-rhel7 image includes the following components: Component Version Package dwz 0.14 devtoolset-12-dwz Dyninst 12.1.0 devtoolset-12-dyninst elfutils 0.187 devtoolset-12-elfutils ltrace 0.7.91 devtoolset-12-ltrace make 4.3 devtoolset-12-make memstomp 0.1.5 devtoolset-12-memstomp OProfile 1.4.0 devtoolset-12-oprofile strace 5.18 devtoolset-12-strace SystemTap 4.7 devtoolset-12-systemtap Valgrind 3.19.0 devtoolset-12-valgrind Additionally, the devtoolset-12-gcc and devtoolset-12-binutils packages are included as a dependency. 15.3.2. Access To pull the rhscl/devtoolset-12-perftools-rhel7 image, run the following command as root : 15.3.3. Usage Using the SystemTap Tool from Container Images When using the SystemTap tool from a container image, additional configuration is required, and the container needs to be run with special command-line options. The following three conditions need to be met: The image needs to be run with super-user privileges. To do this, run the image using the following command: To use the pre-built perftools image, substitute the image name for devtoolset-12-perftools-rhel7 in the above command. The following kernel packages need to be installed in the container: kernel kernel-devel kernel-debuginfo The version and release numbers of the above packages must match the version and release numbers of the kernel running on the host system. Run the following command to determine the version and release numbers of the hosts system's kernel: Note that the kernel-debuginfo package is only available from the Debug repository. Enable the rhel-7-server-debug-rpms repository. For more information on how to get access to debuginfo packages, see How can I download or install debuginfo packages for RHEL systems? . To install the required packages with the correct version, use the yum package manager and the output of the uname command. For example, to install the correct version of the kernel package, run the following command as root : Save the container to a reusable image by executing the podman commit command. To save a custom-built SystemTap container:

Commands:
podman run image_name usage
podman run -ti image_name /bin/bash -l
podman run -ti rhscl/devtoolset-12-toolchain-rhel7 /bin/bash -l
podman pull rhscl/devtoolset-12-toolchain-rhel7
podman run -ti rhscl/devtoolset-12-toolchain-rhel7 /bin/bash -l
sudo podman run -v ~/Source:/src -ti rhscl/devtoolset-12-toolchain-rhel7 /bin/bash -l
bash-4.2USD gcc -v [...] gcc version 12.2.1 20221121 (Red Hat 12.2.1-4) (GCC)
podman pull registry.redhat.io/rhscl/devtoolset-12-toolchain-rhel7
podman pull registry.redhat.io/rhscl/devtoolset-12-perftools-rhel7
~]USD podman run --ti --privileged --ipc=host --net=host --pid=host devtoolset-12-my-perftools /bin/bash -l
~]USD uname -r 3.10.0-1160.90.1.el7.x86_64
~]# yum install -y kernel-USD(uname -r)
~]USD podman commit devtoolset-12-systemtap-USD(uname -r)