* [bpf-next PATCH 1/3] libbpf: install the header file libbpf.h
2018-01-16 23:20 [bpf-next PATCH 0/3] libbpf: cleanups to Makefile Jesper Dangaard Brouer
@ 2018-01-16 23:20 ` Jesper Dangaard Brouer
2018-01-16 23:20 ` [bpf-next PATCH 2/3] libbpf: cleanup Makefile, remove unused elements Jesper Dangaard Brouer
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jesper Dangaard Brouer @ 2018-01-16 23:20 UTC (permalink / raw)
To: netdev, Daniel Borkmann, Alexei Starovoitov, wangnan0
Cc: jakub.kicinski, joe, linux-kernel, acme, eric,
Jesper Dangaard Brouer, jolsa
It seems like an oversight not to install the header file for libbpf,
given the libbpf.so + libbpf.a files are installed.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
tools/lib/bpf/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 8ed43ae9db9b..54370654c708 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -192,7 +192,8 @@ install_lib: all_cmd
install_headers:
$(call QUIET_INSTALL, headers) \
- $(call do_install,bpf.h,$(prefix)/include/bpf,644)
+ $(call do_install,bpf.h,$(prefix)/include/bpf,644); \
+ $(call do_install,libbpf.h,$(prefix)/include/bpf,644);
install: install_lib
^ permalink raw reply [flat|nested] 5+ messages in thread* [bpf-next PATCH 2/3] libbpf: cleanup Makefile, remove unused elements
2018-01-16 23:20 [bpf-next PATCH 0/3] libbpf: cleanups to Makefile Jesper Dangaard Brouer
2018-01-16 23:20 ` [bpf-next PATCH 1/3] libbpf: install the header file libbpf.h Jesper Dangaard Brouer
@ 2018-01-16 23:20 ` Jesper Dangaard Brouer
2018-01-16 23:20 ` [bpf-next PATCH 3/3] libbpf: Makefile set specified permission mode Jesper Dangaard Brouer
2018-01-17 1:04 ` [bpf-next PATCH 0/3] libbpf: cleanups to Makefile Daniel Borkmann
3 siblings, 0 replies; 5+ messages in thread
From: Jesper Dangaard Brouer @ 2018-01-16 23:20 UTC (permalink / raw)
To: netdev, Daniel Borkmann, Alexei Starovoitov, wangnan0
Cc: jakub.kicinski, joe, linux-kernel, acme, eric,
Jesper Dangaard Brouer, jolsa
The plugin_dir_SQ variable is not used, remove it.
The function update_dir is also unused, remove it.
The variable $VERSION_FILES is empty, remove it.
These all originates from the introduction of the Makefile, and is likely a copy paste
from tools/lib/traceevent/Makefile.
Fixes: 1b76c13e4b36 ("bpf tools: Introduce 'bpf' library and add bpf feature check")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
tools/lib/bpf/Makefile | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 54370654c708..8e15e48cb8f8 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -93,7 +93,6 @@ export prefix libdir src obj
# Shell quotes
libdir_SQ = $(subst ','\'',$(libdir))
libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
-plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
LIB_FILE = libbpf.a libbpf.so
@@ -150,7 +149,7 @@ CMD_TARGETS = $(LIB_FILE)
TARGETS = $(CMD_TARGETS)
-all: fixdep $(VERSION_FILES) all_cmd
+all: fixdep all_cmd
all_cmd: $(CMD_TARGETS)
@@ -169,16 +168,6 @@ $(OUTPUT)libbpf.so: $(BPF_IN)
$(OUTPUT)libbpf.a: $(BPF_IN)
$(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^
-define update_dir
- (echo $1 > $@.tmp; \
- if [ -r $@ ] && cmp -s $@ $@.tmp; then \
- rm -f $@.tmp; \
- else \
- echo ' UPDATE $@'; \
- mv -f $@.tmp $@; \
- fi);
-endef
-
define do_install
if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
@@ -204,7 +193,7 @@ config-clean:
$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
clean:
- $(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \
+ $(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so .*.d .*.cmd \
$(RM) LIBBPF-CFLAGS
$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
^ permalink raw reply [flat|nested] 5+ messages in thread* [bpf-next PATCH 3/3] libbpf: Makefile set specified permission mode
2018-01-16 23:20 [bpf-next PATCH 0/3] libbpf: cleanups to Makefile Jesper Dangaard Brouer
2018-01-16 23:20 ` [bpf-next PATCH 1/3] libbpf: install the header file libbpf.h Jesper Dangaard Brouer
2018-01-16 23:20 ` [bpf-next PATCH 2/3] libbpf: cleanup Makefile, remove unused elements Jesper Dangaard Brouer
@ 2018-01-16 23:20 ` Jesper Dangaard Brouer
2018-01-17 1:04 ` [bpf-next PATCH 0/3] libbpf: cleanups to Makefile Daniel Borkmann
3 siblings, 0 replies; 5+ messages in thread
From: Jesper Dangaard Brouer @ 2018-01-16 23:20 UTC (permalink / raw)
To: netdev, Daniel Borkmann, Alexei Starovoitov, wangnan0
Cc: jakub.kicinski, joe, linux-kernel, acme, eric,
Jesper Dangaard Brouer, jolsa
The third parameter to do_install was not used by $(INSTALL) command.
Fix this by only setting the -m option when the third parameter is supplied.
The use of a third parameter was introduced in commit eb54e522a000 ("bpf:
install libbpf headers on 'make install'").
Without this change, the header files are install as executables files (755).
Fixes: eb54e522a000 ("bpf: install libbpf headers on 'make install'")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
tools/lib/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 8e15e48cb8f8..83714ca1f22b 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -172,7 +172,7 @@ define do_install
if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
fi; \
- $(INSTALL) $1 '$(DESTDIR_SQ)$2'
+ $(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2'
endef
install_lib: all_cmd
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [bpf-next PATCH 0/3] libbpf: cleanups to Makefile
2018-01-16 23:20 [bpf-next PATCH 0/3] libbpf: cleanups to Makefile Jesper Dangaard Brouer
` (2 preceding siblings ...)
2018-01-16 23:20 ` [bpf-next PATCH 3/3] libbpf: Makefile set specified permission mode Jesper Dangaard Brouer
@ 2018-01-17 1:04 ` Daniel Borkmann
3 siblings, 0 replies; 5+ messages in thread
From: Daniel Borkmann @ 2018-01-17 1:04 UTC (permalink / raw)
To: Jesper Dangaard Brouer, netdev, Daniel Borkmann,
Alexei Starovoitov, wangnan0
Cc: jakub.kicinski, joe, linux-kernel, acme, eric, jolsa
On 01/17/2018 12:20 AM, Jesper Dangaard Brouer wrote:
> This patchset contains some small improvements and cleanup for
> the Makefile in tools/lib/bpf/.
>
> It worries me that the libbpf.so shared library is not versioned, but
> it not addressed in this patchset.
Looks good; applied it to bpf-next, thanks Jesper!
^ permalink raw reply [flat|nested] 5+ messages in thread