From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: "Mickaël Salaün" <mic@digikod.net>
Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
"David S . Miller" <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v1] samples/bpf: Partially fixes the bpf.o build
Date: Thu, 25 Jan 2018 18:16:37 -0800 [thread overview]
Message-ID: <20180126021636.ghu7p7ds7yvkqato@ast-mbp> (raw)
In-Reply-To: <20180126003930.10573-1-mic@digikod.net>
On Fri, Jan 26, 2018 at 01:39:30AM +0100, Mickaël Salaün wrote:
> Do not build lib/bpf/bpf.o with this Makefile but use the one from the
> library directory. This avoid making a buggy bpf.o file (e.g. missing
> symbols).
could you provide an example?
What symbols will be missing?
I don't think there is an issue with existing Makefile.
> This patch is useful if some code (e.g. Landlock tests) needs both the
> bpf.o (from tools/lib/bpf) and the bpf_load.o (from samples/bpf).
is that some future patches?
we're trying to move everything form samples/bpf/ into selftests/bpf/
and convert to use libbpf.a instead of obsolete bpf_load.c
Please use this approach for landlock as well.
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> ---
>
> This is not a complet fix because the call to multi_depend with
> $(host-cmulti) from scripts/Makefile.host force the build of bpf.o
> anyway. I'm not sure how to completely avoid this automatic build
> though.
> ---
> samples/bpf/Makefile | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index 7f61a3d57fa7..64335bb94f9f 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -201,13 +201,16 @@ CLANG_ARCH_ARGS = -target $(ARCH)
> endif
>
> # Trick to allow make to be run from this directory
> -all:
> +all: $(LIBBPF)
> $(MAKE) -C ../../ $(CURDIR)/
>
> clean:
> $(MAKE) -C ../../ M=$(CURDIR) clean
> @rm -f *~
>
> +$(LIBBPF): FORCE
> + $(MAKE) -C $(dir $@) $(notdir $@)
> +
> $(obj)/syscall_nrs.s: $(src)/syscall_nrs.c
> $(call if_changed_dep,cc_s_c)
>
> --
> 2.15.1
>
next prev parent reply other threads:[~2018-01-26 2:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 0:39 Mickaël Salaün
2018-01-26 2:16 ` Alexei Starovoitov [this message]
2018-01-26 8:30 ` Mickaël Salaün
2018-01-26 23:10 ` Daniel Borkmann
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=20180126021636.ghu7p7ds7yvkqato@ast-mbp \
--to=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mic@digikod.net \
--cc=netdev@vger.kernel.org \
/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
all inboxes | Powered by JetHome®