From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andriin@fb.com>, bpf <bpf@vger.kernel.org>,
Networking <netdev@vger.kernel.org>,
Alexei Starovoitov <ast@fb.com>, Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH v2 bpf-next 2/2] selftests/bpf: add byte swapping selftest
Date: Tue, 30 Jun 2020 08:18:06 -0700 [thread overview]
Message-ID: <CAEf4BzZsEJDAzeY6vJG5873Y4nnB9b+NrSiSzAHQWATMKfnO_w@mail.gmail.com> (raw)
In-Reply-To: <cd88906d-2ca7-e37b-9214-6094571d41fc@iogearbox.net>
On Tue, Jun 30, 2020 at 7:09 AM Daniel Borkmann <daniel@iogearbox.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@fb.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.
prev parent reply other threads:[~2020-06-30 15:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 6:07 [PATCH v2 bpf-next 0/2] Make bpf_endian.h compatible with vmlinux.h Andrii Nakryiko
2020-06-30 6:07 ` [PATCH v2 bpf-next 1/2] libbpf: make bpf_endian co-exist " Andrii Nakryiko
2020-06-30 6:07 ` [PATCH v2 bpf-next 2/2] selftests/bpf: add byte swapping selftest Andrii Nakryiko
2020-06-30 14:09 ` Daniel Borkmann
2020-06-30 15:18 ` Andrii Nakryiko [this message]
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=CAEf4BzZsEJDAzeY6vJG5873Y4nnB9b+NrSiSzAHQWATMKfnO_w@mail.gmail.com \
--to=andrii.nakryiko@gmail.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).