bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Andrii Nakryiko <andriin@fb.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	bpf <bpf@vger.kernel.org>, Networking <netdev@vger.kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@fb.com>, Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH bpf] libbpf: fix missing __WORDSIZE definition
Date: Thu, 18 Jul 2019 10:26:48 -0700	[thread overview]
Message-ID: <CAEf4BzYK0XAXPLaqTzy6S3wDgrrvAJHyEjk2OoZfbYTRJbkVVQ@mail.gmail.com> (raw)
In-Reply-To: <20190718172513.2394157-1-andriin@fb.com>

On Thu, Jul 18, 2019 at 10:25 AM Andrii Nakryiko <andriin@fb.com> wrote:
>
> hashmap.h depends on __WORDSIZE being defined. It is defined by
> glibc/musl in different headers. It's an explicit goal for musl to be
> "non-detectable" at compilation time, so instead include glibc header if
> glibc is explicitly detected and fall back to musl header otherwise.
>
> Fixes: e3b924224028 ("libbpf: add resizable non-thread safe internal hashmap")
> Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> ---
>  tools/lib/bpf/hashmap.h | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
> index 03748a742146..46a8cb667994 100644
> --- a/tools/lib/bpf/hashmap.h
> +++ b/tools/lib/bpf/hashmap.h
> @@ -10,7 +10,12 @@
>
>  #include <stdbool.h>
>  #include <stddef.h>
> +#ifdef __GLIBC__
> +#include <bits/wordsize.h>
> +#else
> +#include <bits/reg.h>
>  #include "libbpf_internal.h"
> +#endif

Disregard this version, #endif on the wrong line. Fixing in v2.

>
>  static inline size_t hash_bits(size_t h, int bits)
>  {
> --
> 2.17.1
>

  reply	other threads:[~2019-07-18 17:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 17:25 [PATCH bpf] libbpf: fix missing __WORDSIZE definition Andrii Nakryiko
2019-07-18 17:26 ` Andrii Nakryiko [this message]
2019-07-18 17:55 ` Arnaldo Carvalho de Melo
2019-07-18 18:04   ` Andrii Nakryiko
2019-07-18 18:56     ` Arnaldo Carvalho de Melo
2019-07-18 19:14       ` Arnaldo Carvalho de Melo
2019-07-18 21:16         ` Andrii Nakryiko
2019-07-19  1:16           ` Arnaldo Carvalho de Melo
2019-07-19 17:54             ` Andrii Nakryiko
2019-07-19 18:14               ` Arnaldo Carvalho de Melo
2019-07-19 18:26                 ` Andrii Nakryiko
2019-07-19 18:34                   ` Arnaldo Carvalho de Melo
2019-07-19 20:04                     ` Andrii Nakryiko
2019-07-19 20:27                       ` Arnaldo Carvalho de Melo
2019-07-19 21:48                         ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEf4BzYK0XAXPLaqTzy6S3wDgrrvAJHyEjk2OoZfbYTRJbkVVQ@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=acme@redhat.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).