GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
makefile.tpl

Makefile.tpl parallel bootstrap comparison made portable.

GCC's parallel bootstrap comparison in Makefile.tpl now uses portable shell and sed constructs.

The Makefile.tpl’s parallel bootstrap comparison mechanism has been updated to be more portable across different hosts. It previously relied on GNU sed and specific shell features that are not universally available, causing failures on systems like Solaris. The changes use standard $(subst) for variable substitution and adjust shell trap handling to ensure correct behavior and error reporting on a wider range of environments.

In Details

The Makefile.tpl's parallel bootstrap comparison script, invoked via $(MAKE), previously used GNU sed for escaping and relied on shell features that are not POSIX compliant. This commit refactors the escaping logic to use make's built-in $(subst) and modifies the trap commands to be compatible with shells like Solaris's /bin/sh. These changes ensure the comparison remains functional and reports errors correctly across diverse build environments.

For Context
Makefile.tpl
A template file used by GCC to generate the main Makefile for building the compiler.
parallel bootstrap
A build process where GCC is compiled using multiple cores or processes in parallel, often as a self-hosting test.
GNU sed
The GNU version of the 'sed' stream editor, which has extensions beyond the POSIX standard.
POSIX
The POSIX standard, which defines a standard operating system interface and services for software compatibility.
shell trap
A mechanism in shell scripting that allows a program to execute specific commands in response to signals or exit conditions.
Filed Under: makefilebuildportabilitytesting