Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932712AbcLOSa3 (ORCPT ); Thu, 15 Dec 2016 13:30:29 -0500 Received: from mail.kernel.org ([198.145.29.136]:41962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753631AbcLOSa1 (ORCPT ); Thu, 15 Dec 2016 13:30:27 -0500 Date: Thu, 15 Dec 2016 15:29:18 -0300 From: Arnaldo Carvalho de Melo To: Joe Stringer Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, wangnan0@huawei.com, ast@fb.com, daniel@iogearbox.net, Arnaldo Carvalho de Melo Subject: Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf Message-ID: <20161215182918.GG6866@kernel.org> References: <20161214224342.12858-1-joe@ovn.org> <20161214224342.12858-3-joe@ovn.org> <20161215155022.GE6866@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161215155022.GE6866@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3805 Lines: 88 Em Thu, Dec 15, 2016 at 12:50:22PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu: > > Now that libbpf under tools/lib/bpf/* is synced with the version from > > samples/bpf, we can get rid most of the libbpf library here. > > > > Signed-off-by: Joe Stringer > > Cc: Alexei Starovoitov > > Cc: Daniel Borkmann > > Cc: Wang Nan > > Link: http://lkml.kernel.org/r/20161209024620.31660-6-joe@ovn.org > > [ Use -I$(srctree)/tools/lib/ to support out of source code tree builds, as noticed by Wang Nan ] So, the above comment no longer applied to this adjusted patch from you, as you removed one hunk too much, that, after applied, gets samples/bpf/ to build successfully: diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index add514e2984a..81b0ef2f7994 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -107,6 +107,7 @@ always += lwt_len_hist_kern.o always += xdp_tx_iptunnel_kern.o HOSTCFLAGS += -I$(objtree)/usr/include +HOSTCFLAGS += -I$(srctree)/tools/lib/ HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable --------------------- I added it, continuing... - Arnaldo > > Signed-off-by: Arnaldo Carvalho de Melo > > So, right before this patch building samples/bpf works, then, after, it fails, > investigating: > > [root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ headers_install > make[1]: Entering directory '/tmp/build/linux' > CHK include/generated/uapi/linux/version.h > make[1]: Leaving directory '/tmp/build/linux' > [root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ samples/bpf/ > make[1]: Entering directory '/tmp/build/linux' > CHK include/config/kernel.release > GEN ./Makefile > CHK include/generated/uapi/linux/version.h > Using /git/linux as source for kernel > CHK include/generated/utsrelease.h > CHK include/generated/timeconst.h > CHK include/generated/bounds.h > CHK include/generated/asm-offsets.h > CALL /git/linux/scripts/checksyscalls.sh > HOSTCC samples/bpf/test_lru_dist.o > HOSTCC samples/bpf/libbpf.o > HOSTCC samples/bpf/sock_example.o > HOSTCC samples/bpf/bpf_load.o > In file included from /git/linux/samples/bpf/libbpf.c:12:0: > /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory > #include > ^ > compilation terminated. > In file included from /git/linux/samples/bpf/test_lru_dist.c:24:0: > /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory > #include > ^ > compilation terminated. > make[2]: *** [scripts/Makefile.host:124: samples/bpf/test_lru_dist.o] Error 1 > make[2]: *** Waiting for unfinished jobs.... > make[2]: *** [scripts/Makefile.host:124: samples/bpf/libbpf.o] Error 1 > In file included from /git/linux/samples/bpf/bpf_load.c:24:0: > /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory > #include > ^ > compilation terminated. > make[2]: *** [scripts/Makefile.host:124: samples/bpf/bpf_load.o] Error 1 > In file included from /git/linux/samples/bpf/sock_example.c:29:0: > /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory > #include > ^ > compilation terminated. > make[2]: *** [scripts/Makefile.host:124: samples/bpf/sock_example.o] Error 1 > make[1]: *** [/git/linux/Makefile:1659: samples/bpf/] Error 2 > make[1]: Leaving directory '/tmp/build/linux' > make: *** [Makefile:150: sub-make] Error 2 > [root@1e797fdfbf4f linux]#