The GNU Toolchain is a collection of programming tools produced by the GNU Project. The tools are often packaged together due to their common use for developing software applications, operating systems, and low level software for embedded systems.
This blog is part of a regular series covering the latest changes and improvements in the components that make up this Toolchain. Apart from the announcement of new releases however, the features described here are at the very bleeding edge of software development in the tools. This does mean that it may be a while before they make it into production releases, although interested parties can always build their own copies of the toolchain in order to try them out.
New Releases
It has been a long time since my last post, so there is lots to tell you about. First of all there have been major releases of most of the tools:
GCC 6.2
This is mostly a bug-fix release over gcc 6.1 of course, but it does also include a few enhancements for the SPARC target:
- Support for --with-cpu-32 and --with-cpu-64 configure options has been added on bi-architecture platforms.
- Support for the SPARC M7 (Niagara 7) processor has been added.
- Support for the VIS 4.0 instruction set has been added.
Binutils 2.27
In addition to enhancements mentioned in previous postings, this release also includes:
- A configure option --enable-relro={yes|no} to decide whether -z relro should be the default behaviour for the linker in ELF based targets. If this configure option is not specified then read-only relocations (relro) will be enabled automatically for all Linux based targets except FRV, HPPA, IA64 and MIPS.
- Linux/x86 targets now default to enabling the compression of debug sections. This change can be reverted by using the --enable-compressed-debug-sections=no configure option.
- The assembler now supports a --no-pad-sections command line option to prevent it from padding the end of each section up to its alignment boundary. This can be useful on systems with very tight memory constraints.
- The ARC port of gas now accepts a --with-cpu=<type> configure option to specify the default cpu type.
GDB 7.11.1
This is just a big-fix release over 7.11. The 7.12 release is almost ready however and when that comes out it will feature:
- GDB and GDBserver are now built with a C++ compiler by default. The configure option --disable-build-with-cxx can be used to build with a C compiler instead, although this option will soon be deprecated.
- GDB now supports a negative repeat count in the 'x' command to examine memory backwards from the given address.
- GDB now supports a new mechanism that allows front-ends to provide fully featured GDB console views, as a better alternative to building such views on top of the -interpreter-exec console command. Front-ends can now start GDB in the traditional command-line mode running in an embedded terminal emulator widget, and create a separate MI interpreter running on a specified I/O device. In this way, GDB handles line editing, history, tab completion, etc. in the console all by itself, and the GUI uses the separate MI interpreter for its own control and synchronization, invisible to the command line.
Glibc 2.24
This is a big release containing many new features and enhancements. See https://www.sourceware.org/ml/libc-alpha/2016-08/msg00212.html for the full details. Of particular interest however may be the following:
- A new NSS action is added to facilitate large distributed system administration. The action, MERGE, allows remote user stores like LDAPto be merged into local user stores like /etc/groups in order to provide easy to use, updated, and managed sets of merged credentials.
- nextupl, nextup, nextupf, nextdownl, nextdown and nextdownf have been added to libm. The nextup functions return the next representable value in the direction of positive infinity and the nextdown functions return the next representable value in the direction of negative infinity.
New Features
In addition the development versions of these tools continue to add new features and abilities. For example:
Compiler
- G++ has a new command line option -fconstexpr-loop-limit=<n> which sets the maximum number of iterations for a loop in C++14 constexpr functions. A limit is needed to detect infinite loops during constant expression evaluation.
- G++ now also supports -fstrong-eval-order which forces the evaluation of member access, array subscripting, and shift expressions in left-to-right order, and assignments in right-to-left order, as adopted for C++17. This option is enabled
by default when -std=c++1z is used. - The compiler now supports a new command line option: -fdiagnostics-parseable-fixits This option tells the compiler to extend the diagnostic messages that it displays by adding an extra line. This line is intended to be a machine parseable hint for consumption by an IDE. The hint starts with the text fix-it: and the rest gives information about the source code location involved. For example:
fix-it:"test.c":{45:3-45:21}:"function_foo"
- The compiler now supports a new optimization: -fcode-hoisting. This tries to move the evaluation of expressions executed on all paths to as early as possible in the function. This is especially useful as a code size optimization, but it often helps for code speed as well.
- GCC now has support for the _Float<N> and _Float<N>x types as defined by the ISO/IEC TS 18661-3:2015 standard. The actual set of types supported depends upon the target architecture however. So for example the _Float128 type is supported on all systems where __float128 is supported or where long double has the IEEE binary128 format. The _Float64x type is supported on all systems where __float128 is supported. The _Float32 type is supported on all systems supporting IEEE binary32. The _Float64 and _Float32x types are supported on all systems supporting IEEE binary64. Currently there are no target architectures that would support the _Float16 or _Float128x types.
- The ARM port of the toolchain now supports the ARMv8.2-A architecture extensions. In addition revisions older than ARMv4t are now deprecated.
- The PowerPC port of the compiler now supports the use of built-in functions that allow direct access to the Hardware Transactional Memory (HTM) instructions that were added in version 2.07 of the PowerPC ISA.
Linker
- The linker has extended the --out-implib=<file> option, previously restricted to x86 PE targets, to any ELF based target. This allows the generation of an import library for an ELF executable, which can then be used by another application to link against the executable.
- This feature is now used by the ARM port of the linker to create import libraries suitable for use in the generation of Secure Gateways, as per the ARMv8-M Security Extensions.
Binary Utilities
- The objdump program now supports the use of the -M option with ARC
targets to specify the instruction class(es) that should be disassembled. - The objcopy and strip programs now accept section patterns starting with an exclamation point to indicate any section not matching the pattern. In addition a new option --remove-relocations=<section_pattern> can be used to remove sections containing relocations.
Debugger
- GDB has added support for thread names on MS-Windows. In addition it can now catch and handle the special exception that programs running on MS-Windows use to assign names to threads in the debugger.
C Library
- In Newlib the entire set of locale-specific functions from POSIX-1.2008 has now been implemented with one exception: strfmon_l. This means that any character handling function (eg isalnum, toascii, etc) and any string handling function (eg strtoll) now has a locale based equivalent (isalnum_l, toascii_l, strtoll_l, etc).
That's all for now. I'll post again in another couple of months.
Last updated: February 6, 2024