linux/Documentation/kbuild
Kees Cook 0d4d70da34
kbuild: Mark the gzip recipes as recursive
Since commit 48ebe1cbbe ("kbuild: compress the kernel with pigz if
available"), cmd_gzip runs pigz through scripts/jobserver-exec, which
takes the job slots make has free. GNU Make passes the jobserver pipe
only to recipes it treats as recursive, but leaves --jobserver-auth in
MAKEFLAGS for all of them. The make 4.3 in CentOS Stream 9 also hides
the pipe in sub-makes (a backport of the fix for GNU Make bug 58232), so
jobserver-exec cannot open it, runs pigz on one thread, and prints:

  WARNING: Unable to reopen jobserver read-side pipe: FileNotFoundError(2, 'No such file or directory')

Mark every recipe that can run cmd_gzip as recursive with "+", as
commit ecab4115c4 ("kbuild: mark `rustc` (and others) invocations as
recursive") did for rustc. Besides the $(call if_changed,gzip) rules,
this covers those that choose gzip through a variable: the built-in
initramfs in usr/Makefile (which rcutorture's kvm.sh builds), the EFI
zboot image, and the arm, csky, and mips compressed images. As with
rustc, "make -n" now runs these recipes, including those that choose
through a variable when they select another compressor. Also update the
gzip entry in Documentation/kbuild/makefiles.rst, as suggested in
review.

Tested with GNU Make 4.3 plus CentOS Stream 9's make-4.3-cloexec.patch,
GCC 16.2.0, and -j64, on ARCH=x86_64, arm64, and arm defconfig, and
ARCH=x86_64 defconfig with a built-in initramfs: none of them prints the
warning, and pigz gets the free job slots (-p 54, 64, and 50 for the
kernel image). Without this change, the x86_64 builds print it for the
kernel image and for the initramfs.

Reported-by: Paul E. McKenney <paulmck@kernel.org>
Closes: https://lore.kernel.org/all/0ddb5e5e-f801-444c-aa98-0cfe814a3026@paulmck-laptop/
Fixes: 48ebe1cbbe ("kbuild: compress the kernel with pigz if available")
Assisted-by: LLM
Reviewed-by: Nicolas Schier <n.schier@fritz.com>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Kees Cook <kees@kernel.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://patch.msgid.link/20261010081914.540611-1-kees@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2026-10-11 01:20:04 +01:00
..
bash-completion.rst kbuild: add Kbuild bash completion 2025-03-15 21:22:52 +09:00
gcc-plugins.rst docs/core-api: expand Fedora instructions for GCC plugins 2022-09-27 13:21:44 -06:00
gendwarfksyms.rst Documentation/kbuild: gendwarfksyms: Style cleanup 2026-01-21 16:58:59 -07:00
headers_install.rst
index.rst Documentation: use a source-read extension for the index link boilerplate 2026-01-23 11:59:34 -07:00
issues.rst
kbuild.rst kbuild: compress the kernel with pigz if available 2026-09-26 00:16:36 +01:00
kconfig-language.rst kconfig: Add "def_string", "def_int" and "def_hex" 2026-09-24 11:37:05 -04:00
kconfig-macro-language.rst docs: kconfig: fix shell function syntax in caveats 2026-09-17 10:41:03 -07:00
Kconfig.recursion-issue-01 docs: kconfig: Fix grammar and formatting 2024-02-15 06:55:47 +09:00
Kconfig.recursion-issue-02 docs: use the lore redirector everywhere 2021-10-12 13:58:19 -06:00
kconfig.rst kconfig: add optional warnings for changed input values 2026-06-18 11:46:32 -07:00
Kconfig.select-break
llvm.rst Documentation/llvm: drop note about LLVM=0 2026-03-03 17:41:50 +01:00
makefiles.rst kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
modules.rst documentation: remove references to *_gpl sections 2026-03-31 23:42:52 +00:00
reproducible-builds.rst Documentation: kbuild: Update the debug information notes in reproducible-builds.rst 2026-04-05 09:21:32 +02:00