]> git.pld-linux.org Git - packages/kernel-tools.git/blame - kernel-tools-bpf-hashmap-upstream.patch
- added binutils2.35 patch (adjust Makefile for nm output change); release 3
[packages/kernel-tools.git] / kernel-tools-bpf-hashmap-upstream.patch
CommitLineData
49505f6f
JB
1From f516acd5397fdbb77ef0aad0798d9ef7c3001d72 Mon Sep 17 00:00:00 2001
2From: Ian Rogers <irogers@google.com>
3Date: Fri, 15 May 2020 09:50:02 -0700
4Subject: libbpf, hashmap: Remove unused #include
5
6Remove #include of libbpf_internal.h that is unused.
7
8Discussed in this thread:
9https://lore.kernel.org/lkml/CAEf4BzZRmiEds_8R8g4vaAeWvJzPb4xYLnpF0X2VNY8oTzkphQ@mail.gmail.com/
10
11Signed-off-by: Ian Rogers <irogers@google.com>
12Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
13Acked-by: Andrii Nakryiko <andriin@fb.com>
14Link: https://lore.kernel.org/bpf/20200515165007.217120-3-irogers@google.com
15---
16 tools/lib/bpf/hashmap.h | 1 -
17 1 file changed, 1 deletion(-)
18
19(limited to 'tools/lib/bpf/hashmap.h')
20
21diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
22index bae8879cdf58..e823b35e7371 100644
23--- a/tools/lib/bpf/hashmap.h
24+++ b/tools/lib/bpf/hashmap.h
25@@ -15,7 +15,6 @@
26 #else
27 #include <bits/reg.h>
28 #endif
29-#include "libbpf_internal.h"
30
31 static inline size_t hash_bits(size_t h, int bits)
32 {
33--
34cgit 1.2.3-1.el7
35
36From 8ca8d4a841730c02e77bf3c87bf658cc44f364b9 Mon Sep 17 00:00:00 2001
37From: Arnaldo Carvalho de Melo <acme@kernel.org>
38Date: Tue, 9 Jun 2020 18:16:53 -0300
39Subject: libbpf: Define __WORDSIZE if not available
40
41Some systems, such as Android, don't have a define for __WORDSIZE, do it
42in terms of __SIZEOF_LONG__, as done in perf since 2012:
43
44 http://git.kernel.org/torvalds/c/3f34f6c0233ae055b5
45
46For reference: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
47
48I build tested it here and Andrii did some Travis CI build tests too.
49
50Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
51Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
52Acked-by: Andrii Nakryiko <andriin@fb.com>
53Link: https://lore.kernel.org/bpf/20200608161150.GA3073@kernel.org
54---
55 tools/lib/bpf/hashmap.h | 7 +++----
56 1 file changed, 3 insertions(+), 4 deletions(-)
57
58(limited to 'tools/lib/bpf/hashmap.h')
59
60diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
61index e823b35e7371..df59fd4fc95b 100644
62--- a/tools/lib/bpf/hashmap.h
63+++ b/tools/lib/bpf/hashmap.h
64@@ -10,10 +10,9 @@
65
66 #include <stdbool.h>
67 #include <stddef.h>
68-#ifdef __GLIBC__
69-#include <bits/wordsize.h>
70-#else
71-#include <bits/reg.h>
72+#include <limits.h>
73+#ifndef __WORDSIZE
74+#define __WORDSIZE (__SIZEOF_LONG__ * 8)
75 #endif
76
77 static inline size_t hash_bits(size_t h, int bits)
78--
79cgit 1.2.3-1.el7
80
This page took 0.038853 seconds and 4 git commands to generate.