Skip to contentSkip to conversation

bpfilter: fix build error

PATCH Applied Matteo Croce 3 participants 4 messages Jun 19, 2018 – Jun 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpfilter: fix build error

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")
---
 net/bpfilter/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/bpfilter/Makefile +4 -2
index e0bbe7583e58..dd86b022eff0 100644
@@ -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
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

From: Matteo Croce <[email protected]>
Date: Tue, 19 Jun 2018 17:16:20 +0200

Quoted 7 lines

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

Applied.

#2 lore raw
In reply to Matteo Croce
Quoted 16 lines · On Tue, 19 Jun 2018 17:16:20 +0200 Matteo Croce <[email protected]> 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")
---
 net/bpfilter/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/bpfilter/Makefile +0 -0
index e0bbe7583e58..dd86b022eff0 100644

net/bpfilter/Makefile endif · line 25

Quoted 7 lines
net/bpfilter/Makefile +2 -2
@@ -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.

Signature · 1 line
Stefano
#3 lore raw
Quoted 31 lines · Stefano Brivio
Quoted 16 lines · On Tue, 19 Jun 2018 17:16:20 +0200 Matteo Croce <[email protected]> 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")
---
 net/bpfilter/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/bpfilter/Makefile +0 -0
index e0bbe7583e58..dd86b022eff0 100644

net/bpfilter/Makefile endif · line 25

Quoted 7 lines
net/bpfilter/Makefile +2 -2
@@ -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.

Quoted 2 lines

--
Stefano

Right, I've sent a proper fix.

Thanks,

Signature · 2 lines
Matteo Croce
per aspera ad upstream