lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzaNBcW8ZDWcH5USd9jFshFF78psAjn2mqZp6uVGn0ZK+g@mail.gmail.com>
Date:   Thu, 9 Jun 2022 11:11:42 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     James Hilliard <james.hilliard1@...il.com>
Cc:     bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        Björn Töpel <bjorn@...nel.org>,
        Magnus Karlsson <magnus.karlsson@...el.com>,
        Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        "open list:BPF (Safe dynamic programs and tools)" 
        <netdev@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] libbpf: replace typeof with __typeof__ for -std=c17 compatibility

On Wed, Jun 8, 2022 at 11:28 PM James Hilliard
<james.hilliard1@...il.com> wrote:
>
> Fixes errors like:
> error: expected specifier-qualifier-list before 'typeof'
>    14 | #define __type(name, val) typeof(val) *name
>       |                           ^~~~~~
> ../src/core/bpf/socket_bind/socket-bind.bpf.c:25:9: note: in expansion of macro '__type'
>    25 |         __type(key, __u32);
>       |         ^~~~~~
>
> Signed-off-by: James Hilliard <james.hilliard1@...il.com>
> ---

If you follow DPDK link you gave me ([0]), you'll see that they ended up doing

#ifndef typeof
#define typeof __typeof__
#endif

It's way more localized. Let's do that.

But also I tried to build libbpf-bootstrap with -std=c17 and
immediately ran into issue with asm, so we need to do the same with
asm -> __asm__. Can you please update your patch and fix both issues?

  [0] https://patches.dpdk.org/project/dpdk/patch/2601191342CEEE43887BDE71AB977258213F3012@irsmsx105.ger.corp.intel.com/
  [1] https://github.com/libbpf/libbpf-bootstrap


>  tools/lib/bpf/bpf_core_read.h   | 16 ++++++++--------
>  tools/lib/bpf/bpf_helpers.h     |  4 ++--
>  tools/lib/bpf/bpf_tracing.h     | 24 ++++++++++++------------
>  tools/lib/bpf/btf.h             |  4 ++--
>  tools/lib/bpf/libbpf_internal.h |  6 +++---
>  tools/lib/bpf/usdt.bpf.h        |  6 +++---
>  tools/lib/bpf/xsk.h             | 12 ++++++------
>  7 files changed, 36 insertions(+), 36 deletions(-)
>

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ