[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5an6r3jzuifkm2b7scmxv4u3suygr77apgue6zneelowbqyjzr@5g6mbczbyk5e>
Date: Mon, 27 Oct 2025 15:22:28 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Michael Kelley <mhklinux@...look.com>
Cc: "x86@...nel.org" <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Petr Mladek <pmladek@...e.com>, Miroslav Benes <mbenes@...e.cz>,
Joe Lawrence <joe.lawrence@...hat.com>, "live-patching@...r.kernel.org" <live-patching@...r.kernel.org>,
Song Liu <song@...nel.org>, laokz <laokz@...mail.com>, Jiri Kosina <jikos@...nel.org>,
Marcos Paulo de Souza <mpdesouza@...e.com>, Weinan Liu <wnliu@...gle.com>,
Fazla Mehrab <a.mehrab@...edance.com>, Chen Zhongjin <chenzhongjin@...wei.com>,
Puranjay Mohan <puranjay@...nel.org>, Dylan Hatch <dylanbhatch@...gle.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v4 49/63] objtool/klp: Add --checksum option to generate
per-function checksums
On Mon, Oct 27, 2025 at 01:19:10AM +0000, Michael Kelley wrote:
> It turns out that Ubuntu 20.04 installed the 0.7.3-1 version of libxxhash. But from a
> quick look at the README on the xxhash github site, XXH3 is first supported by the
> 0.8.0 version, so the compile error probably makes sense. I found a PPA that offers
> the 0.8.3 version of xxhash for Ubuntu 20.04, and that solved the problem.
>
> So the Makefile steps above that figure out if xxhash is present probably aren't
> sufficient, as the version of xxhash matters. And the "--checksum not supported"
> error message should be more specific about the required version.
>
> I reproduced the behavior on two different Ubuntu 20.04 systems, but
> someone who knows this xxhash stuff better than I do should confirm
> my conclusions. Maybe the way to fix the check for the presence of xxhash is
> to augment the inline test program to include a reference to XXH3_state, but
> I haven't tried to put together a patch to do that, pending any further discussion
> or ideas.
Thanks for reporting that. I suppose something like the below would work?
Though, maybe the missing xxhash shouldn't fail the build at all. It's
really only needed for people who are actually trying to run klp-build.
I may look at improving that.
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 48928c9bebef1..8b95166b31602 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 echo -e "#include <xxhash.h>\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
Powered by blists - more mailing lists