From: David Miller <davem@davemloft.net>
To: jbenc@redhat.com
Cc: daniel@iogearbox.net, netdev@vger.kernel.org, ast@kernel.org,
jakub.kicinski@netronome.com
Subject: Re: [PATCH bpf] tools: bpftool: fix compilation with older headers
Date: Tue, 06 Mar 2018 11:00:50 -0500 (EST) [thread overview]
Message-ID: <20180306.110050.853264455892964392.davem@davemloft.net> (raw)
In-Reply-To: <20180306160325.6e16d103@redhat.com>
From: Jiri Benc <jbenc@redhat.com>
Date: Tue, 6 Mar 2018 16:03:25 +0100
> On Tue, 6 Mar 2018 15:39:07 +0100, Daniel Borkmann wrote:
>> Thanks for the fix, Jiri! The standard approach to resolve such header dependencies under
>> tools/ would be to add a copy of magic.h uapi header into tools/include/uapi/linux/magic.h.
>>
>> Both bpftool and libbpf have tools/include/uapi/ in their include path from their
>> Makefile, so they would pull this in automatically and it would also allow to get rid
>> of the extra ifdef in libbpf then. Could you look into that?
>
> That's what I tried at first. But honestly, this is a shortcut to hell.
> Eventually, we'd end up with most of uapi headers duplicated under
> tools/include/uapi and hopelessly out of sync.
>
> The right approach would be to export uapi headers from the currently
> built kernel somewhere (a temporary directory, perhaps) and use that to
> build the tools. We should not have duplicated and out of sync headers
> in the kernel tree. Just look at the git log for tools/include/uapi to
> see what I mean by "out of sync".
I understand your frustration.
I'm really puzzled why doing "make headers_install" and then building
these tools does not pick those in-kernel headers up. That's what
really should happen.
The kernel tree internally should be self-consistent.
It's one thing for an external tool like iproute2 to duplicate stuff
like this, but user programs inside the kernel have no excuse for
requiring things like that just to build.
next prev parent reply other threads:[~2018-03-06 16:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 13:50 [PATCH bpf] tools: bpftool: fix compilation with older headers Jiri Benc
2018-03-06 14:39 ` Daniel Borkmann
2018-03-06 15:03 ` Jiri Benc
2018-03-06 16:00 ` David Miller [this message]
2018-03-06 16:28 ` Daniel Borkmann
2018-03-06 17:16 ` Arnaldo Carvalho de Melo
2018-03-07 20:56 ` Daniel Borkmann
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=20180306.110050.853264455892964392.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=jakub.kicinski@netronome.com \
--cc=jbenc@redhat.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).