From ee0b48fabadf9b073b24f761ac09da7293eee7b7 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Wed, 12 Nov 2025 15:32:33 -0800 Subject: [PATCH] objtool: Set minimum xxhash version to 0.8 XXH3 is only supported starting with xxhash 0.8. Enforce that. Fixes: 0d83da43b1e1 ("objtool/klp: Add --checksum option to generate per-function checksums") Closes: https://lore.kernel.org/SN6PR02MB41579B83CD295C9FEE40EED6D4FCA@SN6PR02MB4157.namprd02.prod.outlook.com Reported-by: Michael Kelley Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Michael Kelley Tested-by: Michael Kelley Link: https://patch.msgid.link/7227c94692a3a51840278744c7af31b4797c6b96.1762990139.git.jpoimboe@kernel.org --- tools/objtool/Makefile | 2 +- tools/objtool/builtin-check.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 48928c9bebef1..021f55b7bd872 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -12,7 +12,7 @@ ifeq ($(SRCARCH),loongarch) endif ifeq ($(ARCH_HAS_KLP),y) - HAVE_XXHASH = $(shell echo "int main() {}" | \ + HAVE_XXHASH = $(shell printf "$(pound)include \nXXH3_state_t *state;int main() {}" | \ $(HOSTCC) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n) ifeq ($(HAVE_XXHASH),y) BUILD_KLP := y diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 1e1ea8396eb3a..aab7fa9c7e00a 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -164,7 +164,7 @@ static bool opts_valid(void) #ifndef BUILD_KLP if (opts.checksum) { - ERROR("--checksum not supported; install xxhash-devel/libxxhash-dev and recompile"); + ERROR("--checksum not supported; install xxhash-devel/libxxhash-dev (version >= 0.8) and recompile"); return false; } #endif -- 2.47.3