From: Jakub Bogusz Date: Sun, 21 Jun 2020 13:44:28 +0000 (+0200) Subject: - updated to 5.7[.0] X-Git-Tag: auto/th/kernel-tools-5.7.0-1~1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fkernel-tools.git;a=commitdiff_plain;h=a02a39f - updated to 5.7[.0] - added bpf-hashmap patch (fix bpftool with size_t shorter than ULL) --- diff --git a/kernel-tools-bpf-hashmap.patch b/kernel-tools-bpf-hashmap.patch new file mode 100644 index 0000000..e5300b1 --- /dev/null +++ b/kernel-tools-bpf-hashmap.patch @@ -0,0 +1,24 @@ +Fix broken hashmap implementation to ensure that hash_bits returns value fitting in +given bits (for bits > 0): multiplier is long long, so shift bits must be based on +long long, not __WORDSIZE. +--- linux-5.7/tools/lib/bpf/hashmap.h.orig 2020-06-01 01:49:15.000000000 +0200 ++++ linux-5.7/tools/lib/bpf/hashmap.h 2020-06-21 15:22:07.298466419 +0200 +@@ -10,17 +10,12 @@ + + #include + #include +-#ifdef __GLIBC__ +-#include +-#else +-#include +-#endif + #include "libbpf_internal.h" + + static inline size_t hash_bits(size_t h, int bits) + { + /* shuffle bits and return requested number of upper bits */ +- return (h * 11400714819323198485llu) >> (__WORDSIZE - bits); ++ return (h * 11400714819323198485llu) >> (__SIZEOF_LONG_LONG__ * 8 - bits); + } + + typedef size_t (*hashmap_hash_fn)(const void *key, void *ctx); diff --git a/kernel-tools.spec b/kernel-tools.spec index 5434d1b..8d8f951 100644 --- a/kernel-tools.spec +++ b/kernel-tools.spec @@ -19,8 +19,8 @@ %undefine with_multilib %endif -%define basever 5.6 -%define postver .5 +%define basever 5.7 +%define postver .0 Summary: Assortment of tools for the Linux kernel Summary(pl.UTF-8): Zestaw narzędzi dla jądra Linuksa Name: kernel-tools @@ -29,7 +29,7 @@ Release: 1 License: GPL v2 Group: Applications/System Source0: https://www.kernel.org/pub/linux/kernel/v5.x/linux-%{basever}.tar.xz -# Source0-md5: 7b9199ec5fa563ece9ed585ffb17798f +# Source0-md5: f63ed18935914e1ee3e04c2a0ce1ba3b Source1: cpupower.service Source2: cpupower.config %if "%{postver}" != ".0" @@ -40,6 +40,7 @@ Patch1: x32.patch Patch2: regex.patch Patch3: %{name}-perf-update.patch Patch4: %{name}-perf-gtk2.patch +Patch5: %{name}-bpf-hashmap.patch URL: https://www.kernel.org/ BuildRequires: bison BuildRequires: docutils @@ -404,6 +405,7 @@ cd linux-%{basever} %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %{__sed} -i -e '/^CFLAGS = /s/ -g / $(OPTFLAGS) /' tools/hv/Makefile %{__sed} -i -e '/^CFLAGS+=/s/ -O1 / $(OPTFLAGS) /' tools/thermal/tmon/Makefile