From 8aaf41d0246ccca65a51eb8b0239654c8c81809f Mon Sep 17 00:00:00 2001 From: Yoann Congal Date: Tue, 3 Jun 2025 13:51:30 +0200 Subject: [PATCH] pcp: fix build race condition In upstream (handcrafted) Makefile, .c and .h files are soft-linked before being compiled. Under heavy load or a build with a high CPU count, the compilation can start before header files are softlinked, resulting in a build error: | pcp-htop.c:13:10: fatal error: CommandLine.h: No such file or directory | 13 | #include "CommandLine.h" | | ^~~~~~~~~~~~~~~ Fix this by adding the make dependency between object files and the headers. Signed-off-by: Yoann Congal Signed-off-by: Khem Raj --- ...htop-fix-header-build-race-condition.patch | 33 +++++++++++++++++++ meta-oe/recipes-support/pcp/pcp_6.3.7.bb | 1 + 2 files changed, 34 insertions(+) create mode 100644 meta-oe/recipes-support/pcp/pcp/0001-pcp-htop-fix-header-build-race-condition.patch diff --git a/meta-oe/recipes-support/pcp/pcp/0001-pcp-htop-fix-header-build-race-condition.patch b/meta-oe/recipes-support/pcp/pcp/0001-pcp-htop-fix-header-build-race-condition.patch new file mode 100644 index 0000000000..48880fbb4d --- /dev/null +++ b/meta-oe/recipes-support/pcp/pcp/0001-pcp-htop-fix-header-build-race-condition.patch @@ -0,0 +1,33 @@ +From d04ea418c5fcfec2f6fbb2dd9f982ddf12c5be87 Mon Sep 17 00:00:00 2001 +From: Yoann Congal +Date: Tue, 3 Jun 2025 10:02:58 +0200 +Subject: [PATCH] pcp-htop: fix header build race condition + +.c and .h files are soft-linked before being compiled. Under heavy load +or a build with a high CPU count, the compilation can start before +header files are softlinked, resulting in a build error: +| pcp-htop.c:13:10: fatal error: CommandLine.h: No such file or directory +| 13 | #include "CommandLine.h" +| | ^~~~~~~~~~~~~~~ + +Fix this by adding the make dependency between object files and the +headers. + +Upstream-Status: Submitted [https://github.com/performancecopilot/pcp/pull/2217] +Signed-off-by: Yoann Congal +--- + src/pcp/htop/GNUmakefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/pcp/htop/GNUmakefile b/src/pcp/htop/GNUmakefile +index 3e29638d6..898f0b766 100644 +--- a/src/pcp/htop/GNUmakefile ++++ b/src/pcp/htop/GNUmakefile +@@ -224,6 +224,7 @@ default: build-me + include $(BUILDRULES) + + ifeq "$(HAVE_NCURSESW)" "true" ++$(OBJECTS): $(HFILES) + build-me: $(TOPXFILES) $(SUBXFILES) $(CFGXFILES) $(CMDTARGET) $(DISTLINKS) $(MAN_PAGES) + + install: default diff --git a/meta-oe/recipes-support/pcp/pcp_6.3.7.bb b/meta-oe/recipes-support/pcp/pcp_6.3.7.bb index c390b9eec2..65efac06be 100644 --- a/meta-oe/recipes-support/pcp/pcp_6.3.7.bb +++ b/meta-oe/recipes-support/pcp/pcp_6.3.7.bb @@ -14,6 +14,7 @@ SRC_URI += "file://0001-Remove-unsuitble-part-for-cross-compile.patch \ file://pass-options-to-AR.patch \ file://fix_parallel_make.patch \ file://0001-bind2-Use-pmcpp-from-native-builds.patch \ + file://0001-pcp-htop-fix-header-build-race-condition.patch \ " export PCP_DIR = "${RECIPE_SYSROOT_NATIVE}"