All of lore.kernel.org
 help / color / mirror / Atom feed
* [bpf PATCH v2] bpf: fix for lex/yacc build error with gcc-5
@ 2018-04-25 21:22 John Fastabend
  2018-04-25 21:42 ` Daniel Borkmann
  2018-04-26  8:43 ` Jiri Benc
  0 siblings, 2 replies; 3+ messages in thread
From: John Fastabend @ 2018-04-25 21:22 UTC (permalink / raw)
  To: ast, daniel, jbenc; +Cc: netdev

Fix build error found with Ubuntu shipped gcc-5

~/git/bpf/tools/bpf$ make all

Auto-detecting system features:
...                        libbfd: [ OFF ]
...        disassembler-four-args: [ OFF ]

  CC       bpf_jit_disasm.o
  LINK     bpf_jit_disasm
  CC       bpf_dbg.o
/home/john/git/bpf/tools/bpf/bpf_dbg.c: In function ‘cmd_load’:
/home/john/git/bpf/tools/bpf/bpf_dbg.c:1077:13: warning: ‘cont’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  } else if (matches(subcmd, "pcap") == 0) {
             ^
  LINK     bpf_dbg
  CC       bpf_asm.o
make: *** No rule to make target `bpf_exp.yacc.o', needed by `bpf_asm'.  Stop.

Fixes: 5a8997f20715 ("tools: bpf: respect output directory during build")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
---
 tools/bpf/Makefile |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
index 1ea5459..53b60ad 100644
--- a/tools/bpf/Makefile
+++ b/tools/bpf/Makefile
@@ -76,6 +76,8 @@ $(OUTPUT)bpf_asm: $(OUTPUT)bpf_asm.o $(OUTPUT)bpf_exp.yacc.o $(OUTPUT)bpf_exp.le
 	$(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $^
 
 $(OUTPUT)bpf_exp.lex.c: $(OUTPUT)bpf_exp.yacc.c
+$(OUTPUT)bpf_exp.yacc.o: $(OUTPUT)bpf_exp.yacc.c
+$(OUTPUT)bpf_exp.lex.o: $(OUTPUT)bpf_exp.lex.c
 
 clean: bpftool_clean
 	$(call QUIET_CLEAN, bpf-progs)

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

* Re: [bpf PATCH v2] bpf: fix for lex/yacc build error with gcc-5
  2018-04-25 21:22 [bpf PATCH v2] bpf: fix for lex/yacc build error with gcc-5 John Fastabend
@ 2018-04-25 21:42 ` Daniel Borkmann
  2018-04-26  8:43 ` Jiri Benc
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2018-04-25 21:42 UTC (permalink / raw)
  To: John Fastabend, ast, jbenc; +Cc: netdev

On 04/25/2018 11:22 PM, John Fastabend wrote:
> Fix build error found with Ubuntu shipped gcc-5
> 
> ~/git/bpf/tools/bpf$ make all
> 
> Auto-detecting system features:
> ...                        libbfd: [ OFF ]
> ...        disassembler-four-args: [ OFF ]
> 
>   CC       bpf_jit_disasm.o
>   LINK     bpf_jit_disasm
>   CC       bpf_dbg.o
> /home/john/git/bpf/tools/bpf/bpf_dbg.c: In function ‘cmd_load’:
> /home/john/git/bpf/tools/bpf/bpf_dbg.c:1077:13: warning: ‘cont’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   } else if (matches(subcmd, "pcap") == 0) {
>              ^
>   LINK     bpf_dbg
>   CC       bpf_asm.o
> make: *** No rule to make target `bpf_exp.yacc.o', needed by `bpf_asm'.  Stop.
> 
> Fixes: 5a8997f20715 ("tools: bpf: respect output directory during build")
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>

Applied to bpf, thanks John! Will see to get that annoying bpf_dbg warn out
of the way if no one beats me to it. ;)

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

* Re: [bpf PATCH v2] bpf: fix for lex/yacc build error with gcc-5
  2018-04-25 21:22 [bpf PATCH v2] bpf: fix for lex/yacc build error with gcc-5 John Fastabend
  2018-04-25 21:42 ` Daniel Borkmann
@ 2018-04-26  8:43 ` Jiri Benc
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Benc @ 2018-04-26  8:43 UTC (permalink / raw)
  To: John Fastabend; +Cc: ast, daniel, netdev

On Wed, 25 Apr 2018 14:22:45 -0700, John Fastabend wrote:
> --- a/tools/bpf/Makefile
> +++ b/tools/bpf/Makefile
> @@ -76,6 +76,8 @@ $(OUTPUT)bpf_asm: $(OUTPUT)bpf_asm.o $(OUTPUT)bpf_exp.yacc.o $(OUTPUT)bpf_exp.le
>  	$(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $^
>  
>  $(OUTPUT)bpf_exp.lex.c: $(OUTPUT)bpf_exp.yacc.c
> +$(OUTPUT)bpf_exp.yacc.o: $(OUTPUT)bpf_exp.yacc.c
> +$(OUTPUT)bpf_exp.lex.o: $(OUTPUT)bpf_exp.lex.c

Looks better than v1, the first dependency is important.

For some reason, I did not need the other two rules.

By the way, make invoked from tools/bpf/ has never really worked, even
before my patchset. This works correctly:

cd tools
make bpf

 Jiri

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

end of thread, other threads:[~2018-04-26  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 21:22 [bpf PATCH v2] bpf: fix for lex/yacc build error with gcc-5 John Fastabend
2018-04-25 21:42 ` Daniel Borkmann
2018-04-26  8:43 ` Jiri Benc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.