netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bpfilter: fix build error
@ 2018-06-19 15:16 Matteo Croce
  2018-06-20  0:08 ` David Miller
  2018-06-20 12:39 ` Stefano Brivio
  0 siblings, 2 replies; 4+ messages in thread
From: Matteo Croce @ 2018-06-19 15:16 UTC (permalink / raw)
  To: netdev; +Cc: Alexei Starovoitov

bpfilter Makefile assumes that the system locale is en_US, and the
parsing of objdump output fails.
Set LC_ALL=C and, while at it, rewrite the objdump parsing so it spawns
only 2 processes instead of 7.

Fixes: d2ba09c17a064 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Matteo Croce <mcroce@redhat.com>
---
 net/bpfilter/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
index e0bbe7583e58..dd86b022eff0 100644
--- a/net/bpfilter/Makefile
+++ b/net/bpfilter/Makefile
@@ -21,8 +21,10 @@ endif
 # which bpfilter_kern.c passes further into umh blob loader at run-time
 quiet_cmd_copy_umh = GEN $@
       cmd_copy_umh = echo ':' > $(obj)/.bpfilter_umh.o.cmd; \
-      $(OBJCOPY) -I binary -O `$(OBJDUMP) -f $<|grep format|cut -d' ' -f8` \
-      -B `$(OBJDUMP) -f $<|grep architecture|cut -d, -f1|cut -d' ' -f2` \
+      $(OBJCOPY) -I binary \
+          `LC_ALL=C objdump -f net/bpfilter/bpfilter_umh \
+          |awk -F' |,' '/file format/{print "-O",$$NF} \
+          /^architecture:/{print "-B",$$2}'` \
       --rename-section .data=.init.rodata $< $@
 
 $(obj)/bpfilter_umh.o: $(obj)/bpfilter_umh
-- 
2.17.1

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

* Re: [PATCH] bpfilter: fix build error
  2018-06-19 15:16 [PATCH] bpfilter: fix build error Matteo Croce
@ 2018-06-20  0:08 ` David Miller
  2018-06-20 12:39 ` Stefano Brivio
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-06-20  0:08 UTC (permalink / raw)
  To: mcroce; +Cc: netdev, ast

From: Matteo Croce <mcroce@redhat.com>
Date: Tue, 19 Jun 2018 17:16:20 +0200

> bpfilter Makefile assumes that the system locale is en_US, and the
> parsing of objdump output fails.
> Set LC_ALL=C and, while at it, rewrite the objdump parsing so it spawns
> only 2 processes instead of 7.
> 
> Fixes: d2ba09c17a064 ("net: add skeleton of bpfilter kernel module")
> Signed-off-by: Matteo Croce <mcroce@redhat.com>

Applied.

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

* Re: [PATCH] bpfilter: fix build error
  2018-06-19 15:16 [PATCH] bpfilter: fix build error Matteo Croce
  2018-06-20  0:08 ` David Miller
@ 2018-06-20 12:39 ` Stefano Brivio
  2018-06-20 14:07   ` Matteo Croce
  1 sibling, 1 reply; 4+ messages in thread
From: Stefano Brivio @ 2018-06-20 12:39 UTC (permalink / raw)
  To: Matteo Croce; +Cc: netdev, Alexei Starovoitov

On Tue, 19 Jun 2018 17:16:20 +0200
Matteo Croce <mcroce@redhat.com> wrote:

> bpfilter Makefile assumes that the system locale is en_US, and the
> parsing of objdump output fails.
> Set LC_ALL=C and, while at it, rewrite the objdump parsing so it spawns
> only 2 processes instead of 7.
> 
> Fixes: d2ba09c17a064 ("net: add skeleton of bpfilter kernel module")
> Signed-off-by: Matteo Croce <mcroce@redhat.com>
> ---
>  net/bpfilter/Makefile | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
> index e0bbe7583e58..dd86b022eff0 100644
> --- a/net/bpfilter/Makefile
> +++ b/net/bpfilter/Makefile
> @@ -21,8 +21,10 @@ endif
>  # which bpfilter_kern.c passes further into umh blob loader at run-time
>  quiet_cmd_copy_umh = GEN $@
>        cmd_copy_umh = echo ':' > $(obj)/.bpfilter_umh.o.cmd; \
> -      $(OBJCOPY) -I binary -O `$(OBJDUMP) -f $<|grep format|cut -d' ' -f8` \
> -      -B `$(OBJDUMP) -f $<|grep architecture|cut -d, -f1|cut -d' ' -f2` \
> +      $(OBJCOPY) -I binary \
> +          `LC_ALL=C objdump -f net/bpfilter/bpfilter_umh \

Why do you use objdump instead of $(OBJDUMP) now? I guess this might
cause issues if you're cross-compiling.

-- 
Stefano

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

* Re: [PATCH] bpfilter: fix build error
  2018-06-20 12:39 ` Stefano Brivio
@ 2018-06-20 14:07   ` Matteo Croce
  0 siblings, 0 replies; 4+ messages in thread
From: Matteo Croce @ 2018-06-20 14:07 UTC (permalink / raw)
  To: Stefano Brivio; +Cc: netdev, Alexei Starovoitov

On Wed, Jun 20, 2018 at 12:39 PM Stefano Brivio <sbrivio@redhat.com> wrote:
>
> On Tue, 19 Jun 2018 17:16:20 +0200
> Matteo Croce <mcroce@redhat.com> wrote:
>
> > bpfilter Makefile assumes that the system locale is en_US, and the
> > parsing of objdump output fails.
> > Set LC_ALL=C and, while at it, rewrite the objdump parsing so it spawns
> > only 2 processes instead of 7.
> >
> > Fixes: d2ba09c17a064 ("net: add skeleton of bpfilter kernel module")
> > Signed-off-by: Matteo Croce <mcroce@redhat.com>
> > ---
> >  net/bpfilter/Makefile | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
> > index e0bbe7583e58..dd86b022eff0 100644
> > --- a/net/bpfilter/Makefile
> > +++ b/net/bpfilter/Makefile
> > @@ -21,8 +21,10 @@ endif
> >  # which bpfilter_kern.c passes further into umh blob loader at run-time
> >  quiet_cmd_copy_umh = GEN $@
> >        cmd_copy_umh = echo ':' > $(obj)/.bpfilter_umh.o.cmd; \
> > -      $(OBJCOPY) -I binary -O `$(OBJDUMP) -f $<|grep format|cut -d' ' -f8` \
> > -      -B `$(OBJDUMP) -f $<|grep architecture|cut -d, -f1|cut -d' ' -f2` \
> > +      $(OBJCOPY) -I binary \
> > +          `LC_ALL=C objdump -f net/bpfilter/bpfilter_umh \
>
> Why do you use objdump instead of $(OBJDUMP) now? I guess this might
> cause issues if you're cross-compiling.
>
> --
> Stefano

Right, I've sent a proper fix.

Thanks,
-- 
Matteo Croce
per aspera ad upstream

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

end of thread, other threads:[~2018-06-20 14:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-19 15:16 [PATCH] bpfilter: fix build error Matteo Croce
2018-06-20  0:08 ` David Miller
2018-06-20 12:39 ` Stefano Brivio
2018-06-20 14:07   ` Matteo Croce

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