From 09ec1df3846dbc2e9897033a75c8bb39f7fc6225 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 8 Sep 2026 02:04:34 +0000 Subject: [PATCH] turbostat: fix build with kernel 7.x Since kernel 7.x tools/include/linux/compiler_types.h includes , a no-op stub for the new compiler-based context analysis annotations. The recipe copies compiler_types.h out of the kernel tree and rewrites its includes to local headers, but did not know about the new one, so the build fails: ./compiler_types.h:16:10: fatal error: 'linux/compiler-context-analysis.h' file not found Copy the new header when the kernel provides it and rewrite the include like the others. While here, fix the mangled quoting on the TMPCHECK line, which produced run.do_compile: line 138: TMPCHECK=grep: command not found and left TMPCHECK unset. The unquoted [ -n $TMPCHECK ] test then always succeeded, so the vdso branch was taken regardless of the grep result. Signed-off-by: Khem Raj --- meta-oe/recipes-kernel/turbostat/turbostat.bb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meta-oe/recipes-kernel/turbostat/turbostat.bb b/meta-oe/recipes-kernel/turbostat/turbostat.bb index fcd1b116b8..2e69f9604a 100644 --- a/meta-oe/recipes-kernel/turbostat/turbostat.bb +++ b/meta-oe/recipes-kernel/turbostat/turbostat.bb @@ -59,6 +59,9 @@ do_configure:prepend() { cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler.h ${S} cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler_types.h ${S} cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler-gcc.h ${S} + if [ -f "${STAGING_KERNEL_DIR}/tools/include/linux/compiler-context-analysis.h" ]; then + cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler-context-analysis.h ${S} + fi cp -r ${STAGING_KERNEL_DIR}/tools/power/x86/turbostat/* ${S} } @@ -68,8 +71,9 @@ do_compile() { sed -i 's##"compiler.h"#' build_bug.h sed -i 's##"compiler_types.h"#' compiler.h sed -i 's##"compiler-gcc.h"#' compiler_types.h - 'TMPCHECK='grep "" bits.h'' || true - if [ -n $TMPCHECK ]; then + sed -i 's##"compiler-context-analysis.h"#' compiler_types.h + TMPCHECK=$(grep "" bits.h || true) + if [ -n "$TMPCHECK" ]; then sed -i 's##"const.h"#' bits.h sed -i 's###' const.h else