+From f516acd5397fdbb77ef0aad0798d9ef7c3001d72 Mon Sep 17 00:00:00 2001
+From: Ian Rogers <irogers@google.com>
+Date: Fri, 15 May 2020 09:50:02 -0700
+Subject: libbpf, hashmap: Remove unused #include
+
+Remove #include of libbpf_internal.h that is unused.
+
+Discussed in this thread:
+https://lore.kernel.org/lkml/CAEf4BzZRmiEds_8R8g4vaAeWvJzPb4xYLnpF0X2VNY8oTzkphQ@mail.gmail.com/
+
+Signed-off-by: Ian Rogers <irogers@google.com>
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Acked-by: Andrii Nakryiko <andriin@fb.com>
+Link: https://lore.kernel.org/bpf/20200515165007.217120-3-irogers@google.com
+---
+ tools/lib/bpf/hashmap.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+(limited to 'tools/lib/bpf/hashmap.h')
+
+diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
+index bae8879cdf58..e823b35e7371 100644
+--- a/tools/lib/bpf/hashmap.h
++++ b/tools/lib/bpf/hashmap.h
+@@ -15,7 +15,6 @@
+ #else
+ #include <bits/reg.h>
+ #endif
+-#include "libbpf_internal.h"
+
+ static inline size_t hash_bits(size_t h, int bits)
+ {
+--
+cgit 1.2.3-1.el7
+
+From 8ca8d4a841730c02e77bf3c87bf658cc44f364b9 Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme@kernel.org>
+Date: Tue, 9 Jun 2020 18:16:53 -0300
+Subject: libbpf: Define __WORDSIZE if not available
+
+Some systems, such as Android, don't have a define for __WORDSIZE, do it
+in terms of __SIZEOF_LONG__, as done in perf since 2012:
+
+ http://git.kernel.org/torvalds/c/3f34f6c0233ae055b5
+
+For reference: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
+
+I build tested it here and Andrii did some Travis CI build tests too.
+
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Acked-by: Andrii Nakryiko <andriin@fb.com>
+Link: https://lore.kernel.org/bpf/20200608161150.GA3073@kernel.org
+---
+ tools/lib/bpf/hashmap.h | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+(limited to 'tools/lib/bpf/hashmap.h')
+
+diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
+index e823b35e7371..df59fd4fc95b 100644
+--- a/tools/lib/bpf/hashmap.h
++++ b/tools/lib/bpf/hashmap.h
+@@ -10,10 +10,9 @@
+
+ #include <stdbool.h>
+ #include <stddef.h>
+-#ifdef __GLIBC__
+-#include <bits/wordsize.h>
+-#else
+-#include <bits/reg.h>
++#include <limits.h>
++#ifndef __WORDSIZE
++#define __WORDSIZE (__SIZEOF_LONG__ * 8)
+ #endif
+
+ static inline size_t hash_bits(size_t h, int bits)
+--
+cgit 1.2.3-1.el7
+