From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Y Song <ys114321@gmail.com>
Cc: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>,
"Daniel Borkmann" <daniel@iogearbox.net>,
oss-drivers@netronome.com, netdev <netdev@vger.kernel.org>,
"Björn Töpel" <bjorn.topel@gmail.com>
Subject: Re: [PATCH bpf-next 3/4] samples: bpf: fix build after move to compiling full libbpf.a
Date: Mon, 14 May 2018 13:47:38 -0700 [thread overview]
Message-ID: <20180514134738.09dab501@cakuba> (raw)
In-Reply-To: <CAH3MdRW5160A5pN1ZndMHxiK142aaQF1xxk022HyrhGTsRjUxA@mail.gmail.com>
On Mon, 14 May 2018 12:12:05 -0700, Y Song wrote:
> On Fri, May 11, 2018 at 5:17 PM, Jakub Kicinski
> <jakub.kicinski@netronome.com> wrote:
> > There are many ways users may compile samples, some of them got
> > broken by commit 5f9380572b4b ("samples: bpf: compile and link
> > against full libbpf"). Improve path resolution and make libbpf
> > building a dependency of source files to force its build.
> >
> > Samples should now again build with any of:
> > cd samples/bpf; make
> > make samples/bpf
> > make -C samples/bpf
> > cd samples/bpf; make O=builddir
> > make samples/bpf O=builddir
> > make -C samples/bpf O=builddir
>
> I typically built samples/bpf/ this way:
> export KBUILD_OUTPUT=/home/yhs/linux-bld
> at linux source directory:
> make defconfig
> in /home/yhs/linux-bld,
> make -j100 && make headers_install && make samples/bpf/
Thanks Yonghong! I will add this to my tests.
> With this patch, the build for samples/bpf/ still failed.
>
> -bash-4.2$ make samples/bpf/
> CHK include/config/kernel.release
> Using /data/users/yhs/work/net-next as source for kernel
> GEN ./Makefile
> CHK include/generated/uapi/linux/version.h
> CHK include/generated/utsrelease.h
> CHK include/generated/bounds.h
> CHK include/generated/timeconst.h
> CHK include/generated/asm-offsets.h
> CALL /data/users/yhs/work/net-next/scripts/checksyscalls.sh
> DESCEND objtool
> CHK scripts/mod/devicetable-offsets.h
> scripts/Makefile.host:106: target
> `samples/bpf//data/users/yhs/work/net-next/samples/bpf/../../tools/lib/bpf/libbpf.a'
> doesn't match the target pattern
> make -C /data/users/yhs/work/net-next/samples/bpf/../../tools/lib/bpf/
> O= srctree=/data/users/yhs/work/net-next/samples/bpf/../../
>
> Auto-detecting system features:
> ... libelf: [ OFF ]
> ... bpf: [ OFF ]
>
> No libelf found
The problem now is that feature detection gets confused about where
its output directory is, I think. This is very similar to what Björn
reported.
> make[4]: *** [elfdep] Error 1
> make[3]: *** [/data/users/yhs/work/net-next/samples/bpf/../../tools/lib/bpf/libbpf.a]
> Error 2
> make[2]: *** [samples/bpf/] Error 2
> make[1]: *** [sub-make] Error 2
> make: *** [__sub-make] Error 2
> -bash-4.2$
>
> I noticied that I might use BPF_SAMPLES_PATH variable to tell where is
> the samples/bpf source.
> Below is what I did:
> -bash-4.2$ BPF_SAMPLES_PATH=../../../net-next/samples/bpf make
> samples/bpf/
> CHK include/config/kernel.release
> Using /data/users/yhs/work/net-next as source for kernel
> GEN ./Makefile
> CHK include/generated/uapi/linux/version.h
> CHK include/generated/utsrelease.h
> CHK include/generated/bounds.h
> CHK include/generated/timeconst.h
> CHK include/generated/asm-offsets.h
> CALL /data/users/yhs/work/net-next/scripts/checksyscalls.sh
> DESCEND objtool
> CHK scripts/mod/devicetable-offsets.h
> scripts/Makefile.host:106: target
> `samples/bpf/../../../net-next/samples/bpf/../../tools/lib/bpf/libbpf.a'
> doesn't match the target pattern
> CHK samples/bpf/syscall_nrs.h
> HOSTCC samples/bpf/../../../net-next/samples/bpf/../../tools/lib/bpf/libbpf.a
> gcc: fatal error: no input files
> compilation terminated.
> make[3]: *** [samples/bpf/../../../net-next/samples/bpf/../../tools/lib/bpf/libbpf.a]
> Error 4
> make[2]: *** [samples/bpf/] Error 2
> make[1]: *** [sub-make] Error 2
> make: *** [__sub-make] Error 2
> -bash-4.2$
>
> -bash-4.2$ pwd
> /home/yhs/work
> -bash-4.2$ ls
> linux-bld net-next
> -bash-4.2$
next prev parent reply other threads:[~2018-05-14 20:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-12 0:17 [PATCH bpf-next 0/4] samples: bpf: fix build after move to full libbpf Jakub Kicinski
2018-05-12 0:17 ` [PATCH bpf-next 1/4] samples: bpf: include bpf/bpf.h instead of local libbpf.h Jakub Kicinski
2018-05-12 0:17 ` [PATCH bpf-next 2/4] samples: bpf: rename libbpf.h to bpf_insn.h Jakub Kicinski
2018-05-12 0:17 ` [PATCH bpf-next 3/4] samples: bpf: fix build after move to compiling full libbpf.a Jakub Kicinski
2018-05-12 19:38 ` Jakub Kicinski
2018-05-12 23:22 ` Daniel Borkmann
2018-05-14 19:12 ` Y Song
2018-05-14 20:47 ` Jakub Kicinski [this message]
2018-05-12 0:17 ` [PATCH bpf-next 4/4] samples: bpf: move libbpf from object dependencies to libs Jakub Kicinski
2018-05-12 8:39 ` [PATCH bpf-next 0/4] samples: bpf: fix build after move to full libbpf Jesper Dangaard Brouer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180514134738.09dab501@cakuba \
--to=jakub.kicinski@netronome.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bjorn.topel@gmail.com \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
--cc=ys114321@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).