Currently, 'make bpf' in the tools/ directory does not provide the standard
quiet output except for bpftool (which is however listed with a wrong
directory). Worse, it does not respect the build output directory.
The 'make bpf_install' does not work as one would expect, either. It
installs unconditionally to /usr/bin without respecting DESTDIR and prefix.
This patchset improves that behavior.
Jiri Benc (7):
tools: bpftool: silence 'missing initializer' warnings
tools: bpf: respect output directory during build
tools: bpf: consistent make bpf_install
tools: bpf: make install should build first
tools: bpf: call descend in Makefile
tools: bpf: respect quiet/verbose build
tools: bpf: silence make by not deleting intermediate file
tools/bpf/Makefile | 74 +++++++++++++++++++++++++++++++---------------
tools/bpf/bpftool/Makefile | 2 +-
2 files changed, 51 insertions(+), 25 deletions(-)
--
1.8.3.1
When building bpf tool, gcc emits piles of warnings:
prog.c: In function ‘prog_fd_by_tag’:
prog.c:101:9: warning: missing initializer for field ‘type’ of ‘struct bpf_prog_info’ [-Wmissing-field-initializers]
struct bpf_prog_info info = {};
^
In file included from /home/storage/jbenc/git/net-next/tools/lib/bpf/bpf.h:26:0,
from prog.c:47:
/home/storage/jbenc/git/net-next/tools/include/uapi/linux/bpf.h:925:8: note: ‘type’ declared here
__u32 type;
^
As these warnings are not useful, switch them off.
Signed-off-by: Jiri Benc <redacted>
---
tools/bpf/bpftool/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Currently, make bpf_install in tools/ does not respect DESTDIR. Moreover, it
installs to /usr/bin/ unconditionally.
Let it respect DESTDIR and allow prefix to be specified. Also, to be more
consistent with bpftool and with the usual customs, default the prefix to
/usr/local instead of /usr.
Signed-off-by: Jiri Benc <redacted>
---
tools/bpf/Makefile | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Make the 'install' target depend on the 'all' target to build the binaries
first.
Signed-off-by: Jiri Benc <redacted>
---
tools/bpf/Makefile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Even in quiet mode, make finishes with
rm tools/bpf/bpf_exp.lex.c
That's because it considers the file to be intermediate. Silence that by
mentioning the lex.c file instead of the lex.o file; the dependency still
stays.
Signed-off-by: Jiri Benc <redacted>
---
tools/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
On Thu, Mar 8, 2018 at 2:00 PM, Jiri Benc [off-list ref] wrote:
Currently, 'make bpf' in the tools/ directory does not provide the standard
quiet output except for bpftool (which is however listed with a wrong
directory). Worse, it does not respect the build output directory.
The 'make bpf_install' does not work as one would expect, either. It
installs unconditionally to /usr/bin without respecting DESTDIR and prefix.
This patchset improves that behavior.
From: Jakub Kicinski <hidden> Date: 2018-03-09 07:36:13
On Thu, 8 Mar 2018 21:10:59 -0800, Alexei Starovoitov wrote:
On Thu, Mar 8, 2018 at 2:00 PM, Jiri Benc [off-list ref] wrote:
quoted
Currently, 'make bpf' in the tools/ directory does not provide the standard
quiet output except for bpftool (which is however listed with a wrong
directory). Worse, it does not respect the build output directory.
The 'make bpf_install' does not work as one would expect, either. It
installs unconditionally to /usr/bin without respecting DESTDIR and prefix.
This patchset improves that behavior.
Jakub,
please review this set.
Thanks!
I stared at it for a while, and it looks good!
Reviewed-by: Jakub Kicinski <redacted>
In addition I found a GCC 7 warning in bpftool, .PHONY lacks some
targets and we don't clean up after feature detection. I'll send
patches for that unless someone beats me to it.
From: Jakub Kicinski <hidden> Date: 2018-03-09 07:38:15
On Thu, 8 Mar 2018 23:00:35 +0100, Jiri Benc wrote:
When building bpf tool, gcc emits piles of warnings:
prog.c: In function ‘prog_fd_by_tag’:
prog.c:101:9: warning: missing initializer for field ‘type’ of ‘struct bpf_prog_info’ [-Wmissing-field-initializers]
struct bpf_prog_info info = {};
^
In file included from /home/storage/jbenc/git/net-next/tools/lib/bpf/bpf.h:26:0,
from prog.c:47:
/home/storage/jbenc/git/net-next/tools/include/uapi/linux/bpf.h:925:8: note: ‘type’ declared here
__u32 type;
^
As these warnings are not useful, switch them off.
Signed-off-by: Jiri Benc <redacted>
FWIW I couldn't reproduce this one. Out of curiosity what GCC did you
use?
From: Daniel Borkmann <daniel@iogearbox.net> Date: 2018-03-09 09:29:02
On 03/08/2018 11:00 PM, Jiri Benc wrote:
Currently, 'make bpf' in the tools/ directory does not provide the standard
quiet output except for bpftool (which is however listed with a wrong
directory). Worse, it does not respect the build output directory.
The 'make bpf_install' does not work as one would expect, either. It
installs unconditionally to /usr/bin without respecting DESTDIR and prefix.
This patchset improves that behavior.
Jiri Benc (7):
tools: bpftool: silence 'missing initializer' warnings
tools: bpf: respect output directory during build
tools: bpf: consistent make bpf_install
tools: bpf: make install should build first
tools: bpf: call descend in Makefile
tools: bpf: respect quiet/verbose build
tools: bpf: silence make by not deleting intermediate file
tools/bpf/Makefile | 74 +++++++++++++++++++++++++++++++---------------
tools/bpf/bpftool/Makefile | 2 +-
2 files changed, 51 insertions(+), 25 deletions(-)
Looks good to me as well, applied to bpf-next, thanks Jiri!