From b074f6b72b8b9bd48e06be61c0d1fa80d7f0b740 Mon Sep 17 00:00:00 2001 From: Charlie Jenkins Date: Mon, 21 Apr 2025 23:36:59 -0700 Subject: [PATCH] package/linux-tools: fix parallel compilation linux-tools opportunistically set linux as only a patch dependency. This unfortunately introduces a race condition in the shared linux scripts when using PER_PACKAGE_DIRECTORIES and using top level parallelism. The race manifests as the error "/bin/sh: 1: scripts/basic/fixdep: Permission denied". This happens when the linux package and the linux-tools package are being compiled in parallel. The linux-tools currently using fixdep are perf and rtla. When the timing is correct, perf, rtla, or the kernel Makefile will try to use fixdep while one of the others is compiling fixed, resulting in fixdep being briefly not available. To fix this, set linux as a build dependency instead of a patch dependency. Signed-off-by: Charlie Jenkins Reviewed-by: Yann E. MORIN Signed-off-by: Thomas Petazzoni --- package/linux-tools/linux-tools.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package/linux-tools/linux-tools.mk b/package/linux-tools/linux-tools.mk index 81b1fbc176..49e73a9ca4 100644 --- a/package/linux-tools/linux-tools.mk +++ b/package/linux-tools/linux-tools.mk @@ -19,8 +19,12 @@ include $(sort $(wildcard package/linux-tools/*.mk.in)) -# We only need the kernel to be extracted, not actually built -LINUX_TOOLS_PATCH_DEPENDENCIES = linux +# Prevent the kernel from being compiled in parallel with linux-tools. The +# kernel and some linux-tools (such as perf) use fixdep to manage kconfig +# dependencies. There is a race condition where the kernel and linux-tools try +# to build fixdep while the other tries to use fixdep, resulting in the use of +# fixdep failing. +LINUX_TOOLS_DEPENDENCIES = linux # Install Linux kernel tools in the staging directory since some tools # may install shared libraries and headers (e.g. cpupower).