linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BPF selftests build failure in 5.10-rc
@ 2020-12-09 22:23 Seth Forshee
  2020-12-10  0:15 ` Andrii Nakryiko
  0 siblings, 1 reply; 3+ messages in thread
From: Seth Forshee @ 2020-12-09 22:23 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Daniel Borkmann, Andrii Nakryiko, linux-kselftest, netdev, bpf,
	linux-kernel

Building the BPF selftests with clang 11, I'm getting the following
error:

   CLNG-LLC [test_maps] profiler1.o
 In file included from progs/profiler1.c:6:
 progs/profiler.inc.h:260:17: error: use of unknown builtin '__builtin_preserve_enum_value' [-Wimplicit-function-declaration]
                 int cgrp_id = bpf_core_enum_value(enum cgroup_subsys_id___local,
                               ^
 /home/ubuntu/unstable/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:179:2: note: expanded from macro 'bpf_core_enum_value'
         __builtin_preserve_enum_value(*(typeof(enum_type) *)enum_value, BPF_ENUMVAL_VALUE)
         ^
 1 error generated.
 llc: error: llc: <stdin>:1:1: error: expected top-level entity
 BPF obj compilation failed

I see that test_core_reloc_enumval.c takes precautions around the use of
__builtin_preserve_enum_value as it is currently only available in clang
12 nightlies. Is it possible to do something similar here? Though I see
that the use of the builtin is not nearly so neatly localized as it is
in test_core_reloc_enumval.c.

Thanks,
Seth

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: BPF selftests build failure in 5.10-rc
  2020-12-09 22:23 BPF selftests build failure in 5.10-rc Seth Forshee
@ 2020-12-10  0:15 ` Andrii Nakryiko
  2020-12-10 13:36   ` Seth Forshee
  0 siblings, 1 reply; 3+ messages in thread
From: Andrii Nakryiko @ 2020-12-10  0:15 UTC (permalink / raw)
  To: Seth Forshee
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	open list:KERNEL SELFTEST FRAMEWORK, Networking, bpf, open list

On Wed, Dec 9, 2020 at 2:24 PM Seth Forshee <seth.forshee@canonical.com> wrote:
>
> Building the BPF selftests with clang 11, I'm getting the following
> error:
>
>    CLNG-LLC [test_maps] profiler1.o
>  In file included from progs/profiler1.c:6:
>  progs/profiler.inc.h:260:17: error: use of unknown builtin '__builtin_preserve_enum_value' [-Wimplicit-function-declaration]
>                  int cgrp_id = bpf_core_enum_value(enum cgroup_subsys_id___local,
>                                ^
>  /home/ubuntu/unstable/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:179:2: note: expanded from macro 'bpf_core_enum_value'
>          __builtin_preserve_enum_value(*(typeof(enum_type) *)enum_value, BPF_ENUMVAL_VALUE)
>          ^
>  1 error generated.
>  llc: error: llc: <stdin>:1:1: error: expected top-level entity
>  BPF obj compilation failed

Addressed by fb3558127cb6 ("bpf: Fix selftest compilation on clang 11")

>
> I see that test_core_reloc_enumval.c takes precautions around the use of
> __builtin_preserve_enum_value as it is currently only available in clang
> 12 nightlies. Is it possible to do something similar here? Though I see
> that the use of the builtin is not nearly so neatly localized as it is
> in test_core_reloc_enumval.c.
>
> Thanks,
> Seth

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: BPF selftests build failure in 5.10-rc
  2020-12-10  0:15 ` Andrii Nakryiko
@ 2020-12-10 13:36   ` Seth Forshee
  0 siblings, 0 replies; 3+ messages in thread
From: Seth Forshee @ 2020-12-10 13:36 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	open list:KERNEL SELFTEST FRAMEWORK, Networking, bpf, open list

On Wed, Dec 09, 2020 at 04:15:35PM -0800, Andrii Nakryiko wrote:
> On Wed, Dec 9, 2020 at 2:24 PM Seth Forshee <seth.forshee@canonical.com> wrote:
> >
> > Building the BPF selftests with clang 11, I'm getting the following
> > error:
> >
> >    CLNG-LLC [test_maps] profiler1.o
> >  In file included from progs/profiler1.c:6:
> >  progs/profiler.inc.h:260:17: error: use of unknown builtin '__builtin_preserve_enum_value' [-Wimplicit-function-declaration]
> >                  int cgrp_id = bpf_core_enum_value(enum cgroup_subsys_id___local,
> >                                ^
> >  /home/ubuntu/unstable/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:179:2: note: expanded from macro 'bpf_core_enum_value'
> >          __builtin_preserve_enum_value(*(typeof(enum_type) *)enum_value, BPF_ENUMVAL_VALUE)
> >          ^
> >  1 error generated.
> >  llc: error: llc: <stdin>:1:1: error: expected top-level entity
> >  BPF obj compilation failed
> 
> Addressed by fb3558127cb6 ("bpf: Fix selftest compilation on clang 11")

Great, thanks!

> 
> >
> > I see that test_core_reloc_enumval.c takes precautions around the use of
> > __builtin_preserve_enum_value as it is currently only available in clang
> > 12 nightlies. Is it possible to do something similar here? Though I see
> > that the use of the builtin is not nearly so neatly localized as it is
> > in test_core_reloc_enumval.c.
> >
> > Thanks,
> > Seth

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-10 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 22:23 BPF selftests build failure in 5.10-rc Seth Forshee
2020-12-10  0:15 ` Andrii Nakryiko
2020-12-10 13:36   ` Seth Forshee

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).