[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200114225857.kdmedok6mie55j6o@ast-mbp.dhcp.thefacebook.com>
Date: Tue, 14 Jan 2020 14:58:58 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Toke Høiland-Jørgensen <toke@...hat.com>
Cc: Andrii Nakryiko <andrii.nakryiko@...il.com>,
Andrii Nakryiko <andriin@...com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf-next] libbpf: Fix include of bpf_helpers.h when
libbpf is installed on system
On Tue, Jan 14, 2020 at 10:26:57PM +0100, Toke Høiland-Jørgensen wrote:
> Andrii Nakryiko <andrii.nakryiko@...il.com> writes:
>
> > On Tue, Jan 14, 2020 at 11:07 AM Andrii Nakryiko
> > <andrii.nakryiko@...il.com> wrote:
> >>
> >> On Tue, Jan 14, 2020 at 8:43 AM Toke Høiland-Jørgensen <toke@...hat.com> wrote:
> >> >
> >> > The change to use angled includes for bpf_helper_defs.h breaks compilation
> >> > against libbpf when it is installed in the include path, since the file is
> >> > installed in the bpf/ subdirectory of $INCLUDE_PATH. Fix this by adding the
> >> > bpf/ prefix to the #include directive.
> >> >
> >> > Fixes: 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir")
> >> > Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
> >> > ---
> >> > Not actually sure this fix works for all the cases you originally tried to
> >>
> >> This does break selftests/bpf. Have you tried building selftests, does
> >> it work for you? We need to fix selftests simultaneously with this
> >> change.
> >>
> >> > fix with the referred commit; please check. Also, could we please stop breaking
> >> > libbpf builds? :)
> >>
> >> Which libbpf build is failing right now? Both github and in-kernel
> >> libbpf builds are fine. You must be referring to something else. What
> >> exactly?
> >
> > I think it's better to just ensure that when compiling BPF programs,
> > they have -I/usr/include/bpf specified, so that all BPF-side headers
> > can be simply included as #include <bpf_helpers.h>, #include
> > <bpf_tracing.h>, etc
>
> And break all programs that don't have that already? Just to make the
> kernel build env slightly more convenient? Hardly friendly to the
> library users, is it? :)
Could you explain the breakage ?
bpf_helpers.h and bpf_helper_defs.h are installed in the same location.
If prefix==/usr during make install of libbpf they both will go into
/usr/include/bpf
Are you saying the bpf progs had:
#include <bpf/bpf_helpers.h>
to pick that header from /usr/include and commit 6910d7d3867a that did:
+++ b/tools/lib/bpf/bpf_helpers.h
@@ -2,7 +2,7 @@
#ifndef __BPF_HELPERS__
#define __BPF_HELPERS__
-#include "bpf_helper_defs.h"
+#include <bpf_helper_defs.h>
broke it?
If so this bit needs to be reverted.
And we need a selfttest for such include order.
Powered by blists - more mailing lists