[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4BzZsEJDAzeY6vJG5873Y4nnB9b+NrSiSzAHQWATMKfnO_w@mail.gmail.com>
Date: Tue, 30 Jun 2020 08:18:06 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: Andrii Nakryiko <andriin@...com>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH v2 bpf-next 2/2] selftests/bpf: add byte swapping selftest
On Tue, Jun 30, 2020 at 7:09 AM Daniel Borkmann <daniel@...earbox.net> wrote:
>
> On 6/30/20 8:07 AM, Andrii Nakryiko wrote:
> > Add simple selftest validating byte swap built-ins and compile-time macros.
> >
> > Signed-off-by: Andrii Nakryiko <andriin@...com>
> > ---
> > .../testing/selftests/bpf/prog_tests/endian.c | 53 +++++++++++++++++++
> > .../testing/selftests/bpf/progs/test_endian.c | 37 +++++++++++++
> > 2 files changed, 90 insertions(+)
> > create mode 100644 tools/testing/selftests/bpf/prog_tests/endian.c
> > create mode 100644 tools/testing/selftests/bpf/progs/test_endian.c
>
> This fails the build for me with:
>
> [...]
> GEN-SKEL [test_progs] tailcall3.skel.h
> GEN-SKEL [test_progs] test_endian.skel.h
> libbpf: invalid relo for 'const16' in special section 0xfff2; forgot to initialize global var?..
> Error: failed to open BPF object file: 0
> Makefile:372: recipe for target '/root/bpf-next/tools/testing/selftests/bpf/test_endian.skel.h' failed
> make: *** [/root/bpf-next/tools/testing/selftests/bpf/test_endian.skel.h] Error 255
> make: *** Deleting file '/root/bpf-next/tools/testing/selftests/bpf/test_endian.skel.h'
Interesting. You must have a bit of an older Clang. I noticed people
submit code without explicit initialization of global variables, which
is ok now, because I think Clang doesn't emit it into the COM section
anymore. I'm surprised you don't get other compilation errors.
But regardless, I'll respin with explicit zero-initialization to fix this.
Powered by blists - more mailing lists