bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
	Martin Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
	john fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>
Subject: Re: [PATCH bpf-next v2 3/6] tools/bpftool: Fix cross-build
Date: Tue, 10 Nov 2020 13:43:13 +0100	[thread overview]
Message-ID: <20201110124313.GB1521675@myrica> (raw)
In-Reply-To: <CAEf4Bzaw9Fox6FZcT+ipFsnrHFRKrno27Y4Uh13eiNpd08es2g@mail.gmail.com>

On Mon, Nov 09, 2020 at 12:17:49PM -0800, Andrii Nakryiko wrote:
> On Mon, Nov 9, 2020 at 3:11 AM Jean-Philippe Brucker
> <jean-philippe@linaro.org> wrote:
> >
> > The bpftool build first creates an intermediate binary, executed on the
> > host, to generate skeletons required by the final build. When
> > cross-building bpftool for an architecture different from the host, the
> > intermediate binary should be built using the host compiler (gcc) and
> > the final bpftool using the cross compiler (e.g. aarch64-linux-gnu-gcc).
> >
> > Generate the intermediate objects into the bootstrap/ directory using
> > the host toolchain.
> >
> > Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> > ---
> >  tools/bpf/bpftool/Makefile | 32 +++++++++++++++++++++++++-------
> >  1 file changed, 25 insertions(+), 7 deletions(-)
> >
> > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> > index 1358c093b812..0705c48e0ce0 100644
> > --- a/tools/bpf/bpftool/Makefile
> > +++ b/tools/bpf/bpftool/Makefile
> > @@ -19,24 +19,36 @@ BPF_DIR = $(srctree)/tools/lib/bpf/
> >  ifneq ($(OUTPUT),)
> >    LIBBPF_OUTPUT = $(OUTPUT)/libbpf/
> >    LIBBPF_PATH = $(LIBBPF_OUTPUT)
> > +  BOOTSTRAP_OUTPUT = $(OUTPUT)/bootstrap/
> >  else
> 
> LIBBPF_OUTPUT is not set here, can you please fix that as well?

Ok. I'll set it to "", so the clean receipe doesn't remove the source tree

> 
> >    LIBBPF_PATH = $(BPF_DIR)
> > +  BOOTSTRAP_OUTPUT = $(CURDIR)/bootstrap/
> >  endif
> >
> 
> [...]
> 
> > -clean: $(LIBBPF)-clean feature-detect-clean
> > +clean: $(LIBBPF)-clean $(LIBBPF_BOOTSTRAP)-clean feature-detect-clean
> >         $(call QUIET_CLEAN, bpftool)
> >         $(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
> > -       $(Q)$(RM) -- $(BPFTOOL_BOOTSTRAP) $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
> > +       $(Q)$(RM) -- $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
> >         $(Q)$(RM) -r -- $(OUTPUT)libbpf/
> > +       $(Q)$(RM) -r -- $(BOOTSTRAP_OUTPUT)
> 
> Can you combine it with the previous line, maybe also specify more
> explicitly $(LIBBPF_OUTPUT) instead of $(OUTPUT)libbpf/?

Sure

Thanks,
Jean

> 
> >         $(call QUIET_CLEAN, core-gen)
> >         $(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.bpftool
> >         $(Q)$(RM) -r -- $(OUTPUT)feature/
> > --
> > 2.29.1
> >

  reply	other threads:[~2020-11-10 12:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 11:09 [PATCH bpf-next v2 0/6] tools/bpftool: Fix cross and out-of-tree builds Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 1/6] tools: Factor HOSTCC, HOSTLD, HOSTAR definitions Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 2/6] tools/bpftool: Force clean of out-of-tree build Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 3/6] tools/bpftool: Fix cross-build Jean-Philippe Brucker
2020-11-09 20:17   ` Andrii Nakryiko
2020-11-10 12:43     ` Jean-Philippe Brucker [this message]
2020-11-09 11:09 ` [PATCH bpf-next v2 4/6] tools/runqslower: Use Makefile.include Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 5/6] tools/runqslower: Enable out-of-tree build Jean-Philippe Brucker
2020-11-09 20:23   ` Andrii Nakryiko
2020-11-10 12:43     ` Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 6/6] tools/runqslower: Build bpftool using HOSTCC Jean-Philippe Brucker
2020-11-09 18:11 ` [PATCH bpf-next v2 0/6] tools/bpftool: Fix cross and out-of-tree builds Andrii Nakryiko
2020-11-10 12:42   ` Jean-Philippe Brucker
2020-11-10 18:38     ` Andrii Nakryiko

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=20201110124313.GB1521675@myrica \
    --to=jean-philippe@linaro.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.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).