Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 7. Compilers and development tools
The following chapter contains the most notable changes to compilers and development tools between RHEL 8 and RHEL 9.
7.1. Notable changes to LLVM, Rust, and Go Copier lienLien copié sur presse-papiers!
LLVM Toolset updated to 19.1.7
LLVM Toolset has been updated to version 19.1.7.
Notable changes of the LLVM compiler:
- LLVM now uses debug records, a more efficient representation for debug information.
Notable updates of the Clang:
- C++14 sized deallocation is now enabled by default.
- C++17 support has been completed.
- Improvements to C++20 support, especially around modules, concepts, and Class Template Argument Deduction (CTAD) have been added.
- Improvements to C23, C2c, C23, and C2y support have been added.
For more information, see the LLVM release notes and Clang release notes.
LLVM Toolset is a rolling Application Stream, and only the latest version is supported. For more information, see the Red Hat Enterprise Linux Application Streams Life Cycle document.
Rust Toolset rebased to version 1.84.0
Rust Toolset has been updated to version 1.84.0. Notable enhancements since the previously available version 1.79.0 include:
-
The new
LazyCellandLazyLocktypes delay the initialization until the first use. These extend the earlierOnceCellandOnceLocktypes with the initialization function included in each instance. - The new sort implementations in the standard library improve the runtime performance and compile times. They also try to detect cases where a comparator is not producing a total order, making that panic instead of returning unsorted data.
-
Precise capturing for opaque return types have been added. The new
use<..>syntax specifies the generic parameters and lifetimes used in animpl Traitreturn type. Many new features for
constcode have been added, for example:- Floating point support
-
constimmediates for inline assembly - References to statics
- Mutable reference and pointers
Many new features for
unsafecode have been added, for example:- Strict provenance APIs
-
&rawpointer syntax - Safely addressing statics
-
Declaring safe items in unsafe
externblocks
-
The Cargo dependency resolver is now version aware. If a dependency crate specifies its minimum supported Rust version, Cargo uses this information when it resolves the dependency graph instead of using the latest
semver-compatible crate version.
Compatibility notes:
-
The WebAssembly System Interface (WASI) target is changed from
rust-std-static-wasm32-wasitorust-std-static-wasm32-wasip1. You can select the WASI target also by using the--target wasm32-wasip1parameter on the command line. For more information, see the Changes to Rust’s WASI targets upstream blog post. -
The split panic hook and panic handler arguments
core::panic::PanicInfoandstd::panic::PanicInfoare now different types. -
extern "C"functions now abort on uncaught panics. Useextern "C-unwind"instead to allow unwinding across ABI boundaries.
Rust Toolset is a rolling Application Stream, and Red Hat only supports the latest version. For more information, see the Red Hat Enterprise Linux Application Streams Life Cycle document.
Go Toolset rebased to version 1.23
Go Toolset has been updated to version 1.23. Notable enhancements include:
The
for-rangeloop accepts iterator functions of the following types:-
func(func() bool) -
func(func(K) bool) func(func(K, V) bool)Calls of the iterator argument function create the iteration values for the
for-rangeloop. For reference links, see the upstream release notes.
-
- The Go Toolchain can collect usage and breakage statistics to help the Go team to understand how the Go Toolchain is used and working. By default, Go Telemetry does not upload telemetry data and stores it only locally. For further information, see the upstream Go Telemetry documentation.
-
The
go vetsub-command includes thestdversionanalyzer which flags references to symbols that are too new for the version of Go you use in the referring file. -
The
cmdandcgofeatures support the-ldflagsoption to pass flags to the C linker. Thegocommand uses this flag automatically to avoidargument list too longerrors when you use a very largeCGO_LDFLAGSenvironment variable. -
The
traceutility tolerates partially broken traces and attempts to recover the trace data. This is especially useful in case of crashes, because you can get the trace leading up to the crash. -
The traceback printed by the runtime after an unhandled panic or other fatal error carries indentation to distinguish the stack trace of the
goroutinefrom the firstgoroutine. - The compiler build time overhead of using profile-guided optimization was reduced to single-digit percentage.
-
The new
-bindnowlinker flag enables immediate function binding when building a dynamically-linked ELF binary. -
The
//go:linknamelinker directive no longer refers to internal symbols in the standard library and the runtime that are not marked with//go:linknameon their definition. -
If a program no longer refers to a
TimerorTicker, garbage collection cleans them up immediately even if theirStopmethod has not been called. The timer channel associated with aTimerorTickeris now unbuffered with capacity 0. This ensures that, every time aResetorStopmethod is called, no stale values are not sent or received after the call. -
The new
uniquepackage provides facilities for canonicalizing values, such asinterningorhash-consing. -
The new
iterpackage provides the basic definitions to work with user-defined iterators. -
The
slicesandmapspackages introduce several new functions that work with iterators. -
The new
structspackage provides types for struct fields that modify properties of the containing struct type, such as memory layout. Minor changes are made in the following packages:
-
archive/tar -
crypto/tls -
crypto/x509 -
database/sql -
debug/elf -
encoding/binary -
go/ast -
go/types -
math/rand/v2 -
net -
net/http -
net/http/httptest -
net/netips -
path/filepath -
reflect -
runtime/debug -
runtime/pprof -
runtime/trace -
slices -
sync -
sync/atomic -
syscall -
testing/fstest -
text/template -
time -
unicode/utf16
-
For more information, see the upstream release notes.
Go Toolset is a rolling Application Stream, and Red Hat supports only the latest version. For more information, see the Red Hat Enterprise Linux Application Streams Life Cycle document.
32-bit ARM and MIPS backends are removed from llvm
The llvm package in RHEL 9.7 removed the 32-bit ARM and MIPS backends. This change reduces build time and maintenance effort for the toolchain. If you require these backends, you should use alternative build targets or earlier package versions.
7.2. Notable changes to performance tools and debuggers Copier lienLien copié sur presse-papiers!
valgrind rebased to version 3.24.0
The valgrind suite has been updated to version 3.24.0. Notable enhancements include:
-
The
--track-fds=yesoption now shows suppressible errors when using bad file descriptors, and the errors are written to the XML output. The warnings shown, if you do not use the option, are deprecated and will be removed in a future version. - Error messages now support Ada name demangling.
-
The
deflate-conversionfacility (z15/arch13) now supports the deflate compression call (DFLTCC) instruction on the IBM Z platform. -
On the IBM Z platform,
Valgrindnow supports the instructions provided by the message security assist (MSA) facility and its 1-9 extensions. Valgrindnow supports the following new Linux system calls:-
open_tree -
move_mount -
fsopen -
fsconfig -
fsmount -
fspick -
landlock_create_ruleset -
landlock_add_rule -
landlock_restrict_self
-
libabigail rebased to version 2.6
The libabigail library has been updated to version 2.6. Notable changes include:
- Better support for Linux kernel module analysis by using the BPF Type Format (BTF) and Common Trace Format (CTF).
- Improved internal type comparison algorithms in the middle end.
-
Improved logging in
abipkgdiff,abidw, andabilintutilities. - Numerous bug fixes.
For further changes, see the upstream release notes.
elfutils rebased to version 0.192
The elfutils package has been updated to version 0.192. Notable improvements include:
-
The
debuginfodservice can now perform a per-file signature verification to check the integrity by using the RPM Integrity Measurement Architecture (IMA) scheme from RHEL. -
A new
debuginfodAPI was added to query server metadata, such as querying the build ID from a file name. -
Debuginfodserver-side extraction of files from kerneldebuginfopackages is now significantly faster. -
The
dwfl_set_sysroot,dwfl_frame_unwound_source, anddwfl_unwound_source_strfunctions were added to thelibdwlibrary. -
The
eu-stacktraceutility is available as a Technology Preview. For details, see xref:[Jira-RHELDOCS-19072].
SystemTap rebased to version 5.2
The SystemTap tracing and probing tool has been updated to version 5.2.
A notable enhancement is the full activation of debuginfod-metadata based probes, based on elfutils 0.192. With this feature, you can write a systemtap script to target a full range of versions of a given binary or library by searching a debuginfod server for all matching names.
7.3. Notable changes to glibc Copier lienLien copié sur presse-papiers!
All threading APIs now merged into libc.so.6
In RHEL 8, the system threading library, libpthread.so, was a distinct library. In RHEL 9, all threading APIs have been merged into the core C library libc.so.6. Moving threading into the core C library enables the library to support threads by default. With a single file the in-place upgrade process is also made smoother since the thread APIs and core C, POSIX and BSD APIs are all updated at the same time (no distinct libraries).
Developers can continue to use the -lpthread option when linking threaded applications, but it is no longer necessary.
Historically, libraries used a weak reference to pthread_create or pthread_cancel to detect if processes could possibly be multi-threaded. Since this check now always succeeds, because libpthread.so is now in the core C library, libraries should use the __libc_single_threaded symbol for this instead.
The libdl library now merged into libc.so.6
In RHEL 8, the libdl library was a distinct library. In RHEL 9, the libdl library has been merged into the core C library libc.so.6. This means that interposing the dlsym function is now much more difficult. Applications that need to control the way how symbol resolution works should switch to the auditor (LD_AUDIT) interfaces.
Name Service Switch service plugins for dns and files now merged into libc.so.6
In RHEL 8, the Name Service Switch (NSS) services for files and dns, which provides data to user and group identity management APIs, was a distinct plugin. In RHEL 9, the plugins have been merged into the core C library libc.so.6. Moving the files and dns service providers ensures that applications that need to cross a mount namespace boundary (for example, enter a container) can do so knowing that NSS files and dns access services are always loaded at process startup.
When calling user and group APIs, where those APIs depend on an nsswitch.conf that references files or dns, developers can expect those services to always be present and provide the underlying service data.
7.4. Red Hat build of OpenJDK Copier lienLien copié sur presse-papiers!
Red Hat build of OpenJDK 17 is the default Java implementation since RHEL 9.5
The default RHEL 9 Java implementation is being changed from OpenJDK 11, which has reached its End Of Life (EOL), to OpenJDK 17. After this update, the java-17-openjdk packages, which provide the OpenJDK 17 Java Runtime Environment and the OpenJDK 17 Java Software Development Kit, will also provide the java and java-devel packages. For more information, see the OpenJDK documentation.
Existing packages in RHEL 9 that call java/bin or java-openjdk/bin directly will be immediately able to use OpenJDK 17.
Existing packages in RHEL 9 that require the java or java-devel packages directly, namely tomcat and systemtap-runtime-java, will pull the appropriate dependency automatically.
Ant, Maven, and packages that are using Java indirectly through the javapackages-tools package will be fully transitioned in an asynchronous update shortly after the general availability of RHEL 9.5.
If you need to install OpenJDK for the first time or if the default package is not installed through a dependency chain, use DNF:
dnf install java-17-openjdk-devel
# dnf install java-17-openjdk-devel
For more information, see Installing multiple minor versions of Red Hat build of OpenJDK on RHEL by using yum.
The current java-11-openjdk packages in RHEL 9 will not receive any further updates. However, Red Hat will provide Extended Life Cycle support (ELS) phase 1 with updates for Red Hat build of OpenJDK 11 until October 31, 2027. See Red Hat build of OpenJDK 11 Extended Lifecycle Support (ELS-1) Availability for details.
For information specific to the OpenJDK ELS program and the OpenJDK lifecycle, see the OpenJDK Life Cycle and Support Policy.
If you have the alternatives command set to manual mode for java and related components, OpenJDK 11 will still be used after the update. To use OpenJDK 17 in this case, change the alternatives setting to auto, for example:
alternatives --auto java alternatives --auto javac
# alternatives --auto java
# alternatives --auto javac
Use the alternatives --list command to verify the settings.
7.5. .NET on RHEL 9 Copier lienLien copié sur presse-papiers!
.NET 7.0 is no longer supported
.NET 7.0 reached its End Of Life (EOL) in May 2024. Use .NET 8.0 or later instead. For details about usage, see .NET 8.0 documentation. For information about the length of support, see the Red Hat Enterprise Linux Application Streams Life Cycle.
7.6. Compatibility breaking changes in compilers and development tools Copier lienLien copié sur presse-papiers!
Compilers and development tools in RHEL 9 contain several changes that break compatibility with compilers and development tools in RHEL 8. These include library merges, macro changes, and symbol deprecations, and require code modifications and application updates.
Non-constant PTHREAD_STACK_MIN, MINSIGSTKSZ, and SIGSTKSZ macros
In order to better support architectures that need a variable stack size for scalable vector registers, the constant value for the PTHREAD_STACK_MIN, MINSIGSTKSZ, and SIGSTKSZ macros have changed to a non-constant value, such as a sysconf call.
You can no longer use the PTHREAD_STACK_MIN, MINSIGSTKSZ, and SIGSTKSZ macros in a way that treats them like constant values. The value returned for the PTHREAD_STACK_MIN, MINSIGSTKSZ, and SIGSTKSZ macros is now of the long data type and might generate compiler warnings when compared against an unsigned value, such as size_t.
Libraries merged into libc.so.6
With this update, the following libraries have been merged into the libc library to provide a smoother in-place-upgrade experience, support safe use of threading at any time by a process, and to simplify the internal implementation:
-
libpthread -
libdl -
libutil -
libanl
Additionally, parts of the libresolv library have been moved into libc to support moving the Name Switch Service (NSS) files and Domain Name System (DNS) plugins directly into the libc library. The NSS files and DNS plugins are now directly built into the libc library and can be used during an upgrade or across a chroot or container boundary. Their use across a chroot or container boundary supports safely querying Identity Management (IdM) data from those sources.
New location of zdump utility
/usr/bin/zdump is the new location of the zdump utility.
Deprecation of sys_siglist, _sys_siglist, and sys_sigabbrev symbols
The sys_siglist, _sys_siglist, and sys_sigabbrev symbols are exported only as compatibility symbols to support old binaries. All programs should use the strsignal symbol instead.
Using the sys_siglist, _sys_siglist, and sys_sigabbrev symbols creates issues such as copy relocations and an error-prone Application Binary Interface (ABI) with no explicit bound checks for the array access.
This change might affect building from source for some package. To fix the issue, rewrite the program to use the strsignal symbol instead. For example:
should be adjusted to:
Or, to use the glibc-2.32 GNU extensions sigabbrev_np or sigdescr_np,:
Both extensions are async-signal-safe and multithread-safe.
Deprecation of the sys_errlist, _sys_errlist, sys_nerr, and _sys_nerr symbols
The sys_errlist, _sys_errlist, sys_nerr, and _sys_nerr symbols are exported solely as compatibility symbols to support old binaries. All programs should use the strerror or strerror_r symbols instead.
Using the sys_errlist, _sys_errlist, sys_nerr, and _sys_nerr symbols creates issues such as copy relocations and an error-prone ABI with no explicit bound checks for the array access.
This change might affect building from source for some packages. To fix the problem, rewrite the program using the strerror or strerror_r symbols. For example:
should be adjusted to:
Or, to use the glibc-2.32 GNU extensions strerrorname_np or strerrordesc_np:
Both extensions are async-signal-safe and multithread-safe.
Userspace memory allocator, malloc, changes
The mallwatch and tr_break symbols are now deprecated and no longer used in the mtrace function. You can achieve similar functionality by using conditional breakpoints within mtrace functions from within GDB.
The __morecore and __after_morecore_hook malloc hooks and the default implementation, __default_morecore, have been removed from the API. Existing applications continue to link against these symbols but the interfaces no longer have any effect on malloc.
Debugging features in malloc such as the MALLOC_CHECK_ environment variable (or the glibc.malloc.check tunable), mtrace(), and mcheck() have now been disabled by default in the main C library. To use these features, preload the new libc_malloc_debug.so debugging DSO.
The deprecated functions malloc_get_state and malloc_set_state have been moved from the core C library into the libc_malloc_debug.so library. Legacy applications that still use these functions must now preload the libc_malloc_debug.so library in their environment using the LD_PRELOAD environment variable.
The deprecated memory allocation hooks __malloc_hook, __realloc_hook, __memalign_hook, and __free_hook are now removed from the API. Compatibility symbols are present to support legacy programs, but new applications can no longer link to these symbols. These hooks no longer have any effect on glibc functionality. The malloc debugging DSO libc_malloc_debug.so currently supports hooks and can be preloaded to get this functionality back for older programs. However, this is a transitional measure and may be removed in a future release of the GNU C Library. You can port away from these hooks by writing and preloading your own malloc interposition library.
Lazy binding failures terminate the process
If a lazy binding failure happens during the dlopen function, during the execution of an ELF constructor, the process is now terminated. Previously, the dynamic loader returned NULL from dlopen with the lazy binding error captured in a dlerror message. In general, this is unsafe because resetting the stack in an arbitrary function call is not possible.
Deprecation of the stime function
The stime function is no longer available to newly linked binaries, and its declaration has been removed from <time.h>. Use the clock_settime function for programs that set the system time instead.
popen and system functions do not run atfork handlers anymore
Although it is a possible POSIX violation, the POSIX rationale in pthread_atfork documentation regarding atfork handlers is to handle inconsistent mutex states after a fork call in a multi-threaded process. In both the popen and system functions there is no direct access to user-defined mutexes.
Deprecated features in the C++ standard library
-
std::string::reserve(n)will no longer reduce the string’s capacity if called with an argument that is less than the string’s current capacity. A string’s capacity can be reduced by callingreserve()with no arguments, but that form is deprecated. The equivalentshrink_to_fit()should be used instead. -
The non-standard
std::__is_nullptr_ttype trait was deprecated. The standardstd::is_null_pointertrait should be used instead.